forked from qt-creator/qt-creator
debugger: add 'inline benchmarking' for the plugin itself
Change-Id: Iad7e197f7d7ee14156562c3de7960fe65c7e85fe Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -134,8 +134,14 @@
|
|||||||
#include <QtTest/QTest>
|
#include <QtTest/QTest>
|
||||||
#include <QtTest/QSignalSpy>
|
#include <QtTest/QSignalSpy>
|
||||||
#include <QtTest/QTestEventLoop>
|
#include <QtTest/QTestEventLoop>
|
||||||
|
|
||||||
|
//#define WITH_BENCHMARK
|
||||||
|
#ifdef WITH_BENCHMARK
|
||||||
|
#include <valgrind/callgrind.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif // WITH_TESTS
|
||||||
|
|
||||||
#include <climits>
|
#include <climits>
|
||||||
|
|
||||||
#define DEBUG_STATE 1
|
#define DEBUG_STATE 1
|
||||||
@@ -864,13 +870,14 @@ public slots:
|
|||||||
void testStateMachine2();
|
void testStateMachine2();
|
||||||
void testStateMachine3();
|
void testStateMachine3();
|
||||||
|
|
||||||
|
void testBenchmark1();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool m_testSuccess;
|
bool m_testSuccess;
|
||||||
QList<TestCallBack> m_testCallbacks;
|
QList<TestCallBack> m_testCallbacks;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void updateDebugActions();
|
void updateDebugActions();
|
||||||
|
|
||||||
@@ -3835,7 +3842,34 @@ void DebuggerPluginPrivate::testStateMachine3()
|
|||||||
testUnloadProject();
|
testUnloadProject();
|
||||||
testFinished();
|
testFinished();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void DebuggerPlugin::testBenchmark()
|
||||||
|
{
|
||||||
|
theDebuggerCore->testBenchmark1();
|
||||||
|
}
|
||||||
|
|
||||||
|
enum FakeEnum { FakeDebuggerCommonSettingsId };
|
||||||
|
|
||||||
|
void DebuggerPluginPrivate::testBenchmark1()
|
||||||
|
{
|
||||||
|
#ifdef WITH_BENCHMARK
|
||||||
|
CALLGRIND_START_INSTRUMENTATION;
|
||||||
|
volatile Core::Id id1 = Core::Id(DEBUGGER_COMMON_SETTINGS_ID);
|
||||||
|
CALLGRIND_STOP_INSTRUMENTATION;
|
||||||
|
CALLGRIND_DUMP_STATS;
|
||||||
|
|
||||||
|
CALLGRIND_START_INSTRUMENTATION;
|
||||||
|
volatile FakeEnum id2 = FakeDebuggerCommonSettingsId;
|
||||||
|
CALLGRIND_STOP_INSTRUMENTATION;
|
||||||
|
CALLGRIND_DUMP_STATS;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif // if WITH_TESTS
|
||||||
|
|
||||||
} // namespace Debugger
|
} // namespace Debugger
|
||||||
|
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ private:
|
|||||||
|
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
private slots:
|
private slots:
|
||||||
|
void testBenchmark();
|
||||||
void testPythonDumpers();
|
void testPythonDumpers();
|
||||||
void testStateMachine();
|
void testStateMachine();
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user