base,tests: Fix trace.test.cc for .fast

Due to DPRINTFs compiling in all cases:
https://gem5-review.googlesource.com/c/public/gem5/+/44988,
trace.test.cc failed to compile for the .fast build (`scons
build/NULL/unittests.fast`). This patch fixes this by moving the
DPRINTFs into the `TRACING_ON` compile guards.

Change-Id: Ib37b2d90f19b9dbc1503941d69d5a2dc0c1c9d9b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/46959
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Bobby R. Bruce
2021-06-17 11:16:53 -07:00
parent 499a1cc7e8
commit 4b7e67b151

View File

@@ -491,19 +491,19 @@ TEST(TraceTest, MacroDPRINTFS)
Trace::enable();
EXPECT_TRUE(Debug::changeFlag("TraceTestDebugFlag", true));
EXPECT_TRUE(Debug::changeFlag("FmtFlag", true));
DPRINTFS(TraceTestDebugFlag, named_ptr, "Test message");
#if TRACING_ON
DPRINTFS(TraceTestDebugFlag, named_ptr, "Test message");
ASSERT_EQ(getString(Trace::output()),
" 0: TraceTestDebugFlag: Foo: Test message");
#else
ASSERT_EQ(getString(Trace::output()), "");
#endif
// Flag disabled
Trace::disable();
EXPECT_TRUE(Debug::changeFlag("TraceTestDebugFlag", false));
#if TRACING_ON
DPRINTFS(TraceTestDebugFlag, named_ptr, "Test message");
ASSERT_EQ(getString(Trace::output()), "");
#endif
}
/** Test DPRINTFR with tracing on. */