diff options
author | David Phillips <david@sighup.nz> | 2019-08-04 14:21:05 +1200 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2019-08-04 14:24:50 +1200 |
commit | 4b1f9e2cb436e74ce6084dbc35df5f052cb701bf (patch) | |
tree | 201bf4d3cf1120ad0e9a8d3fe7b1a95c2fd3333d /test/full-pipeline | |
parent | 1c8e50028e15facaa4d31992bfc6cab9d10832e6 (diff) | |
download | toy-cpu-assembler-4b1f9e2cb436e74ce6084dbc35df5f052cb701bf.tar.xz |
Wrap tests in valgrind, clean up memory leaks
Diffstat (limited to 'test/full-pipeline')
-rwxr-xr-x | test/full-pipeline/run-full-pipeline.sh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/full-pipeline/run-full-pipeline.sh b/test/full-pipeline/run-full-pipeline.sh index aeb7c4f..cfa149f 100755 --- a/test/full-pipeline/run-full-pipeline.sh +++ b/test/full-pipeline/run-full-pipeline.sh @@ -29,6 +29,7 @@ else fi WORK=$(mktemp -d) pushd $(dirname "$0") >/dev/null +source ../valgrind.sh export ASM="$PWD/../../assembler" export DISASM="$PWD/../../disassembler" has_failure=0 @@ -39,17 +40,17 @@ for first_stage_asm in *.asm ; do second_stage_bin="$WORK/${first_stage_asm}-second_stage.bin" # Assemble test code - if ! "$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 ! "$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 ! "$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 |