-
Notifications
You must be signed in to change notification settings - Fork 0
/
subj-sele.sh
executable file
·138 lines (125 loc) · 4.97 KB
/
subj-sele.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Usage: subj-sele.sh $DT_SUBJ $DT_ROOT $SUBJ_NAME $SUBJ_NAME_FORMAL $NEW_DT_SUBJ true true ...
# Usage: subj-sele.sh $DT_SUBJ $DT_ROOT $SUBJ_NAME $SUBJ_NAME_FORMAL $NEW_DT_SUBJ false true $DT_TOOLS $DT_LIBS $DT_CLASS $DT_RANDOOP $DT_TESTS
source ./constants.sh
DT_SUBJ=$1
DT_ROOT=$2
SUBJ_NAME=$3
SUBJ_NAME_FORMAL=$4
NEW_DT_SUBJ=$5
PRESET_CP=$6
if [ "$PRESET_CP" = "true" ]; then
CLASSPATH=$8
else
DT_TOOLS=$8
DT_LIBS=$9
DT_CLASS=${10}
DT_RANDOOP=${11}
DT_TESTS=${12}
CLASSPATH=$DT_LIBS:$DT_CLASS:$DT_RANDOOP:$DT_TESTS:$DT_TOOLS
fi
GEN_ENHANCED_RESULTS=$7
if ! bash check-compiled.sh $CLASSPATH; then
exit 1
fi
# Set the pwd dependening on classpath/version
. set-directory.sh $DT_SUBJ $NEW_DT_SUBJ $CLASSPATH
for post in "${postProcessFlags[@]}"; do
if [ "$post" = "" ]; then
p=false
else
p=true
fi
for k in "${testTypes[@]}"; do
if [ "$GEN_ENHANCED_RESULTS" = "true" ]; then
echo "[INFO] Running prioritization for ${testTypes[@]} test type"
java -cp $DT_TOOLS: edu.washington.cs.dt.impact.runner.OneConfigurationRunner \
-technique prioritization \
-coverage statement \
-order original \
-origOrder $NEW_DT_SUBJ/$SUBJ_NAME-$k-order \
-testInputDir $DT_SUBJ/sootTestOutput-$k-selection \
-filesToDelete $NEW_DT_SUBJ/$SUBJ_NAME-env-files \
-project "$SUBJ_NAME_FORMAL" \
-testType $k \
-outputDir $DT_ROOT/$seleDir \
-timesToRun $medianTimes \
-classpath "$CLASSPATH" \
-getCoverage \
$post
fi
for i in "${coverages[@]}"; do
for j in "${seleOrders[@]}"; do
if [ "$GEN_ENHANCED_RESULTS" = "true" ]; then
# [INFO] Running selection without resolveDependences and with dependentTestFile
echo "[DEBUG] java -cp $DT_TOOLS: edu.washington.cs.dt.impact.runner.OneConfigurationRunner \
-technique selection \
-coverage $i \
-order $j \
-origOrder $NEW_DT_SUBJ/$SUBJ_NAME-$k-order \
-testInputDir $DT_SUBJ/sootTestOutput-$k-selection \
-filesToDelete $NEW_DT_SUBJ/$SUBJ_NAME-env-files \
-project "$SUBJ_NAME_FORMAL" \
-testType $k \
-oldVersCFG $DT_SUBJ/selectionOutput \
-newVersCFG $NEW_DT_SUBJ/selectionOutput \
-getCoverage \
-outputDir $DT_ROOT/$seleDir \
-timesToRun $medianTimes \
-classpath "$CLASSPATH" \
-dependentTestFile $SELE_DT_LISTS/"selection-$SUBJ_NAME_FORMAL-$k-$i-$j-$p.txt" \
$post"
java -cp $DT_TOOLS: edu.washington.cs.dt.impact.runner.OneConfigurationRunner \
-technique selection \
-coverage $i \
-order $j \
-origOrder $NEW_DT_SUBJ/$SUBJ_NAME-$k-order \
-testInputDir $DT_SUBJ/sootTestOutput-$k-selection \
-filesToDelete $NEW_DT_SUBJ/$SUBJ_NAME-env-files \
-project "$SUBJ_NAME_FORMAL" \
-testType $k \
-oldVersCFG $DT_SUBJ/selectionOutput \
-newVersCFG $NEW_DT_SUBJ/selectionOutput \
-getCoverage \
-outputDir $DT_ROOT/$seleDir \
-timesToRun $medianTimes \
-classpath "$CLASSPATH" \
-dependentTestFile $SELE_DT_LISTS/"selection-$SUBJ_NAME_FORMAL-$k-$i-$j-$p.txt" \
$post
fi
# [INFO] Running selection without resolveDependences and without dependentTestFile
echo "[DEBUG] java -cp $DT_TOOLS: edu.washington.cs.dt.impact.runner.OneConfigurationRunner \
-technique selection \
-coverage $i \
-order $j \
-origOrder $NEW_DT_SUBJ/$SUBJ_NAME-$k-order \
-testInputDir $DT_SUBJ/sootTestOutput-$k-selection \
-filesToDelete $NEW_DT_SUBJ/$SUBJ_NAME-env-files \
-project "$SUBJ_NAME_FORMAL" \
-testType $k \
-oldVersCFG $DT_SUBJ/selectionOutput \
-newVersCFG $NEW_DT_SUBJ/selectionOutput \
-getCoverage \
-outputDir $DT_ROOT/$seleDir \
-classpath "$CLASSPATH" \
-timesToRun $medianTimes \
$post"
java -cp $DT_TOOLS: edu.washington.cs.dt.impact.runner.OneConfigurationRunner \
-technique selection \
-coverage $i \
-order $j \
-origOrder $NEW_DT_SUBJ/$SUBJ_NAME-$k-order \
-testInputDir $DT_SUBJ/sootTestOutput-$k-selection \
-filesToDelete $NEW_DT_SUBJ/$SUBJ_NAME-env-files \
-project "$SUBJ_NAME_FORMAL" \
-testType $k \
-oldVersCFG $DT_SUBJ/selectionOutput \
-newVersCFG $NEW_DT_SUBJ/selectionOutput \
-getCoverage \
-outputDir $DT_ROOT/$seleDir \
-classpath "$CLASSPATH" \
-timesToRun $medianTimes \
$post
done
done
done
done