MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / TEST

Function TEST

test/timer_test.cpp:42–63  ·  view source on GitHub ↗

This unit test checks whether the actual output of MockTimer::Report() is the same as fixed CPU/WALL/USR/SYS time, RSS delta, and the delta of the number of page faults that are returned by MockTimer.

Source from the content-addressed store, hash-verified

40// same as fixed CPU/WALL/USR/SYS time, RSS delta, and the delta of the number
41// of page faults that are returned by MockTimer.
42TEST(MockTimer, DoNothing) {
43 std::ostringstream buf;
44
45 PrintTimerDescription(&buf);
46 MockTimer timer(&buf);
47 timer.Start();
48
49 // Do nothing.
50
51 timer.Stop();
52 timer.Report("TimerTest");
53
54 EXPECT_EQ(0.019123, timer.CPUTime());
55 EXPECT_EQ(0.019723, timer.WallTime());
56 EXPECT_EQ(0.012723, timer.UserTime());
57 EXPECT_EQ(0.002723, timer.SystemTime());
58 EXPECT_EQ(
59 " PASS name CPU time WALL time USR time"
60 " SYS time\n TimerTest 0.02 0.02"
61 " 0.01 0.00\n",
62 buf.str());
63}
64
65// This unit test checks whether the ScopedTimer<MockTimer> correctly reports
66// the fixed CPU/WALL/USR/SYS time, RSS delta, and the delta of the number of

Callers

nothing calls this directly

Calls 9

PrintTimerDescriptionFunction · 0.85
ReportMethod · 0.80
StartMethod · 0.45
StopMethod · 0.45
CPUTimeMethod · 0.45
WallTimeMethod · 0.45
UserTimeMethod · 0.45
SystemTimeMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected