Skip to content

Commit 56fa851

Browse files
committed
Enable test suite during debian builds
1 parent 858bbbb commit 56fa851

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

CMakeLists.txt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ set(DICT_PATH "/usr/share/sphinx-voxforge-en/lm/voxforge_en_sphinx.cd_cont_3000/
1111

1212
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" "${CMAKE_MODULE_PATH}")
1313

14-
option(ENABLE_TESTS "Determine if tests will be run" ON)
14+
option(ENABLE_VOICE_TESTS "Determine if voice tests will be run" OFF)
1515

1616
find_package(PkgConfig REQUIRED)
1717

@@ -72,13 +72,11 @@ configure_file(
7272
add_subdirectory("src")
7373
add_subdirectory("data")
7474

75-
if(${ENABLE_TESTS})
76-
enable_testing()
77-
ADD_CUSTOM_TARGET(
78-
check
79-
${CMAKE_CTEST_COMMAND} --force-new-ctest-process --output-on-failure
80-
)
81-
endif()
75+
enable_testing()
76+
ADD_CUSTOM_TARGET(
77+
check
78+
${CMAKE_CTEST_COMMAND} --force-new-ctest-process --output-on-failure
79+
)
8280

8381
add_subdirectory(tests)
8482

build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ mkdir -p $BUILDDIR
6464
cd $BUILDDIR
6565
cmake "$SOURCEDIR" -G "$GENERATOR" \
6666
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
67-
-DCMAKE_INSTALL_PREFIX="$SOURCEDIR/../$BRANCHNAME-install"
67+
-DCMAKE_INSTALL_PREFIX="$SOURCEDIR/../$BRANCHNAME-install" \
68+
-DENABLE_VOICE_TESTS=ON
6869
$BUILD_COMMAND
6970
)

debian/rules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,3 @@ export DPKG_GENSYMBOLS_CHECK_LEVEL=4
66
%:
77
dh $@ --parallel --fail-missing
88

9-
override_dh_auto_configure:
10-
dh_auto_configure -- -DENABLE_TESTS=NO
11-

tests/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@ add_definitions(-DPRONOUCE_DICT_HTK="${CMAKE_CURRENT_SOURCE_DIR}/data/test-prono
2020
set(
2121
UNIT_TESTS_SRC
2222
TestPronounceDict.cpp
23-
TestVoiceService.cpp
2423
main.cpp
2524
)
2625

26+
if(${ENABLE_VOICE_TESTS})
27+
list(APPEND UNIT_TESTS_SRC TestVoiceService.cpp)
28+
endif()
29+
2730
add_executable(
2831
unit-tests
2932
${UNIT_TESTS_SRC}

0 commit comments

Comments
 (0)