# HG changeset patch # User Paul Boddie # Date 1480431798 -3600 # Node ID 6a85c86bb1f1d78abb9cb7495a9182f680aed1da # Parent 5be8a7aa0f86686e47fe457fd600ac91e2b6d63e Changed lplc to always return 1 upon failure, eliminating unnecessary options. Changed the test runner to continue after expected test failures. diff -r 5be8a7aa0f86 -r 6a85c86bb1f1 lplc --- a/lplc Tue Nov 29 00:47:19 2016 +0100 +++ b/lplc Tue Nov 29 16:03:18 2016 +0100 @@ -56,10 +56,7 @@ if not success: show_missing(i.missing) - if "-exit" in args: - sys.exit(1) - else: - sys.exit(0) + sys.exit(1) d = deducer.Deducer(i, "_deduced") d.to_output() @@ -87,17 +84,9 @@ print exc if "-tb" in args: raise - elif "-exit" in args: - sys.exit(1) - - except KeyboardInterrupt: - if "-exit" in args: - sys.exit(2) - else: - raise + sys.exit(1) else: - if "-exit" in args: - sys.exit(0) + sys.exit(0) # vim: tabstop=4 expandtab shiftwidth=4 diff -r 5be8a7aa0f86 -r 6a85c86bb1f1 test_all.sh --- a/test_all.sh Tue Nov 29 00:47:19 2016 +0100 +++ b/test_all.sh Tue Nov 29 16:03:18 2016 +0100 @@ -12,8 +12,7 @@ check_type_warnings() { if [ -e "_deduced/type_warnings" ] && \ - [ `stat -c %s "_deduced/type_warnings"` -ne 0 ] && \ - ! expect_failure ; then + [ `stat -c %s "_deduced/type_warnings"` -ne 0 ] ; then echo "Type warnings in deduced information." 1>&2 return 1 @@ -39,14 +38,19 @@ # Run tests without an existing cache. echo "$FILENAME..." 1>&2 - if ! ./lplc "$FILENAME" -r ; then exit 1 ; fi + if ! ./lplc "$FILENAME" -r ; then + if ! expect_failure; then + exit 1 + else + echo 1>&2 + continue + fi + fi # Check for unresolved names in the cache. echo " (depends)..." 1>&2 - if grep '' -r "_cache" && \ - ! expect_failure ; then - + if grep '' -r "_cache" ; then echo "Unresolved names in the cache." 1>&2 exit 1 fi