Skip to content

Commit

Permalink
Check env variable PYTEST is set
Browse files Browse the repository at this point in the history
  • Loading branch information
ahsanabbas123 committed Nov 6, 2023
1 parent ccc0050 commit 375d023
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/tests/integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@ target_link_libraries(rmqintegration PUBLIC

target_include_directories(rmqintegration PUBLIC .)

find_package (Python3 COMPONENTS Interpreter REQUIRED)
execute_process (COMMAND "${Python3_EXECUTABLE}" -m venv ${CMAKE_CURRENT_BINARY_DIR}/.venv)

set (ENV{VIRTUAL_ENV} ${CMAKE_CURRENT_BINARY_DIR}/.venv)

execute_process(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/.venv/bin/pip install -r ${CMAKE_CURRENT_LIST_DIR}/requirements.txt)

set(PYTEST
${CMAKE_CURRENT_BINARY_DIR}/.venv/bin/python -m pytest
)
if (NOT DEFINED ENV{PYTEST})
find_package (Python3 COMPONENTS Interpreter REQUIRED)
execute_process (COMMAND "${Python3_EXECUTABLE}" -m venv ${CMAKE_CURRENT_BINARY_DIR}/.venv)
set (ENV{VIRTUAL_ENV} ${CMAKE_CURRENT_BINARY_DIR}/.venv)
execute_process(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/.venv/bin/pip install -r ${CMAKE_CURRENT_LIST_DIR}/requirements.txt)
set(PYTEST
${CMAKE_CURRENT_BINARY_DIR}/.venv/bin/python -m pytest
)
else()
set(PYTEST ENV{PYTEST})
endif()
set( PYTEST_ARGS "-q" "-rap" "--maxfail=2" "--tb=short" "--durations=1" "--log-level=error" "-s")


Expand Down

0 comments on commit 375d023

Please sign in to comment.