From 32cb58787af8145db8e8178c7cf0fba8945ebd1f Mon Sep 17 00:00:00 2001 From: res0nance Date: Wed, 20 Sep 2023 21:04:35 +0800 Subject: [PATCH] ci: run windows tests --- .github/workflows/windows.yml | 5 +++++ tests/helpers.py | 3 +++ tests/tmp_store.c | 10 +++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index da0dfa8c17..807730a469 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -25,3 +25,8 @@ jobs: run: cmake -B build --toolchain ${{ matrix.toolchain }} . - name: Build Project run: cmake --build build + - name: Test dependencies + run: pip.exe install pytest pytest-xdist pyyaml + - name: Run tests + run: | + python -m pytest --numprocesses=auto -vv --maxfail=10 --ignore=tests/test_code_conventions.py --junitxml=build\test-results\pytest\test-results.xml diff --git a/tests/helpers.py b/tests/helpers.py index a12ebce842..782b559a40 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -141,6 +141,9 @@ 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"), diff --git a/tests/tmp_store.c b/tests/tmp_store.c index df57bbecb5..addbd64f71 100644 --- a/tests/tmp_store.c +++ b/tests/tmp_store.c @@ -11,11 +11,19 @@ #define MAXPATHLEN 128 #if (defined(_WIN32) || defined(__WIN32__)) -#define mkdir(A, B) mkdir(A) +#include #endif static OQS_STATUS oqs_fstore_init(void) { +#ifndef _WIN32 return mkdir(OQS_STORE_DIR, 0755); +#else + if (CreateDirectory(OQS_STORE_DIR, NULL)) { + return OQS_SUCCESS; + } else { + return OQS_ERROR; + } +#endif } static OQS_STATUS oqs_fstore(const char *fname, const char *mname, uint8_t *data, size_t len) {