diff options
| author | Kenjiro Nakayama <nakayamakenjiro@gmail.com> | 2025-05-04 20:46:51 +0900 |
|---|---|---|
| committer | Kenjiro Nakayama <nakayamakenjiro@gmail.com> | 2025-05-04 20:50:49 +0900 |
| commit | dbce13a80f82840d79b65dee5fe6d2ce7608e97f (patch) | |
| tree | 038d6124a81554ce7ad75bd2d642c371103f86bf | |
| parent | a2dfbc3d84444673db6fd5fed04d72480b0b8d61 (diff) | |
| download | portable-dbce13a80f82840d79b65dee5fe6d2ce7608e97f.tar.gz portable-dbce13a80f82840d79b65dee5fe6d2ce7608e97f.tar.bz2 portable-dbce13a80f82840d79b65dee5fe6d2ce7608e97f.zip | |
rewrite pq_test to perform internal checks
This change prepares for the patch at
https://marc.info/?l=openbsd-tech&m=174634767904894&w=2 by removing the
need for pq_expected.txt, pq_test.sh, and pq_test.bat. The test now
performs internal output and priority verification in code, simplifying
the test infrastructure across platforms.
Update CMakeLists.txt and Makefile.am accordingly.
| -rw-r--r-- | tests/CMakeLists.txt | 8 | ||||
| -rw-r--r-- | tests/Makefile.am | 4 | ||||
| -rw-r--r-- | tests/pq_test.bat | 15 | ||||
| -rwxr-xr-x | tests/pq_test.sh | 9 | ||||
| -rwxr-xr-x | update.sh | 1 |
5 files changed, 2 insertions, 35 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d7cc499..417e093 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt | |||
| @@ -620,13 +620,7 @@ add_platform_test(policy policy) | |||
| 620 | # pq_test | 620 | # pq_test |
| 621 | add_executable(pq_test pq_test.c) | 621 | add_executable(pq_test pq_test.c) |
| 622 | target_link_libraries(pq_test ${OPENSSL_TEST_LIBS}) | 622 | target_link_libraries(pq_test ${OPENSSL_TEST_LIBS}) |
| 623 | if(NOT WIN32) | 623 | add_platform_test(pq_test pq_test) |
| 624 | add_test(NAME pq_test COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/pq_test.sh) | ||
| 625 | else() | ||
| 626 | add_test(NAME pq_test COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/pq_test.bat | ||
| 627 | $<TARGET_FILE:pq_test>) | ||
| 628 | endif() | ||
| 629 | set_tests_properties(pq_test PROPERTIES ENVIRONMENT "srcdir=${TEST_SOURCE_DIR}") | ||
| 630 | 624 | ||
| 631 | # quictest | 625 | # quictest |
| 632 | set(QUICTEST_SRC quictest.c) | 626 | set(QUICTEST_SRC quictest.c) |
diff --git a/tests/Makefile.am b/tests/Makefile.am index b58de21..23f8557 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am | |||
| @@ -656,11 +656,9 @@ EXTRA_DIST += policy_root2.pem | |||
| 656 | EXTRA_DIST += policy_root_cross_inhibit_mapping.pem | 656 | EXTRA_DIST += policy_root_cross_inhibit_mapping.pem |
| 657 | 657 | ||
| 658 | # pq_test | 658 | # pq_test |
| 659 | TESTS += pq_test.sh | 659 | TESTS += pq_test |
| 660 | check_PROGRAMS += pq_test | 660 | check_PROGRAMS += pq_test |
| 661 | pq_test_SOURCES = pq_test.c | 661 | pq_test_SOURCES = pq_test.c |
| 662 | EXTRA_DIST += pq_test.sh pq_test.bat | ||
| 663 | EXTRA_DIST += pq_expected.txt | ||
| 664 | 662 | ||
| 665 | # quictest | 663 | # quictest |
| 666 | TESTS += quictest.sh | 664 | TESTS += quictest.sh |
diff --git a/tests/pq_test.bat b/tests/pq_test.bat deleted file mode 100644 index 084f06d..0000000 --- a/tests/pq_test.bat +++ /dev/null | |||
| @@ -1,15 +0,0 @@ | |||
| 1 | @echo off | ||
| 2 | setlocal enabledelayedexpansion | ||
| 3 | REM pq_test.bat | ||
| 4 | |||
| 5 | set pq_test_bin=%1 | ||
| 6 | set pq_test_bin=%pq_test_bin:/=\% | ||
| 7 | if not exist %pq_test_bin% exit /b 1 | ||
| 8 | |||
| 9 | set pq_output=pq_output.txt | ||
| 10 | if exist %pq_output% del %pq_output% | ||
| 11 | |||
| 12 | %pq_test_bin% > %pq_output% | ||
| 13 | fc /b %pq_output% %srcdir%\pq_expected.txt | ||
| 14 | |||
| 15 | endlocal | ||
diff --git a/tests/pq_test.sh b/tests/pq_test.sh deleted file mode 100755 index eab6f3c..0000000 --- a/tests/pq_test.sh +++ /dev/null | |||
| @@ -1,9 +0,0 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | set -e | ||
| 3 | TEST=./pq_test | ||
| 4 | if [ -e ./pq_test.exe ]; then | ||
| 5 | TEST=./pq_test.exe | ||
| 6 | elif [ -e ./pq_test.js ]; then | ||
| 7 | TEST="node ./pq_test.js" | ||
| 8 | fi | ||
| 9 | $TEST | diff -b $srcdir/pq_expected.txt - | ||
| @@ -376,7 +376,6 @@ done | |||
| 376 | $CP $libssl_regress/unit/tests.h tests | 376 | $CP $libssl_regress/unit/tests.h tests |
| 377 | $CP $libssl_regress/certs/*.pem tests | 377 | $CP $libssl_regress/certs/*.pem tests |
| 378 | $CP $libssl_regress/certs/*.crl tests | 378 | $CP $libssl_regress/certs/*.crl tests |
| 379 | $CP $libssl_regress/pqueue/expected.txt tests/pq_expected.txt | ||
| 380 | 379 | ||
| 381 | # copy libtls tests | 380 | # copy libtls tests |
| 382 | for i in `find $libtls_regress -name '*.c'`; do | 381 | for i in `find $libtls_regress -name '*.c'`; do |
