diff --git a/tests/cpp.sh b/tests/cpp.sh index bd505ff..b77cec6 100755 --- a/tests/cpp.sh +++ b/tests/cpp.sh @@ -61,10 +61,19 @@ if [ $# -eq 0 ]; then exit $? fi -while [ $# -gt 0 ]; do +if [ $# -eq 1 -a -n "$output" ]; then target="$1" - output="${target%.cpp}.o" - shift LD_LIBRARY_PATH="../src" $CPP "$target" > "$output" -done +elif [ $# -gt 1 -a -z "$output" ]; then + while [ $# -gt 0 ]; do + target="$1" + output="${target%.cpp}.o" + shift + + LD_LIBRARY_PATH="../src" $CPP "$target" > "$output" + done +else + _usage + exit $? +fi