Remove hardcoded build patch from test script (#1938)

If a user has passed a custom build path to cmake, and then calls for
example `ninja -C <custom_build_path> 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 <me@iyanmv.com>
This commit is contained in:
Iyán 2024-09-27 21:10:33 +02:00 committed by GitHub
parent c4a54769be
commit a5528768a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)