Browse Source

functional_tests: detect requests python module

moneromooo-monero 4 months ago
parent
commit
3e50a9e8fc
No account linked to committer's email address
1 changed files with 9 additions and 3 deletions
  1. 9
    3
      tests/functional_tests/CMakeLists.txt

+ 9
- 3
tests/functional_tests/CMakeLists.txt View File

@@ -50,6 +50,12 @@ target_link_libraries(functional_tests
50 50
     ${CMAKE_THREAD_LIBS_INIT}
51 51
     ${EXTRA_LIBRARIES})
52 52
 
53
-add_test(
54
-  NAME    functional_tests_rpc
55
-  COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/functional_tests_rpc.py" "${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" all)
53
+execute_process(COMMAND ${PYTHON_EXECUTABLE} "-c" "import requests; print('OK')" OUTPUT_VARIABLE REQUESTS_OUTPUT OUTPUT_STRIP_TRAILING_WHITESPACE)
54
+if (REQUESTS_OUTPUT STREQUAL "OK")
55
+  add_test(
56
+    NAME    functional_tests_rpc
57
+    COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/functional_tests_rpc.py" "${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" all)
58
+else()
59
+  message(WARNING "functional_tests_rpc skipped, needs the 'requests' python module")
60
+  set(CTEST_CUSTOM_TESTS_IGNORE ${CTEST_CUSTOM_TESTS_IGNORE} functional_tests_rpc)
61
+endif()

Loading…
Cancel
Save