test-js+test-web: Replace JSTestRunnerCounts with Test::Counts

This commit is contained in:
Linus Groh 2021-03-23 23:20:45 +01:00 committed by Andreas Kling
parent bce1f956e7
commit edb6ada3ef
Notes: sideshowbarker 2024-07-18 21:06:35 +09:00
2 changed files with 5 additions and 23 deletions

View File

@ -1,6 +1,6 @@
/*
* Copyright (c) 2020, Matthew Olsson <matthewcolsson@gmail.com>
* Copyright (c) 2020, Linus Groh <mail@linusgroh.de>
* Copyright (c) 2020-2021, Linus Groh <mail@linusgroh.de>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -68,15 +68,6 @@ struct JSFileResult {
Vector<String> logged_messages {};
};
struct JSTestRunnerCounts {
int tests_failed { 0 };
int tests_passed { 0 };
int tests_skipped { 0 };
int suites_failed { 0 };
int suites_passed { 0 };
int files_total { 0 };
};
class TestRunnerGlobalObject final : public JS::GlobalObject {
JS_OBJECT(TestRunnerGlobalObject, JS::GlobalObject);
@ -109,7 +100,7 @@ public:
void run();
const JSTestRunnerCounts& counts() const { return m_counts; }
const Test::Counts& counts() const { return m_counts; }
bool is_printing_progress() const { return m_print_progress; }
@ -126,7 +117,7 @@ protected:
bool m_print_progress;
double m_total_elapsed_time_in_ms { 0 };
JSTestRunnerCounts m_counts;
Test::Counts m_counts;
RefPtr<JS::Program> m_test_program;
};

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, The SerenityOS developers.
* Copyright (c) 2020-2021, The SerenityOS developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -66,15 +66,6 @@ struct JSFileResult {
Vector<String> logged_messages {};
};
struct JSTestRunnerCounts {
int tests_failed { 0 };
int tests_passed { 0 };
int tests_skipped { 0 };
int suites_failed { 0 };
int suites_passed { 0 };
int files_total { 0 };
};
Function<void(const URL&)> g_on_page_change;
class TestRunnerObject final : public JS::Object {
@ -138,7 +129,7 @@ private:
bool m_print_times;
double m_total_elapsed_time_in_ms { 0 };
JSTestRunnerCounts m_counts;
Test::Counts m_counts;
RefPtr<Web::InProcessWebView> m_page_view;