From b8f8716b69d9d6c9b11ac8a3adba00d39cdbcd53 Mon Sep 17 00:00:00 2001 From: Stephan Schmiedmayer <56692976+StephanSchmiedmayer@users.noreply.github.com> Date: Fri, 19 Apr 2024 15:29:44 +0200 Subject: [PATCH 1/3] Fix cmake falsely included tests --- test/CMakeLists.txt | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index b2852aa..f85bdc9 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,5 +1,4 @@ -create_test_sourcelist(fixture-tests - bbs-test-fixtures.c +set(BBS_FIX_TESTS bbs_fix_msg_scalars.c bbs_fix_generators.c bbs_fix_keygen.c @@ -9,11 +8,20 @@ create_test_sourcelist(fixture-tests bbs_fix_proof_verify.c bbs_fix_hash_to_scalar.c bbs_fix_expand_message.c - ) +) + +create_test_sourcelist(fixture-tests + bbs-test-fixtures.c + ${BBS_FIX_TESTS} +) + +set(BBS_E2E_TESTS + bbs_e2e_sign_n_proof.c +) create_test_sourcelist(e2e-tests bbs-test-e2e.c - bbs_e2e_sign_n_proof.c + ${BBS_E2E_TESTS} ) add_executable(bbs-test-fixtures ${fixture-tests} fixtures.c) @@ -27,11 +35,9 @@ target_link_libraries(bbs-test-e2e-bench PRIVATE bbs) target_compile_definitions(bbs-test-e2e-bench PUBLIC ENABLE_BENCHMARK) add_custom_target(bench COMMAND bbs-test-e2e-bench) -set(fixture-test-list ${fixture-tests}) -remove(fixture-test-list bbs-test-fixtures.c) +set(fixture-test-list ${BBS_FIX_TESTS}) -set(e2e-test-list ${e2e-tests}) -remove(e2e-test-list bbs-test-e2e.c) +set(e2e-test-list ${BBS_E2E_TESTS}) foreach(test ${fixture-test-list}) get_filename_component (TName ${test} NAME_WE) From c55c744b36507a0b260838f992cbb84065e5e24c Mon Sep 17 00:00:00 2001 From: Stephan Schmiedmayer <56692976+StephanSchmiedmayer@users.noreply.github.com> Date: Fri, 19 Apr 2024 15:30:40 +0200 Subject: [PATCH 2/3] Format --- test/CMakeLists.txt | 56 ++++++++++++++++----------------------------- 1 file changed, 20 insertions(+), 36 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f85bdc9..20386a1 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,28 +1,19 @@ -set(BBS_FIX_TESTS - bbs_fix_msg_scalars.c - bbs_fix_generators.c - bbs_fix_keygen.c - bbs_fix_sign.c - bbs_fix_verify.c - bbs_fix_proof_gen.c - bbs_fix_proof_verify.c - bbs_fix_hash_to_scalar.c - bbs_fix_expand_message.c -) - -create_test_sourcelist(fixture-tests - bbs-test-fixtures.c - ${BBS_FIX_TESTS} -) - -set(BBS_E2E_TESTS - bbs_e2e_sign_n_proof.c -) - -create_test_sourcelist(e2e-tests - bbs-test-e2e.c - ${BBS_E2E_TESTS} - ) +set(BBS_FIX_TESTS + bbs_fix_msg_scalars.c + bbs_fix_generators.c + bbs_fix_keygen.c + bbs_fix_sign.c + bbs_fix_verify.c + bbs_fix_proof_gen.c + bbs_fix_proof_verify.c + bbs_fix_hash_to_scalar.c + bbs_fix_expand_message.c) + +create_test_sourcelist(fixture-tests bbs-test-fixtures.c ${BBS_FIX_TESTS}) + +set(BBS_E2E_TESTS bbs_e2e_sign_n_proof.c) + +create_test_sourcelist(e2e-tests bbs-test-e2e.c ${BBS_E2E_TESTS}) add_executable(bbs-test-fixtures ${fixture-tests} fixtures.c) target_link_libraries(bbs-test-fixtures PRIVATE bbs) @@ -40,18 +31,11 @@ set(fixture-test-list ${BBS_FIX_TESTS}) set(e2e-test-list ${BBS_E2E_TESTS}) foreach(test ${fixture-test-list}) - get_filename_component (TName ${test} NAME_WE) - add_test( - NAME ${TName} - COMMAND bbs-test-fixtures ${TName} - ) + get_filename_component(TName ${test} NAME_WE) + add_test(NAME ${TName} COMMAND bbs-test-fixtures ${TName}) endforeach() foreach(test ${e2e-test-list}) - get_filename_component (TName ${test} NAME_WE) - add_test( - NAME ${TName} - COMMAND bbs-test-e2e ${TName} - ) + get_filename_component(TName ${test} NAME_WE) + add_test(NAME ${TName} COMMAND bbs-test-e2e ${TName}) endforeach() - From 786def55d5d618da5c1eb67a568adec8872d7f8b Mon Sep 17 00:00:00 2001 From: Stephan Schmiedmayer <56692976+StephanSchmiedmayer@users.noreply.github.com> Date: Fri, 19 Apr 2024 15:34:38 +0200 Subject: [PATCH 3/3] Simplify cmake --- test/CMakeLists.txt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 20386a1..8415dee 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -26,16 +26,12 @@ target_link_libraries(bbs-test-e2e-bench PRIVATE bbs) target_compile_definitions(bbs-test-e2e-bench PUBLIC ENABLE_BENCHMARK) add_custom_target(bench COMMAND bbs-test-e2e-bench) -set(fixture-test-list ${BBS_FIX_TESTS}) - -set(e2e-test-list ${BBS_E2E_TESTS}) - -foreach(test ${fixture-test-list}) +foreach(test ${BBS_FIX_TESTS}) get_filename_component(TName ${test} NAME_WE) add_test(NAME ${TName} COMMAND bbs-test-fixtures ${TName}) endforeach() -foreach(test ${e2e-test-list}) +foreach(test ${BBS_E2E_TESTS}) get_filename_component(TName ${test} NAME_WE) add_test(NAME ${TName} COMMAND bbs-test-e2e ${TName}) endforeach()