-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sjasm.cpp: adding test for --msg=all/default option (++code coverage)
- Loading branch information
Showing
2 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
tests/test build script and options/nonCodeOptions/optionMsgDefaultAndAll.asm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
11 changes: 11 additions & 0 deletions
11
tests/test build script and options/nonCodeOptions/optionMsgDefaultAndAll.cli
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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=$? |