From a5528768a1e7a254707bad1b54d8e2f65c9490d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iy=C3=A1n?= Date: Fri, 27 Sep 2024 21:10:33 +0200 Subject: [PATCH] Remove hardcoded build patch from test script (#1938) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If a user has passed a custom build path to cmake, and then calls for example `ninja -C run_tests`, the script test_acvp_vectors.py fails due to having "build" harcoded in the calls. Instead, let's use `helpers.get_current_build_dir_name()` to get the build path and use that instead. This is already done in other scripts (e.g., test_binary.py) Signed-off-by: Iyán Méndez Veiga --- tests/test_acvp_vectors.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/test_acvp_vectors.py b/tests/test_acvp_vectors.py index 4eee4b810..ddd64003c 100644 --- a/tests/test_acvp_vectors.py +++ b/tests/test_acvp_vectors.py @@ -36,9 +36,10 @@ def test_acvp_vec_kem_keygen(kem_name): z = testCase["z"] pk = testCase["ek"] sk = testCase["dk"] - + + build_dir = helpers.get_current_build_dir_name() helpers.run_subprocess( - ['build/tests/vectors_kem', kem_name, "keyGen", d+z, pk, sk] + [f'{build_dir}/tests/vectors_kem', kem_name, "keyGen", d+z, pk, sk] ) assert(variantFound == True) @@ -66,9 +67,10 @@ def test_acvp_vec_kem_encdec_aft(kem_name): #expected results k = testCase["k"] c = testCase["c"] - + + build_dir = helpers.get_current_build_dir_name() helpers.run_subprocess( - ['build/tests/vectors_kem', kem_name, "encDecAFT", m, pk, k, c] + [f'{build_dir}/tests/vectors_kem', kem_name, "encDecAFT", m, pk, k, c] ) assert(variantFound == True) @@ -94,9 +96,10 @@ def test_acvp_vec_kem_encdec_val(kem_name): c = testCase["c"] #expected results k = testCase["k"] - + + build_dir = helpers.get_current_build_dir_name() helpers.run_subprocess( - ['build/tests/vectors_kem', kem_name, "encDecVAL", sk, k, c] + [f'{build_dir}/tests/vectors_kem', kem_name, "encDecVAL", sk, k, c] ) assert(variantFound == True)