forked from Santiago-Yu/SPAT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·64 lines (59 loc) · 1.54 KB
/
run.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
#!/bin/bash
# run.sh [-l LIBPATH] BENCHMARK_NAME TEST_ID [TEST_ID...]
# Runs SPAT
while getopts "l:" opt; do
case $opt in
l)
lib_path="${OPTARG}"
shift 2
;;
\?)
echo "Invalid option: -$OPTARG" >&2
;;
esac
done
# See README#java18
lib_path=${lib_path:-"/usr/lib/jvm/java-18-openjdk-amd64/lib"}
# Assume default directory structure
# Benchmarks
# └── "$benchmark_name"
# ├── Original
# └── transformed
benchmark_name=${1:-"extracted_large_train"}
benchmark_path="./Benchmarks/$benchmark_name"
shift 1
# 0, 1, 2, 6, 7, 3
# 0. LocalVarRenaming:
# 1. For2While
# 2. While2For
# 3. ReverseIfElse
# 4. SingleIF2ConditionalExp
# 5. ConditionalExp2SingleIF
# 6. PP2AddAssignment
# 7. AddAssignemnt2EqualAssignment
# 8. InfixExpressionDividing
# 9. IfDividing
# 10. StatementsOrderRearrangement
# 11. LoopIfContinue2Else
# 12. VarDeclarationMerging
# 13. VarDeclarationDividing
# 14. SwitchEqualSides
# 15. SwitchStringEqual
# 16. PrePostFixExpressionDividing
# 17. Case2IfElse
for test_id in "$@"; do
echo "Running test ID: $test_id"
java -jar ./artifacts/SPAT-linux.jar \
"$test_id" \
"$benchmark_path/Original" \
"$benchmark_path/transformed/_$test_id" \
"$lib_path" \
>/dev/null
echo "Number of files successfully augmented:"
ls "$benchmark_path/transformed/_$test_id" | wc -l
done
#java -jar ./artifacts/SPAT-linux.jar \
# "$test_id" \
# "./Benchmarks/$benchmark_name/Original" \
# "./Benchmarks/$benchmark_name/transformed/_$test_id" \
# "$lib_path"