diff options
author | Theo Buehler <tb@openbsd.org> | 2024-05-25 20:10:43 +0200 |
---|---|---|
committer | Theo Buehler <tb@openbsd.org> | 2024-05-25 21:32:38 +0200 |
commit | 7f39dda15a1232ae253680c07a17a0845c365ef1 (patch) | |
tree | c3aaf696eda652f18751287b3fa4acdc65a030d1 /tests | |
parent | f9874d49f651177d643cc86f8837db44c4a29558 (diff) | |
download | portable-7f39dda15a1232ae253680c07a17a0845c365ef1.tar.gz portable-7f39dda15a1232ae253680c07a17a0845c365ef1.tar.bz2 portable-7f39dda15a1232ae253680c07a17a0845c365ef1.zip |
Clean up the time_t test mess
The RFC 5280 test now passes also with small time_t. The ASN.1 time
test now has a test case that makes it fail for small time t. In that
case use a wrapper script that prins why the test is expected to fail
and makes the test suite fail if it passes.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CMakeLists.txt | 9 | ||||
-rw-r--r-- | tests/Makefile.am | 14 | ||||
-rwxr-xr-x | tests/asn1time_small.test | 10 | ||||
-rwxr-xr-x | tests/rfc5280time_small.test | 10 |
4 files changed, 22 insertions, 21 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 6861bd3..3497cb5 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt | |||
@@ -101,6 +101,9 @@ add_test(asn1test asn1test) | |||
101 | add_executable(asn1time asn1time.c) | 101 | add_executable(asn1time asn1time.c) |
102 | target_link_libraries(asn1time ${OPENSSL_TEST_LIBS}) | 102 | target_link_libraries(asn1time ${OPENSSL_TEST_LIBS}) |
103 | add_test(asn1time asn1time) | 103 | add_test(asn1time asn1time) |
104 | if(SMALL_TIME_T) | ||
105 | set_property(TEST asn1time PROPERTY WILL_FAIL TRUE) | ||
106 | endif() | ||
104 | 107 | ||
105 | # asn1x509 | 108 | # asn1x509 |
106 | add_executable(asn1x509 asn1x509.c) | 109 | add_executable(asn1x509 asn1x509.c) |
@@ -584,11 +587,7 @@ add_test(rfc3779 rfc3779) | |||
584 | # rfc5280time | 587 | # rfc5280time |
585 | add_executable(rfc5280time rfc5280time.c) | 588 | add_executable(rfc5280time rfc5280time.c) |
586 | target_link_libraries(rfc5280time ${OPENSSL_TEST_LIBS}) | 589 | target_link_libraries(rfc5280time ${OPENSSL_TEST_LIBS}) |
587 | if(SMALL_TIME_T) | 590 | add_test(rfc5280time rfc5280time) |
588 | add_test(rfc5280time ${CMAKE_CURRENT_SOURCE_DIR}/rfc5280time_small.test) | ||
589 | else() | ||
590 | add_test(rfc5280time rfc5280time) | ||
591 | endif() | ||
592 | 591 | ||
593 | # rmd_test | 592 | # rmd_test |
594 | add_executable(rmd_test rmd_test.c) | 593 | add_executable(rmd_test rmd_test.c) |
diff --git a/tests/Makefile.am b/tests/Makefile.am index 57e2acf..0e19106 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am | |||
@@ -32,6 +32,7 @@ LDADD = libtest.la $(PLATFORM_LDADD) $(PROG_LDADD) | |||
32 | TEST_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh | 32 | TEST_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh |
33 | 33 | ||
34 | TESTS = | 34 | TESTS = |
35 | XFAIL_TESTS = | ||
35 | check_PROGRAMS = | 36 | check_PROGRAMS = |
36 | EXTRA_DIST = CMakeLists.txt | 37 | EXTRA_DIST = CMakeLists.txt |
37 | DISTCLEANFILES = pidwraptest.txt | 38 | DISTCLEANFILES = pidwraptest.txt |
@@ -119,9 +120,15 @@ check_PROGRAMS += asn1test | |||
119 | asn1test_SOURCES = asn1test.c | 120 | asn1test_SOURCES = asn1test.c |
120 | 121 | ||
121 | # asn1time | 122 | # asn1time |
122 | TESTS += asn1time | ||
123 | check_PROGRAMS += asn1time | 123 | check_PROGRAMS += asn1time |
124 | asn1time_SOURCES = asn1time.c | 124 | asn1time_SOURCES = asn1time.c |
125 | if SMALL_TIME_T | ||
126 | TESTS += asn1time_small.test | ||
127 | XFAIL_TESTS += asn1time_small.test | ||
128 | else | ||
129 | TESTS += asn1time | ||
130 | endif | ||
131 | EXTRA_DIST += asn1time_small.test | ||
125 | 132 | ||
126 | # asn1x509 | 133 | # asn1x509 |
127 | TESTS += asn1x509 | 134 | TESTS += asn1x509 |
@@ -617,12 +624,7 @@ rfc3779_SOURCES = rfc3779.c | |||
617 | # rfc5280time | 624 | # rfc5280time |
618 | check_PROGRAMS += rfc5280time | 625 | check_PROGRAMS += rfc5280time |
619 | rfc5280time_SOURCES = rfc5280time.c | 626 | rfc5280time_SOURCES = rfc5280time.c |
620 | if SMALL_TIME_T | ||
621 | TESTS += rfc5280time_small.test | ||
622 | else | ||
623 | TESTS += rfc5280time | 627 | TESTS += rfc5280time |
624 | endif | ||
625 | EXTRA_DIST += rfc5280time_small.test | ||
626 | 628 | ||
627 | # rmd_test | 629 | # rmd_test |
628 | TESTS += rmd_test | 630 | TESTS += rmd_test |
diff --git a/tests/asn1time_small.test b/tests/asn1time_small.test new file mode 100755 index 0000000..94fbebf --- /dev/null +++ b/tests/asn1time_small.test | |||
@@ -0,0 +1,10 @@ | |||
1 | #!/bin/sh | ||
2 | echo 1..1 | ||
3 | TEST=./asn1time | ||
4 | if [ -e ./asn1time.exe ]; then | ||
5 | TEST=./asn1time.exe | ||
6 | fi | ||
7 | |||
8 | # map test failure to XFAIL and success to XPASS | ||
9 | $TEST || echo -n "not " | ||
10 | echo "ok # this system is unable to represent times past 2038" | ||
diff --git a/tests/rfc5280time_small.test b/tests/rfc5280time_small.test deleted file mode 100755 index 3730597..0000000 --- a/tests/rfc5280time_small.test +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | set -e | ||
3 | echo 1..2 | ||
4 | TEST=./rfc5280time | ||
5 | if [ -e ./rfc5280time.exe ]; then | ||
6 | TEST=./rfc5280time.exe | ||
7 | fi | ||
8 | $TEST | ||
9 | echo "ok 1" | ||
10 | echo "ok 2 - rfc5280time_64-bit # SKIP this system is unable to represent times past 2038" | ||