summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2022-02-22 07:49:04 +0330
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2022-02-23 03:17:12 +0330
commitbed129a69fd1e29808361fba0fa08ed42c8be4d5 (patch)
tree6c796b649fab4b2721999d6401d24205f0990dfe /Userland/Libraries
parent0fe97cdfe491d4a4e0f8490fb409e1f075b14b3b (diff)
downloadserenity-bed129a69fd1e29808361fba0fa08ed42c8be4d5.zip
LibTest+Spreadsheet: Add some basic spreadsheet runtime behaviour tests
As there's a somewhat active development going on, let's keep the expected behaviour under tests to make sure nothing blows up :^)
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibTest/JavaScriptTestRunner.h20
-rw-r--r--Userland/Libraries/LibTest/JavaScriptTestRunnerMain.cpp2
2 files changed, 11 insertions, 11 deletions
diff --git a/Userland/Libraries/LibTest/JavaScriptTestRunner.h b/Userland/Libraries/LibTest/JavaScriptTestRunner.h
index 69a1556be5..5b25df2c2b 100644
--- a/Userland/Libraries/LibTest/JavaScriptTestRunner.h
+++ b/Userland/Libraries/LibTest/JavaScriptTestRunner.h
@@ -89,14 +89,14 @@
#define TEST_ROOT(path) \
String Test::JS::g_test_root_fragment = path
-#define TESTJS_RUN_FILE_FUNCTION(...) \
- struct __TestJS_run_file { \
- __TestJS_run_file() \
- { \
- ::Test::JS::g_run_file = hook; \
- } \
- static ::Test::JS::IntermediateRunFileResult hook(const String&, JS::Interpreter&); \
- } __testjs_common_run_file {}; \
+#define TESTJS_RUN_FILE_FUNCTION(...) \
+ struct __TestJS_run_file { \
+ __TestJS_run_file() \
+ { \
+ ::Test::JS::g_run_file = hook; \
+ } \
+ static ::Test::JS::IntermediateRunFileResult hook(const String&, JS::Interpreter&, JS::ExecutionContext&); \
+ } __testjs_common_run_file {}; \
::Test::JS::IntermediateRunFileResult __TestJS_run_file::hook(__VA_ARGS__)
#define TESTJS_CREATE_INTERPRETER_HOOK(...) \
@@ -163,7 +163,7 @@ enum class RunFileHookResult {
};
using IntermediateRunFileResult = AK::Result<JSFileResult, RunFileHookResult>;
-extern IntermediateRunFileResult (*g_run_file)(const String&, JS::Interpreter&);
+extern IntermediateRunFileResult (*g_run_file)(const String&, JS::Interpreter&, JS::ExecutionContext&);
class TestRunner : public ::Test::TestRunner {
public:
@@ -300,7 +300,7 @@ inline JSFileResult TestRunner::run_file_test(const String& test_path)
interpreter->heap().set_should_collect_on_every_allocation(g_collect_on_every_allocation);
if (g_run_file) {
- auto result = g_run_file(test_path, *interpreter);
+ auto result = g_run_file(test_path, *interpreter, global_execution_context);
if (result.is_error() && result.error() == RunFileHookResult::SkipFile) {
return {
test_path,
diff --git a/Userland/Libraries/LibTest/JavaScriptTestRunnerMain.cpp b/Userland/Libraries/LibTest/JavaScriptTestRunnerMain.cpp
index 108a8ba21e..ebff8e9e5a 100644
--- a/Userland/Libraries/LibTest/JavaScriptTestRunnerMain.cpp
+++ b/Userland/Libraries/LibTest/JavaScriptTestRunnerMain.cpp
@@ -25,7 +25,7 @@ HashMap<String, FunctionWithLength> s_exposed_global_functions;
Function<void()> g_main_hook;
Function<NonnullOwnPtr<JS::Interpreter>()> g_create_interpreter_hook;
HashMap<bool*, Tuple<String, String, char>> g_extra_args;
-IntermediateRunFileResult (*g_run_file)(const String&, JS::Interpreter&) = nullptr;
+IntermediateRunFileResult (*g_run_file)(const String&, JS::Interpreter&, JS::ExecutionContext&) = nullptr;
String g_test_root;
int g_test_argc;
char** g_test_argv;