-
Notifications
You must be signed in to change notification settings - Fork 17
/
test.sh
executable file
·52 lines (49 loc) · 1.48 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
EXEC=$1; shift;
ISPD_DIR=$1; shift;
TEST_SUITE=$1; shift;
if [ "all" == ${TEST_SUITE} ]
then
for i in ${ISPD_DIR}/tests/*/; do
for j in ${i}*/; do
for k in ${j}*.in; do
if [ ! -e ${k} ]
then
continue
fi
echo ${k}
${EXEC} "${k}" $@ < "${k%.*}.out"
echo ""
done
done
done
else
TEST_CASE=$1; shift;
if [[ "all" == ${TEST_CASE} || "" == ${TEST_CASE} ]]
then
for i in ${ISPD_DIR}/tests/*/; do
for j in ${i}${TEST_SUITE}/*.in; do
if [ ! -e ${j} ]
then
continue
fi
echo ${j}
${EXEC} "${j}" $@ < "${j%.*}.out"
echo ""
done
done
else
if [ -e ${ISPD_DIR}/tests/2d/${TEST_SUITE}/${TEST_CASE}.in ]
then
echo ${ISPD_DIR}/tests/2d/${TEST_SUITE}/${TEST_CASE}.in
${EXEC} "${ISPD_DIR}/tests/2d/${TEST_SUITE}/${TEST_CASE}.in" $@ < "${ISPD_DIR}/tests/2d/${TEST_SUITE}/${TEST_CASE}.out"
echo ""
fi
if [ -e ${ISPD_DIR}/tests/3d/${TEST_SUITE}/${TEST_CASE}.in ]
then
echo ${ISPD_DIR}/tests/3d/${TEST_SUITE}/${TEST_CASE}.in
${EXEC} "${ISPD_DIR}/tests/3d/${TEST_SUITE}/${TEST_CASE}.in" $@ < "${ISPD_DIR}/tests/3d/${TEST_SUITE}/${TEST_CASE}.out"
echo ""
fi
fi
fi