Skip to content

Commit

Permalink
test: fail replay test if jit cannot compile a script
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed Dec 20, 2023
1 parent 0fc3edd commit 9ca5448
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/jit.md
Expand Up @@ -81,7 +81,7 @@ These are useful config options:

- `[ZSCRIPT] print_zasm = 1`: for each script, write a file to `zscript-debug/zasm` printing the ZASM instructions
- `[ZSCRIPT] jit_print_asm = 1`: for each script, write a file to `zscript-debug/zasm` printing the x64 assembly
- `[ZSCRIPT] jit_exit_on_failure = 1`: exit program if JIT fails to compile any script
- `[ZSCRIPT] jit_fatal_compile_errors = 1`: exit program if JIT fails to compile any script

Given a replay that fails only when using JIT, this is how you can debug what's wrong with the compiled code.

Expand Down
2 changes: 1 addition & 1 deletion src/zc/zelda.cpp
Expand Up @@ -5115,7 +5115,7 @@ int main(int argc, char **argv)

DEBUG_PRINT_ZASM = zc_get_config("ZSCRIPT", "print_zasm", false);
DEBUG_JIT_PRINT_ASM = zc_get_config("ZSCRIPT", "jit_print_asm", false);
DEBUG_JIT_EXIT_ON_COMPILE_FAIL = zc_get_config("ZSCRIPT", "jit_exit_on_failure", false);
DEBUG_JIT_EXIT_ON_COMPILE_FAIL = zc_get_config("ZSCRIPT", "jit_fatal_compile_errors", false) || used_switch(argc, argv, "-jit-fatal-compile-error");
hangcount = zc_get_config("ZSCRIPT","ZASM_Hangcount",1000);
jit_set_enabled(zc_get_config("ZSCRIPT", "jit", false) || used_switch(argc, argv, "-jit") > 0);

Expand Down
1 change: 1 addition & 0 deletions tests/run_replay_tests.py
Expand Up @@ -665,6 +665,7 @@ def start_replay(self, player_args: StartReplayArgs):

if args.jit:
exe_args.append('-jit')
exe_args.append('-jit-fatal-compile-error')

if args.headless:
exe_args.append('-headless')
Expand Down

0 comments on commit 9ca5448

Please sign in to comment.