aboutsummaryrefslogtreecommitdiff
path: root/test_all.sh
diff options
context:
space:
mode:
authorTeddy <ted.sybil@gmail.com>2014-04-11 18:09:47 +0800
committerTeddy <ted.sybil@gmail.com>2014-04-11 18:09:47 +0800
commite3907f9af283c71b635a51265a155ee00e7ef81e (patch)
tree1008c4b1f4e9e22b0c1e89c2928d7c420b914443 /test_all.sh
parent596660487a61bd219253d0b3da382c5b02dc20ed (diff)
handle empty parameter correctly
Diffstat (limited to 'test_all.sh')
-rwxr-xr-xtest_all.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/test_all.sh b/test_all.sh
index cb2aa87..fcf757c 100755
--- a/test_all.sh
+++ b/test_all.sh
@@ -1,5 +1,9 @@
#! /bin/bash
-for file in testcases/*.c
+dir=testcases/*.c
+if [ "$#" != 0 ]; then
+ dir=$1
+fi
+for file in $dir
do
gcc $file -o /dev/null &> /dev/null
gcc_ret="$?"