Add runtime option "--call-on-exit [FUNCNAME]" to main-unix.c (#3518)

With this option you can call a function after the user script and promises have ran, to be able to do assertions that are executed just before the process would exit.

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
This commit is contained in:
Daniel Balla
2020-01-15 17:10:42 +01:00
committed by Robert Fancsik
parent 4a331b2edc
commit 332e216736
3 changed files with 45 additions and 7 deletions
+2 -1
View File
@@ -127,7 +127,7 @@ def run_normal_tests(args, tests):
test_cmd = get_platform_cmd_prefix()
if args.runtime:
test_cmd.append(args.runtime)
test_cmd.append(args.engine)
test_cmd.extend([args.engine, '--call-on-exit', '__checkAsync'])
total = len(tests)
tested = 0
@@ -161,6 +161,7 @@ def run_snapshot_tests(args, tests):
generate_snapshot_cmd.append(args.runtime)
execute_snapshot_cmd.extend([args.engine, '--exec-snapshot', 'js.snapshot'])
execute_snapshot_cmd.extend(['--call-on-exit', '__checkAsync'])
# engine: jerry[.exe] -> snapshot generator: jerry-snapshot[.exe]
engine = os.path.splitext(args.engine)