fixing the test in both build systems

This commit is contained in:
Hans Dembinski 2019-02-09 15:56:08 +01:00
parent 718952e589
commit b7b945a0bc
4 changed files with 21 additions and 13 deletions

View File

@ -15,6 +15,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
set(MIN_BOOST_VERSION 1.66)
if ("$ENV{BOOST_ROOT}" STREQUAL "")
# assume that we are inside the boost-superproject
set(BOOST_INCLUDEDIR "${PROJECT_SOURCE_DIR}/../..")
endif()
@ -186,11 +187,11 @@ if (BUILD_BENCHMARKS)
target_link_libraries(${BASENAME} PRIVATE benchmark::benchmark_main)
endfunction()
benchmark(test/iteration_bench.cpp)
benchmark(test/axis_bench.cpp)
benchmark(test/parallel_filling_bench.cpp)
benchmark(benchmark/axis_index.cpp)
benchmark(benchmark/histogram_iteration.cpp)
benchmark(benchmark/histogram_parallel_filling.cpp)
add_executable(speed_boost test/speed_boost.cpp)
add_executable(speed_boost benchmark/speed_boost.cpp)
target_include_directories(speed_boost PRIVATE include ${Boost_INCLUDE_DIR})
target_compile_definitions(speed_boost PRIVATE -DBOOST_DISABLE_ASSERTS)
target_compile_options(speed_boost PRIVATE -O3)

View File

@ -5,7 +5,7 @@
// or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/histogram.hpp>
#include "utility_histogram.hpp"
#include "../test/utility_histogram.hpp"
#include <cassert>
#include <cstdio>

View File

@ -6,6 +6,7 @@
# http://www.boost.org/LICENSE_1_0.txt)
import testing ;
import feature ;
project
: requirements
@ -13,6 +14,8 @@ project
<include>.
;
path-constant THIS_PATH : . ;
alias run-tests :
[ run algorithm_project_test.cpp ]
[ run algorithm_reduce_test.cpp ]
@ -34,15 +37,21 @@ alias run-tests :
[ run histogram_growing_test.cpp ]
[ run histogram_mixed_test.cpp ]
[ run histogram_operators_test.cpp ]
[ run histogram_serialization_test.cpp /boost/serialization//boost_serialization/<link>static : : histogram_serialization_test_dynamic.xml histogram_serialization_test_static.xml ]
[ run histogram_serialization_test.cpp
/boost/serialization//boost_serialization/<link>static : : :
<define>STATIC_XML=\\\"$(THIS_PATH)/histogram_serialization_test_static.xml\\\"
<define>DYNAMIC_XML=\\\"$(THIS_PATH)/histogram_serialization_test_dynamic.xml\\\"
]
[ run histogram_test.cpp ]
[ run indexed_test.cpp ]
[ run internal_accumulators_test.cpp ]
[ run linearize_test.cpp ]
[ run meta_test.cpp ]
[ run storage_adaptor_serialization_test.cpp /boost/serialization//boost_serialization/<link>static ]
[ run storage_adaptor_serialization_test.cpp
/boost/serialization//boost_serialization/<link>static ]
[ run storage_adaptor_test.cpp ]
[ run unlimited_storage_serialization_test.cpp /boost/serialization//boost_serialization/<link>static ]
[ run unlimited_storage_serialization_test.cpp
/boost/serialization//boost_serialization/<link>static ]
[ run unlimited_storage_test.cpp ]
[ run utility_test.cpp ]
;

View File

@ -9,7 +9,6 @@
#include <boost/core/lightweight_test.hpp>
#include <boost/histogram.hpp>
#include <boost/histogram/serialization.hpp>
#include <cassert>
#include <cmath>
#include <fstream>
#include <sstream>
@ -63,9 +62,8 @@ void run_tests(const char* filename) {
BOOST_TEST_EQ(a, b);
}
int main(int argc, char** argv) {
assert(argc == 3);
run_tests<dynamic_tag>(argv[1]);
run_tests<static_tag>(argv[2]);
int main() {
run_tests<static_tag>(STATIC_XML);
run_tests<dynamic_tag>(DYNAMIC_XML);
return boost::report_errors();
}