]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
tests/gunit: disable execution with --gtest_shuffle
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Mon, 26 May 2025 05:29:47 +0000 (10:59 +0530)
committerKamalesh Babulal <kamalesh.babulal@oracle.com>
Wed, 13 Aug 2025 11:57:11 +0000 (17:27 +0530)
Some Google tests rely on being run in a specific order, with certain
tests depending on the successful completion of previous ones. Passing
the --gtest_shuffle option can break this sequence, potentially leading
to test failures or inconsistent results.

Until the test suite is updated to support randomized execution, skip
running tests when --gtest_shuffle is used.

Acked-by: Tom Hromatka <tom.hromatka@oracle.com>
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
tests/gunit/gtest.cpp

index b48200b09f9b05c5bb9f8929259a746356c4b6c7..650209153d123d5028530e280dac923a8e50ec30 100644 (file)
@@ -12,5 +12,9 @@ int main(int argc, char **argv)
 {
     ::testing::InitGoogleTest(&argc, argv);
 
+    if (testing::GTEST_FLAG(shuffle)) {
+           std::cout << "--gtest_shuffle option is not supported!" <<std::endl;
+           return 0;
+    }
     return RUN_ALL_TESTS();
 }