-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-dtdetector.sh
63 lines (47 loc) · 1.94 KB
/
run-dtdetector.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
#!/usr/bin/env bash
# $1 - Optional. Location of the setup script to run.
# $2 - Optional (new or old). Whether to run new or old subject. Defaults to 'old'.
# $3 - Optional (orig or auto). Whether to run for the auto tests or the orig tests. Defaults to 'orig'.
set -e
if [[ ! -z "$1" ]]; then
# Generally the setup scripts are written so that they assume you are in a particular directory, so
# make sure we match that.
CURRENT=$(pwd)
SCRIPT_DIR=$(dirname "$1")
SCRIPT_NAME=$(basename "$1")
echo "[INFO] Running setup script $SCRIPT_NAME in $SCRIPT_DIR"
cd $SCRIPT_DIR
. "$SCRIPT_NAME"
cd $CURRENT
fi
echo "[INFO] Running subject ${SUBJ_NAME}"
RESULTS_DIR="$DT_SCRIPTS/${SUBJ_NAME}-results"
echo "[INFO] Checking for results directory at $RESULTS_DIR"
# Make the results directory if it doesn't exist (and copy the setup script if applicable)
if [[ ! -d "$RESULTS_DIR" ]]; then
echo "[INFO] Creating results directory"
mkdir "$RESULTS_DIR"
if [[ ! -z "$1" ]]; then
echo "[INFO] Copying setup script"
cp "$1" "$RESULTS_DIR"
fi
fi
echo "[INFO] Running main program."
ORDER="orig"
if [[ ! -z "$3" ]]; then
ORDER="$3"
fi
PREFIX="old"
if [[ ! -z "$2" ]]; then
if [[ "$2" = "new" ]]; then
PREFIX="new"
fi
fi
RANDOMIZE_RESULTS="$RESULTS_DIR/${SUBJ_NAME}-${PREFIX}-${ORDER}-randomize"
if [[ "$PREFIX" = "old" ]]; then
cd $DT_SUBJ_SRC
java -Xmx8000M -cp $DT_TOOLS: edu.washington.cs.dt.impact.tools.detectors.DetectorMain -cp "$DT_TESTS:$DT_CLASS:$DT_LIBS:$DT_RANDOOP" --mode RANDOM --rounds 100 --test-order "$DT_SUBJ/${SUBJ_NAME}-${ORDER}-order" --output "$RANDOMIZE_RESULTS"
else
cd $NEW_DT_SUBJ_SRC
java -Xmx8000M -cp $DT_TOOLS: edu.washington.cs.dt.impact.tools.detectors.DetectorMain -cp "$NEW_DT_TESTS:$NEW_DT_CLASS:$NEW_DT_LIBS:$NEW_DT_RANDOOP" --mode RANDOM --rounds 100 --test-order "$NEW_DT_SUBJ/${SUBJ_NAME}-${ORDER}-order" --output "$RANDOMIZE_RESULTS"
fi