-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
42996a9
commit b2546f5
Showing
8 changed files
with
101 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
add_executable(test_web_server EXCLUDE_FROM_ALL test_web_server.cpp) | ||
target_link_libraries(test_web_server ${PROJECT_NAME} ${catkin_LIBRARIES}) | ||
add_executable(test_web_server test_web_server.cpp) | ||
set_target_properties(test_web_server PROPERTIES | ||
COMPILE_DEFINITIONS "ASYNC_WEB_SERVER_CPP_TEST_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}\"") | ||
target_link_libraries(test_web_server ${PROJECT_NAME}) | ||
|
||
if(TARGET tests) | ||
add_dependencies(tests | ||
test_web_server | ||
) | ||
endif() | ||
|
||
add_rostest(tests.test) | ||
set(generated_test_file "${CMAKE_CURRENT_BINARY_DIR}/tests") | ||
set(TEST_WEB_SERVER_EXECUTABLE $<TARGET_FILE:test_web_server>) | ||
configure_file( | ||
"${CMAKE_CURRENT_SOURCE_DIR}/tests.py.in" | ||
"${generated_test_file}.py.genexp" | ||
@ONLY) | ||
file(GENERATE | ||
OUTPUT "${generated_test_file}_$<CONFIG>.py" | ||
INPUT "${generated_test_file}.py.genexp" | ||
) | ||
ament_add_test(tests | ||
COMMAND "${generated_test_file}_$<CONFIG>.py" | ||
GENERATE_RESULT_FOR_RETURN_CODE_ZERO) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os | ||
import sys | ||
|
||
from launch import LaunchDescription | ||
from launch import LaunchService | ||
from launch.actions import ExecuteProcess | ||
|
||
from launch_testing import LaunchTestService | ||
|
||
|
||
def main(argv=sys.argv[1:]): | ||
ld = LaunchDescription() | ||
|
||
web_server_action = ExecuteProcess( | ||
cmd=['@TEST_WEB_SERVER_EXECUTABLE@']) | ||
ld.add_action(web_server_action) | ||
|
||
test_directory = '@CMAKE_CURRENT_SOURCE_DIR@' | ||
|
||
test1_action = ExecuteProcess( | ||
cmd=[ | ||
sys.executable, '-u', | ||
os.path.join(test_directory, 'simple_http_requests_test.py')], | ||
name='simple_http_requests_test', | ||
) | ||
ld.add_action(test1_action) | ||
|
||
test2_action = ExecuteProcess( | ||
cmd=[ | ||
sys.executable, '-u', | ||
os.path.join(test_directory, 'websocket_test.py')], | ||
name='websocket_test', | ||
) | ||
ld.add_action(test2_action) | ||
|
||
lts = LaunchTestService() | ||
lts.add_test_action(ld, test1_action) | ||
lts.add_test_action(ld, test2_action) | ||
|
||
ls = LaunchService(argv=argv) | ||
ls.include_launch_description(ld) | ||
return lts.run(ls) | ||
|
||
|
||
if __name__ == '__main__': | ||
sys.exit(main()) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters