This feature allows developers to temporarily disable specific tests without removing them from the codebase. This is particularly useful when:
Working on experimental features
Dealing with temporarily broken tests
Handling environment-dependent tests
Managing long-running tests during development
New Macros โจ
Two new macros have been added:
IGNORE_TEST() - for regular test cases
IGNORE_TEST_F() - for fixture-based tests
Usage Example ๐ก
#include <tau/tau.h>
// Regular test case that will be executed
TEST(MathSuite, Addition) {
int result = 2 + 2;
CHECK_EQ(result, 4);
}
// This test will be ignored but remains in the codebase
IGNORE_TEST(MathSuite, ComplexCalculation) {
int result = perform_complex_calculation();
CHECK_EQ(result, 42);
}
// Setup for fixture
TEST_F_SETUP(DatabaseFixture) {
tau->db = database_connect();
}
// Teardown for fixture
TEST_F_TEARDOWN(DatabaseFixture) {
database_disconnect(tau->db);
}
// This fixture test will be ignored but setup/teardown are preserved
IGNORE_TEST_F(DatabaseFixture, SlowQuery) {
bool query_result = database_execute_heavy_query(tau->db);
CHECK_TRUE(query_result);
}
// This fixture test will run normally
TEST_F(DatabaseFixture, QuickQuery) {
bool query_result = database_execute_simple_query(tau->db);
CHECK_TRUE(query_result);
}
TAU_MAIN()
Output Example ๐ฅ๏ธ
[==========] Running 4 test suites.
[ RUN ] MathSuite.Addition
[ OK ] MathSuite.Addition (0.001s)
[ IGNORED ] MathSuite.ComplexCalculation
[ RUN ] DatabaseFixture.QuickQuery
[ OK ] DatabaseFixture.QuickQuery (0.003s)
[ IGNORED ] DatabaseFixture.SlowQuery
[==========] 2 test suites ran
[ PASSED ] 2 suites
Summary:
Total test suites: 4
Total suites run: 2
Total warnings generated: 0
Total suites skipped: 2
Total suites failed: 0
Implementation Details ๐ง
Added ignored flag to test suite structure
Extended test registration to support ignored state
Modified test runner to handle ignored tests
Maintained existing color coding (yellow for ignored tests)
Updated test statistics to properly count ignored tests
Add IGNORE_TEST and IGNORE_TEST_F macros ๐
This feature allows developers to temporarily disable specific tests without removing them from the codebase. This is particularly useful when:
New Macros โจ
Two new macros have been added:
IGNORE_TEST()
- for regular test casesIGNORE_TEST_F()
- for fixture-based testsUsage Example ๐ก
Output Example ๐ฅ๏ธ
Implementation Details ๐ง
ignored
flag to test suite structureBackwards Compatibility โก
This change is fully backwards compatible:
Testing ๐งช
The implementation has been tested with: