File tree Expand file tree Collapse file tree 2 files changed +28
-5
lines changed Expand file tree Collapse file tree 2 files changed +28
-5
lines changed Original file line number Diff line number Diff line change 1+ #include < gtest/gtest.h>
2+
3+ // musl's mallocng memory allocator stupidly crash for test names that are
4+ // lengthier than 16 characters. Hence the long test name.
5+ TEST (Fixture, testWithLongLongLongName) {
6+ EXPECT_LT (1 , 2 );
7+ }
8+
9+ int main () {
10+ testing::InitGoogleTest ();
11+ return RUN_ALL_TESTS ();
12+ }
Original file line number Diff line number Diff line change @@ -244,11 +244,22 @@ if netconf_opt.enabled() and NETCONF_DEP.get_variable(
244244 error (' Dependency not found: NETCONF.' )
245245endif
246246
247- GTEST_DEP = dependency (
248- ' gtest' ,
249- fallback : [' gtest' , ' gtest_dep' ],
250- required : TESTS_OPT.enabled() or FUZZ_OPT.enabled(),
251- )
247+ # Google Test
248+ GTEST_DEP = dependency (' gtest' , required : TESTS_OPT.enabled() or FUZZ_OPT.enabled())
249+ if GTEST_DEP.found()
250+ result = cpp.run(
251+ fs.read(' compiler-checks/gtest.cc' ),
252+ name : ' Check if a simple GTest test runs.' ,
253+ dependencies : [GTEST_DEP],
254+ )
255+ if result.returncode() != 0
256+ GTEST_DEP = disabler ()
257+ gtest_subproject = subproject (' gtest' , required : false )
258+ if gtest_subproject.found()
259+ GTEST_DEP = gtest_subproject.get_variable (' gtest_dep' )
260+ endif
261+ endif
262+ endif
252263
253264# Crypto
254265if crypto_opt == ' botan'
You can’t perform that action at this time.
0 commit comments