From 137ace24db94d85b6923f9a531e96356ed65ba43 Mon Sep 17 00:00:00 2001 From: Ruben Ayrapetyan Date: Wed, 6 Aug 2014 13:06:55 +0400 Subject: [PATCH 1/2] Handling return value of run_int by setting exit code. --- src/main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main.c b/src/main.c index 266323294..5af6f3d43 100644 --- a/src/main.c +++ b/src/main.c @@ -68,7 +68,7 @@ parser_run (const char *script_source, size_t script_source_size, bool is_show_o return opcodes; } -static void +static int jerry_run (const char *script_source, size_t script_source_size, bool is_parse_only, bool is_show_opcodes) { @@ -82,12 +82,12 @@ jerry_run (const char *script_source, size_t script_source_size, bool is_parse_o if (is_parse_only) { - return; + return 0; } init_int (opcodes); - run_int (); + return run_int () ? 0 : 1; } /* jerry_run */ #ifdef __TARGET_HOST_x64 @@ -199,13 +199,14 @@ main (int argc __unused, size_t source_size; const char *source_p = read_sources (file_names, files_counter, &source_size); - jerry_run (source_p, source_size, parse_only, show_opcodes); + int ret = jerry_run (source_p, source_size, parse_only, show_opcodes); if (print_mem_stats) { mem_heap_print( false, false, true); } - return 0; + + return ret; } #endif From 6c01782e91d8c57a94524f8c6069c26821b5231e Mon Sep 17 00:00:00 2001 From: Ruben Ayrapetyan Date: Wed, 6 Aug 2014 13:49:51 +0400 Subject: [PATCH 2/2] Hiding *.check targets. Enablings pre-commit parse-only tests from ./benchmarks/jerry except cse.js and chess.js. Making tests named beginning from N to be skipped in jerry_test.sh. Renaming cse.js and chess.js to N.cse.js, N.chess.js. --- Makefile | 43 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 318f6b312..397ccddf0 100644 --- a/Makefile +++ b/Makefile @@ -79,11 +79,14 @@ all: precommit PRECOMMIT_CHECK_TARGETS_LIST= debug.linux-sanitize.check \ debug.linux-valgrind.check \ + debug.linux-musl-valgrind.check \ debug_release.linux-sanitize.check \ debug_release.linux-valgrind.check \ + debug_release.linux-musl.check \ release.linux-sanitize.check \ release.linux-musl-valgrind.check \ - release.linux-libc_raw-valgrind.check + release.linux-valgrind.check \ + release.linux.check push: ./tools/push.sh @ ./tools/push.sh @@ -95,13 +98,43 @@ precommit: clean @ echo -e "All targets were built successfully. Starting unit tests' build and run.\n" @ $(MAKE) unittests TESTS_OPTS="--silent" @ echo -e "Unit tests completed successfully. Starting parse-only testing.\n" - @ $(MAKE) $(PRECOMMIT_CHECK_TARGETS_LIST) TESTS_DIR=./tests/jerry TESTS_OPTS="--parse-only" OUTPUT_TO_LOG=enable - @ echo -e "\e[0;31mFIXME:\e[0m './benchmarks/jerry parse-only' testing skipped.\n"; # $(MAKE) -s $(PRECOMMIT_CHECK_TARGETS_LIST) TESTS_DIR=./benchmarks/jerry TESTS_OPTS="--parse-only" OUTPUT_TO_LOG=enable + @ # Parse-only testing + @ for path in "./tests/jerry" "./benchmarks/jerry"; \ + do \ + run_ids=""; \ + for check_target in $(PRECOMMIT_CHECK_TARGETS_LIST); \ + do \ + $(MAKE) -s -f Makefile.mk TARGET=$$check_target $$check_target TESTS_DIR="$$path" TESTS_OPTS="--parse-only" OUTPUT_TO_LOG=enable & \ + run_ids="$$run_ids $$!"; \ + done; \ + result_ok=1; \ + for run_id in $$run_ids; \ + do \ + wait $$run_id || result_ok=0; \ + done; \ + [ $$result_ok -eq 1 ] || exit 1; \ + done @ echo -e "Parse-only testing completed successfully. Starting full tests run.\n" - @ echo -e "\e[0;31mFIXME:\e[0m Full testing skipped.\n"; # $(MAKE) -s $(PRECOMMIT_CHECK_TARGETS_LIST) TESTS_DIR=./tests/jerry OUTPUT_TO_LOG=enable + @ echo -e "\e[0;31mFIXME:\e[0m Full testing skipped.\n"; + @ # Full testing + @ # for path in "./tests/jerry" "./benchmarks/jerry"; \ + # do \ + # run_ids=""; \ + # for check_target in $(PRECOMMIT_CHECK_TARGETS_LIST); \ + # do \ + # $(MAKE) -s -f Makefile.mk TARGET=$$check_target $$check_target TESTS_DIR="$$path" TESTS_OPTS="" OUTPUT_TO_LOG=enable & \ + # run_ids="$$run_ids $$!"; \ + # done; \ + # result_ok=1; \ + # for run_id in $$run_ids; \ + # do \ + # wait $$run_id || result_ok=0; \ + # done; \ + # [ $$result_ok -eq 1 ] || exit 1; \ + # done @ echo -e "Full testing completed successfully\n\n================\n\n" -$(JERRY_TARGETS) $(TESTS_TARGET) $(FLASH_TARGETS) $(CHECK_TARGETS): +$(JERRY_TARGETS) $(TESTS_TARGET) $(FLASH_TARGETS): @$(MAKE) -s -f Makefile.mk TARGET=$@ $@ clean: