mirror of
https://github.com/open-simh/simtools.git
synced 2026-01-25 19:56:30 +00:00
Fix crashes when arguments aren't provided to options that expect them. Detect when an option might have been forgotten. Add some tests for required option arguments.
This commit is contained in:
22
Makefile
22
Makefile
@@ -40,8 +40,24 @@ rad50.o: rad50.c rad50.h
|
||||
dumpobj.o: dumpobj.c rad50.h util.h
|
||||
rad50.o: rad50.c rad50.h
|
||||
|
||||
# Since the only test we have so far is for a crash bug,
|
||||
# Since the only tests we have so far are for crashes,
|
||||
# just try to assemble. Later, we will need expected/actual tests.
|
||||
tests: macro11
|
||||
./macro11 tests/*
|
||||
|
||||
# Test that all options requiring a value bail out if it's not present.
|
||||
argtests: macro11
|
||||
@ for OPT in -e -d -m -p -o -l -ysl ; do \
|
||||
./macro11 foo.mac $$OPT 2> /dev/null; \
|
||||
if (( $$? == 1 )); then echo PASS; else echo FAIL; fi; \
|
||||
echo " $$OPT missing value"; \
|
||||
./macro11 foo.mac $$OPT -v 2> /dev/null; \
|
||||
if (( $$? == 1 )); then echo PASS; else echo FAIL; fi; \
|
||||
echo " $$OPT fol. by option"; \
|
||||
done
|
||||
@ ./macro11 foo.mac $$OPT -x -v 2> /dev/null; \
|
||||
if (( $$? == 1 )); then echo PASS; else echo FAIL; fi; \
|
||||
echo " -x must be the last option"
|
||||
|
||||
tests: macro11 argtests
|
||||
@ ACTUAL=`./macro11 tests/test-undef.mac 2>&1`; \
|
||||
if [ "tests/test-undef.mac:1: ***ERROR MACRO .TTYOU not found" == "$$ACTUAL" ]; then echo PASS; else echo FAIL; fi; \
|
||||
echo " test-undef.mac"
|
||||
|
||||
Reference in New Issue
Block a user