Fix test outputs on buildbot. Also fix pairhash test.
This commit is contained in:
parent
5bf3d5aabf
commit
f1388fffba
5 changed files with 15 additions and 9 deletions
|
@ -2,4 +2,5 @@ get_filename_component(_TEST_NAME ${CMAKE_CURRENT_LIST_DIR} NAME)
|
|||
add_executable(${_TEST_NAME}_tests ${_TEST_NAME}_tests_main.cpp printer_parts.cpp printer_parts.hpp)
|
||||
target_link_libraries(${_TEST_NAME}_tests test_common libslic3r ${Boost_LIBRARIES} ${TBB_LIBRARIES} ${Boost_LIBRARIES})
|
||||
|
||||
catch_discover_tests(${_TEST_NAME}_tests TEST_PREFIX "${_TEST_NAME}: ")
|
||||
# catch_discover_tests(${_TEST_NAME}_tests TEST_PREFIX "${_TEST_NAME}: ")
|
||||
add_test(${_TEST_NAME}_tests ${_TEST_NAME}_tests "--durations yes")
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
get_filename_component(_TEST_NAME ${CMAKE_CURRENT_LIST_DIR} NAME)
|
||||
add_executable(${_TEST_NAME}_tests ${_TEST_NAME}_tests.cpp tests_main.cpp)
|
||||
add_executable(${_TEST_NAME}_tests ${_TEST_NAME}_tests.cpp)
|
||||
target_link_libraries(${_TEST_NAME}_tests test_common libslic3r ${Boost_LIBRARIES} ${TBB_LIBRARIES} ${Boost_LIBRARIES})
|
||||
|
||||
catch_discover_tests(${_TEST_NAME}_tests TEST_PREFIX "${_TEST_NAME}: ")
|
||||
#catch_discover_tests(${_TEST_NAME}_tests TEST_PREFIX "${_TEST_NAME}: ")
|
||||
add_test(${_TEST_NAME}_tests ${_TEST_NAME}_tests "--durations yes")
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#define CATCH_CONFIG_MAIN
|
||||
#include <catch2/catch.hpp>
|
||||
|
||||
#include <unordered_set>
|
||||
|
@ -358,10 +359,13 @@ template <class I, class II> void test_pairhash()
|
|||
|
||||
const I Ibits = int(sizeof(I) * CHAR_BIT);
|
||||
const II IIbits = int(sizeof(II) * CHAR_BIT);
|
||||
const int bits = IIbits / 2 < Ibits ? Ibits / 2 : Ibits;
|
||||
|
||||
|
||||
int bits = IIbits / 2 < Ibits ? Ibits / 2 : Ibits;
|
||||
if (std::is_signed<I>::value) bits -= 1;
|
||||
const I Imin = std::is_signed<I>::value ? -I(std::pow(2., bits)) : 0;
|
||||
const I Imax = I(std::pow(2., bits) - 1);
|
||||
std::uniform_int_distribution<I> dis(0, Imax);
|
||||
|
||||
std::uniform_int_distribution<I> dis(Imin, Imax);
|
||||
|
||||
for (size_t i = 0; i < nums;) {
|
||||
I a = dis(gen);
|
||||
|
@ -395,6 +399,7 @@ template <class I, class II> void test_pairhash()
|
|||
}
|
||||
|
||||
TEST_CASE("Pillar pairhash should be unique", "[SLASupportGeneration]") {
|
||||
test_pairhash<int, int>();
|
||||
test_pairhash<int, long>();
|
||||
test_pairhash<unsigned, unsigned>();
|
||||
test_pairhash<unsigned, unsigned long>();
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
#define CATCH_CONFIG_MAIN
|
||||
#include <catch2/catch.hpp>
|
|
@ -2,4 +2,5 @@ get_filename_component(_TEST_NAME ${CMAKE_CURRENT_LIST_DIR} NAME)
|
|||
add_executable(${_TEST_NAME}_tests ${_TEST_NAME}_tests_main.cpp)
|
||||
target_link_libraries(${_TEST_NAME}_tests test_common libslic3r ${Boost_LIBRARIES} ${TBB_LIBRARIES} ${Boost_LIBRARIES})
|
||||
|
||||
catch_discover_tests(${_TEST_NAME}_tests TEST_PREFIX "${_TEST_NAME}: ")
|
||||
# catch_discover_tests(${_TEST_NAME}_tests TEST_PREFIX "${_TEST_NAME}: ")
|
||||
add_test(${_TEST_NAME}_tests ${_TEST_NAME}_tests "--durations yes")
|
||||
|
|
Loading…
Reference in a new issue