From 8138f6e32d1cd0039befb57274effd71db43cf7b Mon Sep 17 00:00:00 2001 From: res0nance Date: Thu, 21 Sep 2023 23:06:02 +0800 Subject: [PATCH] build: set folder as ./build/test when using VS This aligns the output folder for tests much like other platforms. --- tests/CMakeLists.txt | 12 ++++++++++++ tests/helpers.py | 3 --- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 9d7a7ec947..4963e0f934 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -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. diff --git a/tests/helpers.py b/tests/helpers.py index 782b559a40..a12ebce842 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -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"),