Skip to content

Commit a6bcbe7

Browse files
bgianfojbj
authored andcommitted
C++: Detect GoogleTest tests cases in FNumberOfTests.ql
Co-authored-by: Jonas Jensen <[email protected]>
1 parent de87f8f commit a6bcbe7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cpp/ql/src/Metrics/Files/FNumberOfTests.ql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ Expr getTest() {
1818
or
1919
// boost tests; http://www.boost.org/
2020
result.(FunctionCall).getTarget().hasQualifiedName("boost::unit_test", "make_test_case")
21+
or
22+
// googletest tests; https://github.com/google/googletest/
23+
result.(FunctionCall).getTarget().hasQualifiedName("testing::internal", "MakeAndRegisterTestInfo")
2124
}
2225

2326
from File f, int n

0 commit comments

Comments
 (0)