-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-subj-precomputed.sh
66 lines (49 loc) · 1.75 KB
/
run-subj-precomputed.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
#!/usr/bin/env bash
# Usage: bash run-subj-precomputed.sh SETUP_SCRIPT
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"
echo "[INFO] Getting new test lists"
(
cd $DT_SUBJ
if [[ ! -e "$DT_SUBJ_SRC/pom.xml" ]]; then
bash "$DT_SCRIPTS/find-test-list.sh" old orig
else
bash "$DT_SCRIPTS/get-test-order.sh"
fi
bash "$DT_SCRIPTS/find-test-list.sh" old auto
)
echo "[INFO] Removing old dt lists"
rm -rf "$DT_ROOT/data/prioritization-dt-list/prioritization-$SUBJ_NAME"*
rm -rf "$DT_ROOT/data/selection-dt-list/selection-$SUBJ_NAME"*
rm -rf "$DT_ROOT/data/parallelization-dt-list/parallelization-$SUBJ_NAME"*
if [[ -d "$RESULTS_DIR/precomputed" ]]; then
echo "[INFO] Removing old results files at $RESULTS_DIR/precomputed"
rm -rf "$RESULTS_DIR/precomputed"
rm -rf "$RESULTS_DIR/dt-lists"
fi
# Calculate new precomputed dependencies
echo "[INFO] Computing precomputed dependencies"
bash run-precomputed-dependencies.sh