From 0e6f47211a0516cf2c96d2b9e89c0d841978c143 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Sun, 4 Aug 2019 14:31:11 +1200 Subject: Add test recipe which skips valgrind --- Makefile | 5 ++++- test/emul/run-emul.sh | 2 +- test/full-pipeline/run-full-pipeline.sh | 6 +++--- test/valgrind.sh | 6 ++++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index e3cb8e5..86e8f6f 100644 --- a/Makefile +++ b/Makefile @@ -38,9 +38,12 @@ output/output_asm.o: output/output_asm.h parse.h util.h # Intput modules input/input_bin.o: input/input_bin.h parse.h -.PHONY: clean test +.PHONY: clean test test-quick clean: - rm -f $(EXECUTABLES) $(ASM_OBJECTS) $(DISASM_OBJECTS) $(ASMCAT_OBJECTS) $(BINCAT_OBJECTS) test: all make -C test test + +test-quick: all + make -C test test DISABLE_VALGRIND=1 diff --git a/test/emul/run-emul.sh b/test/emul/run-emul.sh index 2db56f3..0857689 100755 --- a/test/emul/run-emul.sh +++ b/test/emul/run-emul.sh @@ -37,7 +37,7 @@ for asmfile in *.asm ; do continue fi - if "$VALGRIND" $VALGRIND_OPTS "$EMUL" "$binfile" > "$outfile" ; then + if $VALGRIND $VALGRIND_OPTS "$EMUL" "$binfile" > "$outfile" ; then # Each postcondition line must hold true, and forms a separate test to # help track down failures (echo '; POST $0 = 0' ; diff --git a/test/full-pipeline/run-full-pipeline.sh b/test/full-pipeline/run-full-pipeline.sh index cfa149f..25f7bf7 100755 --- a/test/full-pipeline/run-full-pipeline.sh +++ b/test/full-pipeline/run-full-pipeline.sh @@ -40,17 +40,17 @@ for first_stage_asm in *.asm ; do second_stage_bin="$WORK/${first_stage_asm}-second_stage.bin" # Assemble test code - if ! "$VALGRIND" $VALGRIND_OPTS "$ASM" "$first_stage_asm" "$first_stage_bin" ; then + if ! $VALGRIND $VALGRIND_OPTS "$ASM" "$first_stage_asm" "$first_stage_bin" ; then fail "$first_stage_asm" "first stage assembly failed" continue fi # Disassemble test code and re-assemble that disassembly - if ! "$VALGRIND" $VALGRIND_OPTS "$DISASM" "$first_stage_bin" "$second_stage_asm" ; then + if ! $VALGRIND $VALGRIND_OPTS "$DISASM" "$first_stage_bin" "$second_stage_asm" ; then fail "$first_stage_asm" "first stage disassembly failed" continue fi - if ! "$VALGRIND" $VALGRIND_OPTS "$ASM" "$second_stage_asm" "$second_stage_bin" ; then + if ! $VALGRIND $VALGRIND_OPTS "$ASM" "$second_stage_asm" "$second_stage_bin" ; then fail "$first_stage_asm" "second stage assembly failed" continue fi diff --git a/test/valgrind.sh b/test/valgrind.sh index 9c230d4..0320830 100644 --- a/test/valgrind.sh +++ b/test/valgrind.sh @@ -1,2 +1,4 @@ -VALGRIND=valgrind -VALGRIND_OPTS="-q --error-exitcode=1 --leak-check=full --show-reachable=yes" +if [ -z "$DISABLE_VALGRIND" ]; then + VALGRIND=valgrind + VALGRIND_OPTS="-q --error-exitcode=1 --leak-check=full --show-reachable=yes" +fi -- cgit v1.1