-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfind-test-list.sh
61 lines (49 loc) · 1.55 KB
/
find-test-list.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
53
54
55
56
57
58
59
60
#!/usr/bin/env bash
# Usage: bash find-test-list.sh <old|new> <orig|auto>
# $1 - old or new (default old). Which version to use.
# $2 - orig or auto (default orig). Which tests to look at.
version=$1
testType=$2
TEST_ORDER="$(pwd)/${SUBJ_NAME}-${testType}-order"
IGNORE_TESTS_LIST="$DT_SCRIPTS/${SUBJ_NAME}-results/${SUBJ_NAME}-ignore-order"
TESTS=$DT_TESTS
CLASS=$DT_CLASS
LIBS=$DT_LIBS
if [[ "$testType" == "auto" ]]; then
if [[ "$version" == "new" ]]; then
TESTS=$NEW_DT_RANDOOP
else
TESTS=$DT_RANDOOP
fi
else
if [[ "$version" == "new" ]]; then
TESTS=$NEW_DT_TESTS
fi
fi
if [[ "$version" == "new" ]]; then
LIBS=$NEW_DT_LIBS
CLASS=$NEW_DT_CLASS
fi
java -cp $DT_TOOLS:$LIBS:$CLASS:$TESTS: edu.washington.cs.dt.tools.UnitTestFinder --pathOrJarFile $TESTS --junit3and4=true
if [[ ! -e "$DT_SUBJ_SRC/pom.xml" ]]; then
if [[ "$testType" == "auto" ]]; then
grep -i "randoop" allunittests.txt > $TEST_ORDER
else
grep -vi "randoop" allunittests.txt > $TEST_ORDER
fi
else
mv allunittests.txt "$TEST_ORDER"
fi
if [[ -e "$IGNORE_TESTS_LIST" ]]; then
temp=$(mktemp)
grep -Fvf "$IGNORE_TESTS_LIST" $TEST_ORDER > $temp
mv $temp $TEST_ORDER
fi
cd $DT_SUBJ_SRC
java -cp $DT_TOOLS: edu.washington.cs.dt.impact.tools.detectors.FailingTestDetector --classpath "$CLASS:$TESTS:$LIBS:$DT_TOOLS" --tests "$TEST_ORDER" --output "$IGNORE_TESTS_LIST"
cd $DT_SUBJ
if [[ -e "$IGNORE_TESTS_LIST" ]]; then
temp=$(mktemp)
grep -Fvf "$IGNORE_TESTS_LIST" $TEST_ORDER > $temp
mv $temp $TEST_ORDER
fi