KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_text_eval_parser_vcs.cpp File Reference

Test suite for text_eval_parser VCS functionality. More...

#include <qa_utils/wx_utils/unit_test_utils.h>
#include <text_eval/text_eval_wrapper.h>
#include <git/git_backend.h>
#include <git/libgit_backend.h>
#include <git2.h>
#include <chrono>
#include <fstream>
#include <regex>
#include <wx/dir.h>
#include <wx/filename.h>
#include <wx/utils.h>

Go to the source code of this file.

Classes

struct  VCS_TEST_FIXTURE
 Fixture that creates a temporary git repo with one committed file. More...
 

Functions

 BOOST_AUTO_TEST_CASE (VcsIdentifierFormatting)
 Test VCS identifier functions with various lengths.
 
 BOOST_AUTO_TEST_CASE (VcsBranchAndAuthorInfo)
 Test VCS branch and author information against known fixture values.
 
 BOOST_AUTO_TEST_CASE (VcsDirtyStatus)
 Test VCS dirty status functions.
 
 BOOST_AUTO_TEST_CASE (VcsDirtySuffix)
 Test VCS dirty suffix functions.
 
 BOOST_AUTO_TEST_CASE (VcsLabelsAndDistance)
 Test VCS label and distance functions.
 
 BOOST_AUTO_TEST_CASE (VcsCommitDate)
 Test VCS commit date formatting.
 
 BOOST_AUTO_TEST_CASE (VcsPerformance)
 Test performance of VCS operations.
 
 BOOST_AUTO_TEST_CASE (VcsMixedExpressions)
 Test mixed VCS and non-VCS expressions.
 

Variables

static const char * TEST_AUTHOR_NAME = "Test Author"
 
static const char * TEST_AUTHOR_EMAIL = "[email protected]"
 
static const char * TEST_COMMIT_MSG = "Initial test commit"
 

Detailed Description

Test suite for text_eval_parser VCS functionality.

Creates a temporary git repository so tests are self-contained and work regardless of whether the build directory is inside the source tree.

Definition in file test_text_eval_parser_vcs.cpp.

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/8]

BOOST_AUTO_TEST_CASE ( VcsBranchAndAuthorInfo )

Test VCS branch and author information against known fixture values.

Definition at line 223 of file test_text_eval_parser_vcs.cpp.

References BOOST_CHECK_EQUAL(), EXPRESSION_EVALUATOR::Evaluate(), EXPRESSION_EVALUATOR::HasErrors(), TEST_AUTHOR_EMAIL, and TEST_AUTHOR_NAME.

◆ BOOST_AUTO_TEST_CASE() [2/8]

BOOST_AUTO_TEST_CASE ( VcsCommitDate )

◆ BOOST_AUTO_TEST_CASE() [3/8]

BOOST_AUTO_TEST_CASE ( VcsDirtyStatus )

Test VCS dirty status functions.

Definition at line 262 of file test_text_eval_parser_vcs.cpp.

References EXPRESSION_EVALUATOR::Evaluate(), EXPRESSION_EVALUATOR::HasErrors(), and result.

◆ BOOST_AUTO_TEST_CASE() [4/8]

BOOST_AUTO_TEST_CASE ( VcsDirtySuffix )

Test VCS dirty suffix functions.

Definition at line 291 of file test_text_eval_parser_vcs.cpp.

References EXPRESSION_EVALUATOR::Evaluate(), and EXPRESSION_EVALUATOR::HasErrors().

◆ BOOST_AUTO_TEST_CASE() [5/8]

BOOST_AUTO_TEST_CASE ( VcsIdentifierFormatting )

◆ BOOST_AUTO_TEST_CASE() [6/8]

BOOST_AUTO_TEST_CASE ( VcsLabelsAndDistance )

Test VCS label and distance functions.

Definition at line 313 of file test_text_eval_parser_vcs.cpp.

References EXPRESSION_EVALUATOR::Evaluate(), EXPRESSION_EVALUATOR::HasErrors(), and result.

◆ BOOST_AUTO_TEST_CASE() [7/8]

BOOST_AUTO_TEST_CASE ( VcsMixedExpressions )

Test mixed VCS and non-VCS expressions.

Definition at line 409 of file test_text_eval_parser_vcs.cpp.

References EXPRESSION_EVALUATOR::Evaluate(), EXPRESSION_EVALUATOR::HasErrors(), result, and EXPRESSION_EVALUATOR::SetVariable().

◆ BOOST_AUTO_TEST_CASE() [8/8]

BOOST_AUTO_TEST_CASE ( VcsPerformance )

Test performance of VCS operations.

Definition at line 386 of file test_text_eval_parser_vcs.cpp.

References end, EXPRESSION_EVALUATOR::Evaluate(), EXPRESSION_EVALUATOR::HasErrors(), and result.

Variable Documentation

◆ TEST_AUTHOR_EMAIL

const char* TEST_AUTHOR_EMAIL = "[email protected]"
static

◆ TEST_AUTHOR_NAME

const char* TEST_AUTHOR_NAME = "Test Author"
static

◆ TEST_COMMIT_MSG

const char* TEST_COMMIT_MSG = "Initial test commit"
static

Definition at line 49 of file test_text_eval_parser_vcs.cpp.

Referenced by VCS_TEST_FIXTURE::initRepo().