[llvm] r340935 - [DebugCounters] Fix DebugCounterTest when running all SupportTests

Alexandre Ganea via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 29 09:11:49 PDT 2018


Author: aganea
Date: Wed Aug 29 09:11:48 2018
New Revision: 340935

URL: http://llvm.org/viewvc/llvm-project?rev=340935&view=rev
Log:
[DebugCounters] Fix DebugCounterTest when running all SupportTests

Previously, the DebugCounterTest was failing because CommandLineTest.GetCommandLineArguments was clearing all the global singletons.

Differential Revision: https://reviews.llvm.org/D51423

Modified:
    llvm/trunk/unittests/Support/DebugCounterTest.cpp

Modified: llvm/trunk/unittests/Support/DebugCounterTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/DebugCounterTest.cpp?rev=340935&r1=340934&r2=340935&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/DebugCounterTest.cpp (original)
+++ llvm/trunk/unittests/Support/DebugCounterTest.cpp Wed Aug 29 09:11:48 2018
@@ -14,10 +14,9 @@
 using namespace llvm;
 
 #ifndef NDEBUG
-DEBUG_COUNTER(TestCounter, "test-counter",
-              "Counter used for unit test");
-
 TEST(DebugCounterTest, CounterCheck) {
+  DEBUG_COUNTER(TestCounter, "test-counter", "Counter used for unit test");
+
   EXPECT_FALSE(DebugCounter::isCounterSet(TestCounter));
 
   auto DC = &DebugCounter::instance();




More information about the llvm-commits mailing list