forked from JetBrains-Research/TestSpark
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunTestSparkHeadless.sh
More file actions
31 lines (27 loc) · 1.4 KB
/
runTestSparkHeadless.sh
File metadata and controls
31 lines (27 loc) · 1.4 KB
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
#!/usr/bin/env bash
# https://stackoverflow.com/a/246128
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
if uname -s | grep -iq cygwin; then
DIR=$(cygpath -w "$DIR")
PWD=$(cygpath -w "$PWD")
fi
echo $DIR
echo "Provided arguments are $@"
if [ $# -ne "12" ]; then
echo "$# arguments provided, expected 12 arguments in the following order:
1) Path to the root directory of the project under test (ProjectPath)
2) Path to the target file (.java file) (it MUST be relative to the ProjectPath)
3) Qualified name of the class under test (i.e., <package-name>.<class-name>)
4) Classpaths containing the compiled project (separated by ':')
5) Version of JUnit testing framework (either 4 or 5)
6) Model name (e.g., GPT-4)
7) Grazie token
8) Filepath to a txt-file containing prompt template
9) Output directory
10) Enable/disable coverage computation ('true' or 'false')
11) Space username
12) Space password"
exit 1
fi
echo -Proot="$1" -Pfile="$2" -Pcut="$3" -Pcp="$4" -Pjunitv="$5" -Pllm="$6" -Ptoken="$7" -Pprompt="$8" -Pout="$9" -PenableCoverage="${10}" -Dspace.username="${11}" -Dspace.pass="${12}"
"$DIR/gradlew" -p "$DIR" headless -Proot="$1" -Pfile="$2" -Pcut="$3" -Pcp="$4" -Pjunitv="$5" -Pllm="$6" -Ptoken="$7" -Pprompt="$8" -Pout="$9" -PenableCoverage="${10}" -Dspace.username="${11}" -Dspace.pass="${12}"