mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:37:35 +00:00
LibTest: Emit a profile signpost at the start of each test
This makes it super easy to see which test is which when browsing a profile of the test runner. :^)
This commit is contained in:
parent
1e90a3a542
commit
0c39f8128d
1 changed files with 9 additions and 0 deletions
|
@ -35,6 +35,10 @@
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#if __serenity__
|
||||||
|
# include <serenity.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define STRCAT(x, y) __STRCAT(x, y)
|
#define STRCAT(x, y) __STRCAT(x, y)
|
||||||
#define STRSTRCAT(x, y) __STRSTRCAT(x, y)
|
#define STRSTRCAT(x, y) __STRSTRCAT(x, y)
|
||||||
#define __STRCAT(x, y) x #y
|
#define __STRCAT(x, y) x #y
|
||||||
|
@ -250,6 +254,11 @@ inline JSFileResult TestRunner::run_file_test(const String& test_path)
|
||||||
{
|
{
|
||||||
g_currently_running_test = test_path;
|
g_currently_running_test = test_path;
|
||||||
|
|
||||||
|
#ifdef __serenity__
|
||||||
|
auto string_id = perf_register_string(test_path.characters(), test_path.length());
|
||||||
|
perf_event(PERF_EVENT_SIGNPOST, string_id, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
double start_time = get_time_in_ms();
|
double start_time = get_time_in_ms();
|
||||||
auto interpreter = JS::Interpreter::create<TestRunnerGlobalObject>(*g_vm);
|
auto interpreter = JS::Interpreter::create<TestRunnerGlobalObject>(*g_vm);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue