summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMura Li <mura_li@castech.com.tw>2018-01-31 10:21:28 +0800
committerOri Bernstein <ori@eigenstate.org>2018-01-30 20:49:47 -0800
commit04d69fa430ac53cbed054fda7f86e8a7feb21d77 (patch)
treeeac6d50a4935a06bef2c344d4f5bb2aaff63cb1c /test
parent80f3197039716af937a80f3f3516c3c8af1a4b58 (diff)
downloadmc-04d69fa430ac53cbed054fda7f86e8a7feb21d77.tar.gz
Support running single test
Diffstat (limited to 'test')
-rwxr-xr-xtest/runtest.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/runtest.sh b/test/runtest.sh
index 7133f43..c8990a6 100755
--- a/test/runtest.sh
+++ b/test/runtest.sh
@@ -66,10 +66,28 @@ expectfcompare() {
fi
}
+belongto() {
+ elem="$1"; shift
+ subset="$1"; shift
+
+ IFS=','
+ for v in $subset; do
+ if [ "$elem" = "$v" ]; then
+ return 0
+ fi
+ done
+ return 1
+}
+
# Should build and run
B() {
test="$1"; shift
type="$1"; shift
+
+ if ! belongto "$test" "$MTEST_SUBSET"; then
+ return 1
+ fi
+
if [ $# -gt 0 ]; then
res="$1"; shift
fi
@@ -88,6 +106,10 @@ B() {
# Should fail
F() {
+ if ! belongto "$test" "$MTEST_SUBSET"; then
+ return 1
+ fi
+
echo "test $1 <<{!"
(build $1) > /dev/null 2>1
if [ $? -eq '1' ]; then