diff --git a/c b/c index 3980e21..3621cb9 100755 --- a/c +++ b/c @@ -34,7 +34,7 @@ cleanup() { # Handle --help, -h, and zero args [[ "$1" == "--help" || "$1" == "-h" ]] && { help_msg 1; exit 0; } -[[ "$#" -lt 1 ]] && { help_msg 2; exit 1; } +[[ "$#" -lt 1 ]] && { help_msg 2; exit 2; } # ensure our $CC and $CXX variables are set [[ -z "$CC" ]] && CC=cc @@ -155,9 +155,14 @@ binname="$tmproot/$id.bin" run() { trap cleanup SIGINT - shift - (exec -a "$fname" "$binname" "$@") - ret=$? + if [ -x "$binname" ]; then + shift + (exec -a "$fname" "$binname" "$@") + ret=$? + else + echo + ret=4 + fi trap - SIGINT cleanup diff --git a/tests/test.sh b/tests/test.sh index 4053f42..3711835 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -9,7 +9,7 @@ source "./test_helpers.sh" [ -n "$CC" ] && "$CC" --version [ -n "$CXX" ] && "$CXX" --version [ -n "$FC" ] && "$FC" --version -c --version +$c --version # Run tests source ./argument_and_link_test/test.sh