Skip to content

Commit

Permalink
build: set folder as ./build/test when using VS
Browse files Browse the repository at this point in the history
This aligns the output folder for tests much like other
platforms.
  • Loading branch information
res0nance committed Sep 22, 2023
1 parent 007219c commit 8138f6e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
12 changes: 12 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,18 @@ endif()
get_property(OQS_COMPILE_OPTIONS TARGET speed_kem PROPERTY COMPILE_OPTIONS)
add_definitions(-DOQS_COMPILE_OPTIONS="[${OQS_COMPILE_OPTIONS}]")

if (CMAKE_GENERATOR MATCHES "Visual Studio")
# With Visual studio the output of tests go into a folder with the configuration option. Force it to the same folder as if
# generating with Ninja
set_target_properties(
dump_alg_info example_kem kat_kem test_kem example_sig kat_sig test_sig test_sig_mem test_kem_mem speed_kem speed_sig
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/tests"
RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/tests"
RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/tests"
RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${CMAKE_BINARY_DIR}/tests")
endif()

# TODO: Get CMake to find python.
# and set PATH variable in Windows
# for DLL builds.
Expand Down
3 changes: 0 additions & 3 deletions tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,6 @@ def path_to_executable(program_name):
if 'APPVEYOR_BUILD_FOLDER' not in os.environ: os.environ['APPVEYOR_BUILD_FOLDER'] = "."
path = os.path.join(path, os.environ['APPVEYOR_BUILD_FOLDER'])
path = os.path.join(path, get_current_build_dir_name(), "tests")
if sys.platform.startswith("win"):
if 'GITHUB_ACTIONS' in os.environ:
path = os.path.join(path, "Debug")
for executable in [
os.path.join(path, program_name),
os.path.join(path, program_name + ".EXE"),
Expand Down

0 comments on commit 8138f6e

Please sign in to comment.