C++: Detect GoogleTest tests cases in FNumberOfTests.ql

Co-authored-by: Jonas Jensen <jbj@github.com>
This commit is contained in:
Brian Gianforcaro
2020-08-13 00:13:18 +00:00
committed by Brian Gianforcaro
parent de87f8fc42
commit a6bcbe7974

View File

@@ -18,6 +18,9 @@ Expr getTest() {
or
// boost tests; http://www.boost.org/
result.(FunctionCall).getTarget().hasQualifiedName("boost::unit_test", "make_test_case")
or
// googletest tests; https://github.com/google/googletest/
result.(FunctionCall).getTarget().hasQualifiedName("testing::internal", "MakeAndRegisterTestInfo")
}
from File f, int n