-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubj-prio.sh
executable file
·141 lines (125 loc) · 4.77 KB
/
subj-prio.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
139
140
# Usage: subj-prio.sh $DT_SUBJ $DT_ROOT $SUBJ_NAME $SUBJ_NAME_FORMAL $NEW_DT_SUBJ true false true ...
# Usage: subj-prio.sh $DT_SUBJ $DT_ROOT $SUBJ_NAME $SUBJ_NAME_FORMAL $NEW_DT_SUBJ false 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=$9
else
DT_TOOLS=$9
DT_LIBS=${10}
DT_CLASS=${11}
DT_RANDOOP=${12}
DT_TESTS=${13}
CLASSPATH=$DT_LIBS:$DT_CLASS:$DT_RANDOOP:$DT_TESTS:$DT_TOOLS
fi
PRECOMPUTE_DEPENDENCES=$7
GEN_ENHANCED_RESULTS=$8
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 $k test type"
echo "$(pwd)"
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 \
-filesToDelete $NEW_DT_SUBJ/$SUBJ_NAME-env-files \
-project "$SUBJ_NAME_FORMAL" \
-testType $k \
-outputDir $DT_ROOT/$prioDir \
-timesToRun $medianTimes \
-classpath "$CLASSPATH" \
-getCoverage \
$post
fi
for i in "${coverages[@]}"; do
for j in "${priorOrders[@]}"; do
PRECOMPUTE_FLAG=""
if [ "$PRECOMPUTE_DEPENDENCES" = "true" ]; then
PRECOMPUTE_FLAG="-resolveDependences $PRIO_DT_LISTS/prioritization-$SUBJ_NAME_FORMAL-$k-$i-$j-$p.txt"
fi
# Running prioritization with resolveDependences and without dependentTestFile
echo "[DEBUG] java -cp $DT_TOOLS: edu.washington.cs.dt.impact.runner.OneConfigurationRunner \
-technique prioritization \
-coverage $i \
-order $j \
-origOrder $NEW_DT_SUBJ/$SUBJ_NAME-$k-order \
-testInputDir $DT_SUBJ/sootTestOutput-$k \
-filesToDelete $NEW_DT_SUBJ/$SUBJ_NAME-env-files \
-getCoverage \
-project "$SUBJ_NAME_FORMAL" \
-testType $k \
-outputDir $DT_ROOT/$prioDir \
-timesToRun $medianTimes \
-classpath \"$CLASSPATH\" \
$PRECOMPUTE_FLAG \
$post"
java -cp $DT_TOOLS: edu.washington.cs.dt.impact.runner.OneConfigurationRunner \
-technique prioritization \
-coverage $i \
-order $j \
-origOrder $NEW_DT_SUBJ/$SUBJ_NAME-$k-order \
-testInputDir $DT_SUBJ/sootTestOutput-$k \
-filesToDelete $NEW_DT_SUBJ/$SUBJ_NAME-env-files \
-getCoverage \
-project "$SUBJ_NAME_FORMAL" \
-testType $k \
-outputDir $DT_ROOT/$prioDir \
-timesToRun $medianTimes \
-classpath "$CLASSPATH" \
$PRECOMPUTE_FLAG \
$post
if [ "$GEN_ENHANCED_RESULTS" = "true" ]; then
echo "[DEBUG] java -cp $DT_TOOLS: edu.washington.cs.dt.impact.runner.OneConfigurationRunner \
-technique prioritization \
-coverage $i \
-order $j \
-origOrder $NEW_DT_SUBJ/$SUBJ_NAME-$k-order \
-testInputDir $DT_SUBJ/sootTestOutput-$k \
-filesToDelete $NEW_DT_SUBJ/$SUBJ_NAME-env-files \
-getCoverage \
-project "$SUBJ_NAME_FORMAL" \
-testType $k \
-outputDir $DT_ROOT/$prioDir \
-timesToRun $medianTimes \
-classpath \"$CLASSPATH\" \
-dependentTestFile $PRIO_DT_LISTS/\"prioritization-$SUBJ_NAME_FORMAL-$k-$i-$j-$p.txt\" \
$post"
java -cp $DT_TOOLS: edu.washington.cs.dt.impact.runner.OneConfigurationRunner \
-technique prioritization \
-coverage $i \
-order $j \
-origOrder $NEW_DT_SUBJ/$SUBJ_NAME-$k-order \
-testInputDir $DT_SUBJ/sootTestOutput-$k \
-filesToDelete $NEW_DT_SUBJ/$SUBJ_NAME-env-files \
-getCoverage \
-project "$SUBJ_NAME_FORMAL" \
-testType $k \
-outputDir $DT_ROOT/$prioDir \
-timesToRun $medianTimes \
-classpath "$CLASSPATH" \
-dependentTestFile $PRIO_DT_LISTS/"prioritization-$SUBJ_NAME_FORMAL-$k-$i-$j-$p.txt" \
$post
fi
done
done
clearTemp
done
done