1
1
#! /usr/bin/env bash
2
2
# If supplied $1 is the executable and $2 is the file where to create test-output.txt and summary.csv, otherwise these
3
- # default to the 'target/current-directory-name' (e.g. target/commandlinerunner) and
4
- # target /native respectively
3
+ # default to the 'target/current-directory-name' (e.g. target/commandlinerunner) and target/native respectively for Maven
4
+ # or 'build /native/current-directory-name' (e.g. build/native/commandlinerunner) and build/native respectively for Gradle.
5
5
6
6
GREEN=' \033[0;32m'
7
7
RED=' \033[0;31m'
@@ -10,25 +10,33 @@ NC='\033[0m'
10
10
if [[ " $1 " == " -s" ]]; then
11
11
SILENT=true
12
12
shift 1
13
- else
13
+ else
14
14
SILENT=false
15
15
fi
16
16
17
+ if [ -f pom.xml ]; then
18
+ EXECUTABLE_DIR=target
19
+ REPORT_DIR=target/native
20
+ else
21
+ EXECUTABLE_DIR=build/native
22
+ REPORT_DIR=build/native
23
+ fi
24
+
17
25
if ! [ -z " $1 " ]; then
18
26
if [[ " $1 " != " --" * ]]; then
19
27
EXECUTABLE=${1}
20
28
shift 1
21
29
else
22
- EXECUTABLE=target /${PWD##*/ }
30
+ EXECUTABLE=${EXECUTABLE_DIR} /${PWD##*/ }
23
31
fi
24
32
else
25
- EXECUTABLE=${1:- target / ${PWD##*/ } }
33
+ EXECUTABLE=${1:- ${EXECUTABLE_DIR} / ${PWD##*/ } }
26
34
fi
27
35
28
36
if [ -z " $1 " ] || [[ " $1 " == " --" * ]]; then
29
- TEST_OUTPUT_FILE=target/native /test-output.txt
30
- BUILD_OUTPUT_FILE=target/native /output.txt
31
- SUMMARY_CSV_FILE=target/native /summary.csv
37
+ TEST_OUTPUT_FILE=${REPORT_DIR} /test-output.txt
38
+ BUILD_OUTPUT_FILE=${REPORT_DIR} /output.txt
39
+ SUMMARY_CSV_FILE=${REPORT_DIR} /summary.csv
32
40
else
33
41
TEST_OUTPUT_FILE=$1 /test-output.txt
34
42
BUILD_OUTPUT_FILE=$1 /output.txt
0 commit comments