Add unit tests selectiong algorithm
This commit is contained in:
		
							parent
							
								
									108fce896b
								
							
						
					
					
						commit
						5f73ac1eda
					
				| @ -6,13 +6,14 @@ PROFILE_ROOT:=../../profiles | ||||
| SCRIPT_ROOT:=../../scripts | ||||
| OSRM_EXTRACT:=$(OSRM_BUILD_DIR)/osrm-extract | ||||
| OSRM_CONTRACT:=$(OSRM_BUILD_DIR)/osrm-contract | ||||
| OSRM_PARTITION:=$(OSRM_BUILD_DIR)/osrm-partition | ||||
| OSRM_ROUTED:=$(OSRM_BUILD_DIR)/osrm-routed | ||||
| POLY2REQ:=$(SCRIPT_ROOT)/poly2req.js | ||||
| MD5SUM:=$(SCRIPT_ROOT)/md5sum.js | ||||
| TIMER:=$(SCRIPT_ROOT)/timer.sh | ||||
| PROFILE:=$(PROFILE_ROOT)/car.lua | ||||
| 
 | ||||
| all: $(DATA_NAME).osrm.hsgr | ||||
| all: $(DATA_NAME).osrm.hsgr $(DATA_NAME).osrm.partition | ||||
| 
 | ||||
| clean: | ||||
| 	-rm $(DATA_NAME).* | ||||
| @ -33,6 +34,10 @@ $(DATA_NAME).osrm.hsgr: $(DATA_NAME).osrm $(PROFILE) $(OSRM_CONTRACT) | ||||
| 	@echo "Running osrm-contract..." | ||||
| 	$(TIMER) "osrm-contract" $(OSRM_CONTRACT) $(DATA_NAME).osrm | ||||
| 
 | ||||
| $(DATA_NAME).osrm.partition: $(DATA_NAME).osrm $(PROFILE) $(OSRM_PARTITION) | ||||
| 	@echo "Running osrm-partition..." | ||||
| 	$(TIMER) "osrm-partition" $(OSRM_PARTITION) $(DATA_NAME).osrm | ||||
| 
 | ||||
| $(DATA_NAME).requests: $(DATA_NAME).poly | ||||
| 	$(POLY2REQ) $(DATA_NAME).poly > $(DATA_NAME).requests | ||||
| 
 | ||||
|  | ||||
							
								
								
									
										47
									
								
								unit_tests/library/options.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								unit_tests/library/options.cpp
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,47 @@ | ||||
| #include <boost/test/test_case_template.hpp> | ||||
| #include <boost/test/unit_test.hpp> | ||||
| 
 | ||||
| #include "args.hpp" | ||||
| #include "coordinates.hpp" | ||||
| #include "equal_json.hpp" | ||||
| #include "fixture.hpp" | ||||
| 
 | ||||
| #include "osrm/osrm.hpp" | ||||
| 
 | ||||
| BOOST_AUTO_TEST_SUITE(options) | ||||
| 
 | ||||
| BOOST_AUTO_TEST_CASE(test_ch) | ||||
| { | ||||
|     const auto args = get_args(); | ||||
| 
 | ||||
|     using namespace osrm; | ||||
|     EngineConfig config; | ||||
|     config.storage_config = storage::StorageConfig(args.at(0)); | ||||
|     config.algorithm = EngineConfig::Algorithm::CH; | ||||
|     OSRM osrm {config}; | ||||
| } | ||||
| 
 | ||||
| BOOST_AUTO_TEST_CASE(test_corech) | ||||
| { | ||||
|     const auto args = get_args(); | ||||
| 
 | ||||
|     using namespace osrm; | ||||
|     EngineConfig config; | ||||
|     config.storage_config = storage::StorageConfig(args.at(0)); | ||||
|     config.algorithm = EngineConfig::Algorithm::CoreCH; | ||||
|     OSRM osrm {config}; | ||||
| } | ||||
| 
 | ||||
| BOOST_AUTO_TEST_CASE(test_mld) | ||||
| { | ||||
|     const auto args = get_args(); | ||||
| 
 | ||||
|     using namespace osrm; | ||||
|     EngineConfig config; | ||||
|     config.storage_config = storage::StorageConfig(args.at(0)); | ||||
|     config.algorithm = EngineConfig::Algorithm::MLD; | ||||
|     OSRM osrm {config}; | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| BOOST_AUTO_TEST_SUITE_END() | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user