Skip to content

Commit

Permalink
Run all of the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kpu committed Feb 22, 2016
1 parent d3b0a19 commit 28166d3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
3 changes: 1 addition & 2 deletions cmake/KenLMFunctions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ function(AddTests)
cmake_parse_arguments(AddTests "" "" "${multiValueArgs}" ${ARGN})

# Iterate through the Boost tests list
foreach(test ${KENLM_BOOST_TESTS_LIST})

foreach(test ${AddTests_TESTS})
KenLMAddTest(TEST ${test}
DEPENDS ${AddTests_DEPENDS}
LIBRARIES ${AddTests_LIBRARIES}
Expand Down
21 changes: 10 additions & 11 deletions lm/interpolate/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,21 @@ if(EIGEN3_FOUND AND 3.1.0 VERSION_LESS ${EIGEN3_VERSION})
LIBRARIES ${KENLM_INTERPOLATE_LIBS})

if(BUILD_TESTING)
set(KENLM_INTERPOLATE_TESTS
backoff_reunification_test
bounded_sequence_encoding_test
merge_vocab_test
normalize_test
tune_derivatives_test)

AddTests(TESTS ${KENLM_INTERPOLATE_TESTS}
AddTests(TESTS backoff_reunification_test bounded_sequence_encoding_test normalize_test tune_derivatives_test
LIBRARIES ${KENLM_INTERPOLATE_LIBS} pthread)

# tune_instances_test needs an extra command line parameter
KenLMAddTest(TEST tune_instances_test
DEPENDS ${KENLM_INTERPOLATE_DEPENDS}
LIBRARIES ${KENLM_INTERPOLATE_LIBS}
TEST_ARGS
${CMAKE_CURRENT_SOURCE_DIR}/tune_instances_data/toy0.1)
TEST_ARGS ${CMAKE_CURRENT_SOURCE_DIR}/tune_instances_data/toy0.1)

foreach(test_file test1 test2 test3 test_bad_order test_no_unk)
set(KENLM_MERGE_TESTS_PATH ${KENLM_MERGE_TESTS_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/merge_test/${test_file})
endforeach(test_file)

KenLMAddTest(TEST merge_vocab_test
LIBRARIES ${KENLM_INTERPOLATE_LIBS}
TEST_ARGS ${KENLM_MERGE_TESTS_PATH})
endif()
else()
if (EIGEN3_FOUND)
Expand Down
10 changes: 4 additions & 6 deletions util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,24 @@ add_subdirectory(double-conversion)
add_subdirectory(stream)

# Group these objects together for later use.
#
# Given add_library(foo OBJECT ${my_foo_sources}),
# refer to these objects as $<TARGET_OBJECTS:foo>
#
add_library(kenlm_util ${KENLM_UTIL_DOUBLECONVERSION_SOURCE} ${KENLM_UTIL_STREAM_SOURCE} ${KENLM_UTIL_SOURCE})

AddExes(EXES probing_hash_table_benchmark
LIBRARIES kenlm_util ${Boost_LIBRARIES} pthread ${TIMER_LINK})

# Only compile and run unit tests if tests should be run
if(BUILD_TESTING)

# Explicitly list the Boost test files to be compiled
set(KENLM_BOOST_TESTS_LIST
bit_packing_test
integer_to_string_test
joint_sort_test
multi_intersection_test
pcqueue_test
probing_hash_table_test
read_compressed_test
sized_iterator_test
sorted_uniform_test
string_stream_test
tokenize_piece_test
)

Expand Down
1 change: 1 addition & 0 deletions util/stream/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ if(BUILD_TESTING)
io_test
sort_test
stream_test
rewindable_stream_test
)

AddTests(TESTS ${KENLM_BOOST_TESTS_LIST}
Expand Down

0 comments on commit 28166d3

Please sign in to comment.