Skip to content

Commit 1fdbcf1

Browse files
davidotlinusg
authored andcommitted
runner: Add --debug, -d option to optionally enable dbgln
1 parent 7a81687 commit 1fdbcf1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,13 +536,15 @@ void __assert_fail(const char* assertion, const char* file, unsigned int line, c
536536
int main(int argc, char** argv)
537537
{
538538
int timeout = 10;
539+
bool enable_debug_printing = false;
539540

540541
Core::ArgsParser args_parser;
541542
args_parser.set_general_help("LibJS test262 runner for streaming tests");
542543
args_parser.add_option(s_harness_file_directory, "Directory containing the harness files", "harness-location", 'l', "harness-files");
543544
args_parser.add_option(s_use_bytecode, "Use the bytecode interpreter", "use-bytecode", 'b');
544545
args_parser.add_option(s_parse_only, "Only parse the files", "parse-only", 'p');
545546
args_parser.add_option(timeout, "Seconds before test should timeout", "timeout", 't', "seconds");
547+
args_parser.add_option(enable_debug_printing, "Enable debug printing", "debug", 'd');
546548
args_parser.parse(argc, argv);
547549

548550
if (s_harness_file_directory.is_empty()) {
@@ -559,7 +561,7 @@ int main(int argc, char** argv)
559561
return 2;
560562
}
561563

562-
AK::set_debug_enabled(false);
564+
AK::set_debug_enabled(enable_debug_printing);
563565

564566
// The piping stuff is based on https://stackoverflow.com/a/956269.
565567
constexpr auto BUFFER_SIZE = 1 * KiB;

0 commit comments

Comments
 (0)