Skip to main content

Module test_detection

Module test_detection 

Source
Expand description

C++ test-file recognition and test-assertion smell detection.

analyzer/cpp/tests.rs in brokk-bifrost-analysis keeps the empty impl TestDetectionProvider for CppAnalyzer and the analyzer-bound fixture suites; everything here is a pure function of the file’s source text.

C++ recognizes the four framework macro families lexically rather than from the parse tree: TEST/TEST_F/TEST_P/TYPED_TEST (gtest), TEST_CASE/SCENARIO (Catch2), BOOST_AUTO_TEST_CASE and TEST_METHOD (MSTest) all expand from macros the grammar cannot see through.

Functions§

cpp_contains_tests
detect_cpp_test_assertion_smells