File tree Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -25,9 +25,13 @@ enable_testing()
25
25
#--------------------------------------#
26
26
# test-drive #
27
27
#--------------------------------------#
28
- add_subdirectory ("testing/test-drive" )
28
+ if (BUILD_TESTS MATCHES "ON" )
29
+ add_subdirectory ("testing/test-drive" )
30
+ endif ()
29
31
30
32
#--------------------------------------#
31
33
# pFUnit #
32
34
#--------------------------------------#
33
- add_subdirectory ("testing/pFUnit" )
35
+ if (BUILD_TESTS MATCHES "ON" )
36
+ add_subdirectory ("testing/pFUnit" )
37
+ endif ()
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
3
4
- PFUNIT_INSTALLED_PATH=" " # Path to pFUnit/installed directory
5
4
6
5
clean_build=false
7
6
build_cmake=false
8
7
build_fpm=false
8
+ build_tests=true
9
+ PFUNIT_INSTALLED_PATH=" " # Path to pFUnit/installed directory
9
10
run_tests=false
10
11
11
12
help () {
@@ -15,6 +16,8 @@ help() {
15
16
echo " -m Build via cmake."
16
17
echo " -f Build via fpm."
17
18
echo " -b Build with all build tools."
19
+ echo " -s Skip building cmake tests"
20
+ echo " -p Path to pFUnit/installed directory."
18
21
echo " -t Run tests."
19
22
exit 0
20
23
}
27
30
fi
28
31
29
32
# parse input arguments
30
- while getopts " hcmfbt " opt
33
+ while getopts " hcmfbtp:s " opt
31
34
do
32
35
case ${opt} in
33
36
h ) help ;;
37
40
b )
38
41
build_cmake=true
39
42
build_fpm=true;;
43
+ s ) build_tests=false;;
44
+ p ) PFUNIT_INSTALLED_PATH=" ${OPTARG} " ;;
40
45
t ) run_tests=true;;
41
46
\? ) echo " Invalid option: $OPTARG " >&2 ; exit 1;;
42
47
esac
67
72
if [ " $build_cmake " == " true" ]
68
73
then
69
74
echo " Building using cmake"
70
- cmake -DCMAKE_PREFIX_PATH=" $PFUNIT_INSTALLED_PATH " -B build-cmake
75
+ if [ " $build_tests " == " true" ]
76
+ then
77
+ echo " Building tests"
78
+ cmake -DCMAKE_PREFIX_PATH=" $PFUNIT_INSTALLED_PATH " -DBUILD_TESTS=ON -B build-cmake
79
+ else
80
+ echo " Skipping tests"
81
+ cmake -DBUILD_TESTS=OFF -B build-cmake
82
+ fi
71
83
cmake --build build-cmake
72
84
fi
73
85
You can’t perform that action at this time.
0 commit comments