summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2019-08-04 14:31:11 +1200
committerDavid Phillips <david@sighup.nz>2019-08-04 14:31:11 +1200
commit0e6f47211a0516cf2c96d2b9e89c0d841978c143 (patch)
tree10616e955a7be0f8ea92bdb35d72ec49566b5aaf
parent4b1f9e2cb436e74ce6084dbc35df5f052cb701bf (diff)
downloadtoy-cpu-assembler-0e6f47211a0516cf2c96d2b9e89c0d841978c143.tar.xz
Add test recipe which skips valgrind
-rw-r--r--Makefile5
-rwxr-xr-xtest/emul/run-emul.sh2
-rwxr-xr-xtest/full-pipeline/run-full-pipeline.sh6
-rw-r--r--test/valgrind.sh6
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