11#include <QTemporaryFile>
22 void benchmarkTraceOff();
23 void benchmarkTraceDurationOff();
27 QTemporaryFile m_tempFile;
33 qputenv(
"KWIN_PERF_FTRACE_FILE", m_tempFile.fileName().toLatin1());
35 KWin::FTraceLogger::create();
38void TestFTrace::benchmarkTraceOff()
42 fTrace(
"BENCH", 123,
"foo");
46void TestFTrace::benchmarkTraceDurationOff()
53void TestFTrace::enable()
55 KWin::FTraceLogger::self()->setEnabled(
true);
56 QVERIFY(KWin::FTraceLogger::self()->isEnabled());
59 fTrace(
"TEST", 123,
"foo");
61 fTrace(
"TEST", 123,
"foo");
64 QCOMPARE(m_tempFile.readLine(),
"TEST123foo\n");
65 QCOMPARE(m_tempFile.readLine(),
"TEST_DURATIONboo begin_ctx=1\n");
66 QCOMPARE(m_tempFile.readLine(),
"TEST123foo\n");
67 QCOMPARE(m_tempFile.readLine(),
"TEST_DURATIONboo end_ctx=1\n");
72#include "test_ftrace.moc"
#define fTraceDuration(...)
QTEST_MAIN(OnScreenNotificationTest)