Skip to content

Commit

Permalink
sjasm.cpp: adding test for --msg=all/default option (++code coverage)
Browse files Browse the repository at this point in the history
  • Loading branch information
ped7g committed Jul 28, 2019
1 parent 35b5133 commit b39627e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
; almost empty ASM file just to trigger the option test
; The test itself is written in the CLI file as bash script
nop
ld a,'warn'
some_error line
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# run sjasmplus without any `--msg=`, and run it with `--msg=all` and compare output (without "time")
# the source file contains one error, but grep will return value OK
$MEMCHECK "$EXE" --nologo --fullpath "$file_asm" 2>&1 |\
sed -e 's/work\ time:.*seconds/<some work time>/' > default.txt && \
$MEMCHECK "$EXE" --nologo --fullpath --msg=all "$file_asm" 2>&1 |\
sed -e 's/work\ time:.*seconds/<some work time>/' > all.txt && \
diff default.txt all.txt && \
out_lines=`wc -l < default.txt` &&\
echo "Output lines count: ${out_lines} (must be at least 6 to pass the test)" &&\
[[ 6 -le ${out_lines} ]] ;
last_result=$?

0 comments on commit b39627e

Please sign in to comment.