Skip to content

Commit 0b67e40

Browse files
committedOct 16, 2022
[MINOR] Add cli args handling to test.sh
This improvement makes test.sh forward some build options to build.sh while still passing catch2 options to the run_tests executable
1 parent 8d7d209 commit 0b67e40

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed
 

‎build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ fi
731731

732732
daphne_msg "Build Daphne"
733733

734-
cmake -S "$projectRoot" -B "$daphneBuildDir" -G Ninja $BUILD_CUDA $BUILD_ARROW $BUILD_FPGAOPENCL $BUILD_DEBUG \
734+
cmake -S "$projectRoot" -B "$daphneBuildDir" -G Ninja $BUILD_CUDA $BUILD_ARROW $BUILD_FPGAOPENCL $BUILD_DEBUG \
735735
-DCMAKE_PREFIX_PATH="$installPrefix" -DANTLR_VERSION="$antlrVersion" \
736736
-DMLIR_DIR="$buildPrefix/$llvmName/lib/cmake/mlir/" \
737737
-DLLVM_DIR="$buildPrefix/$llvmName/lib/cmake/llvm/"

‎test.sh

+34-2
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,46 @@
2626
# Stop immediately if any command fails.
2727
set -e
2828

29+
catch2_options=""
30+
BUILD_CUDA=""
31+
BUILD_ARROW=""
32+
BUILD_FPGAOPENCL=""
33+
BUILD_DEBUG=""
34+
35+
while [[ $# -gt 0 ]]; do
36+
key=$1
37+
shift
38+
case $key in
39+
--cuda)
40+
echo using CUDA
41+
export BUILD_CUDA="--cuda"
42+
;;
43+
--arrow)
44+
echo using ARROW
45+
BUILD_ARROW="--arrow"
46+
;;
47+
--fpgaopencl)
48+
echo using FPGAOPENCL
49+
export BUILD_FPGAOPENCL="--fpgaopencl"
50+
;;
51+
--debug)
52+
echo building DEBUG version
53+
export BUILD_DEBUG="--debug"
54+
;;
55+
*)
56+
catch2_options="${catch2_options} ${key}"
57+
;;
58+
esac
59+
done
60+
2961
# Build tests.
30-
./build.sh --target run_tests
62+
./build.sh $BUILD_CUDA $BUILD_ARROW $BUILD_FPGAOPENCL $BUILD_DEBUG --target run_tests
3163

3264
# Preparations for running DaphneLib (Python API) tests.
3365
export PYTHONPATH=$PYTHONPATH:$(pwd)/src/
3466
mkdir --parents src/api/python/tmp
3567

3668
# Run tests.
37-
build/test/run_tests $@
69+
build/test/run_tests $catch2_options
3870

3971
set +e

0 commit comments

Comments
 (0)