|
5 | 5 | #include "osrm/extractor_config.hpp" |
6 | 6 |
|
7 | 7 | #include <boost/algorithm/string.hpp> |
| 8 | +#include <oneapi/tbb/global_control.h> |
| 9 | +#include <oneapi/tbb/parallel_for.h> |
8 | 10 | #include <tbb/flow_graph.h> |
9 | 11 | #include <thread> |
10 | 12 |
|
@@ -32,29 +34,30 @@ BOOST_AUTO_TEST_SUITE(library_extract) |
32 | 34 |
|
33 | 35 | BOOST_AUTO_TEST_CASE(test_extract_with_invalid_config) |
34 | 36 | { |
35 | | - tbb::flow::graph g; |
| 37 | + oneapi::tbb::task_scheduler_handle handle{tbb::attach{}}; |
36 | 38 | osrm::ExtractorConfig config; |
37 | 39 | config.requested_num_threads = std::thread::hardware_concurrency(); |
38 | 40 | BOOST_CHECK_THROW(osrm::extract(config), |
39 | 41 | std::exception); // including osrm::util::exception, osmium::io_error, etc. |
40 | | - g.wait_for_all(); |
| 42 | + oneapi::tbb::finalize(handle); |
41 | 43 | } |
42 | 44 |
|
43 | 45 | BOOST_AUTO_TEST_CASE(test_extract_with_valid_config) |
44 | 46 | { |
45 | | - tbb::flow::graph g; |
| 47 | + oneapi::tbb::task_scheduler_handle handle{tbb::attach{}}; |
46 | 48 | osrm::ExtractorConfig config; |
47 | 49 | config.input_path = OSRM_TEST_DATA_DIR "/monaco.osm.pbf"; |
48 | 50 | config.UseDefaultOutputNames(OSRM_TEST_DATA_DIR "/monaco.osm.pbf"); |
49 | 51 | config.profile_path = OSRM_TEST_DATA_DIR "/../../profiles/car.lua"; |
50 | 52 | config.small_component_size = 1000; |
51 | 53 | config.requested_num_threads = std::thread::hardware_concurrency(); |
52 | 54 | BOOST_CHECK_NO_THROW(osrm::extract(config)); |
53 | | - g.wait_for_all(); |
| 55 | + oneapi::tbb::finalize(handle); |
54 | 56 | } |
55 | 57 |
|
56 | 58 | BOOST_AUTO_TEST_CASE(test_setup_runtime_error) |
57 | 59 | { |
| 60 | + |
58 | 61 | osrm::ExtractorConfig config; |
59 | 62 | config.input_path = OSRM_TEST_DATA_DIR "/monaco.osm.pbf"; |
60 | 63 | config.UseDefaultOutputNames(OSRM_TEST_DATA_DIR "/monaco.osm.pbf"); |
|
0 commit comments