aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTheo Buehler <tb@openbsd.org>2024-05-25 20:10:43 +0200
committerTheo Buehler <tb@openbsd.org>2024-05-25 21:32:38 +0200
commit7f39dda15a1232ae253680c07a17a0845c365ef1 (patch)
treec3aaf696eda652f18751287b3fa4acdc65a030d1 /tests
parentf9874d49f651177d643cc86f8837db44c4a29558 (diff)
downloadportable-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.txt9
-rw-r--r--tests/Makefile.am14
-rwxr-xr-xtests/asn1time_small.test10
-rwxr-xr-xtests/rfc5280time_small.test10
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)
101add_executable(asn1time asn1time.c) 101add_executable(asn1time asn1time.c)
102target_link_libraries(asn1time ${OPENSSL_TEST_LIBS}) 102target_link_libraries(asn1time ${OPENSSL_TEST_LIBS})
103add_test(asn1time asn1time) 103add_test(asn1time asn1time)
104if(SMALL_TIME_T)
105 set_property(TEST asn1time PROPERTY WILL_FAIL TRUE)
106endif()
104 107
105# asn1x509 108# asn1x509
106add_executable(asn1x509 asn1x509.c) 109add_executable(asn1x509 asn1x509.c)
@@ -584,11 +587,7 @@ add_test(rfc3779 rfc3779)
584# rfc5280time 587# rfc5280time
585add_executable(rfc5280time rfc5280time.c) 588add_executable(rfc5280time rfc5280time.c)
586target_link_libraries(rfc5280time ${OPENSSL_TEST_LIBS}) 589target_link_libraries(rfc5280time ${OPENSSL_TEST_LIBS})
587if(SMALL_TIME_T) 590add_test(rfc5280time rfc5280time)
588 add_test(rfc5280time ${CMAKE_CURRENT_SOURCE_DIR}/rfc5280time_small.test)
589else()
590 add_test(rfc5280time rfc5280time)
591endif()
592 591
593# rmd_test 592# rmd_test
594add_executable(rmd_test rmd_test.c) 593add_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)
32TEST_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh 32TEST_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh
33 33
34TESTS = 34TESTS =
35XFAIL_TESTS =
35check_PROGRAMS = 36check_PROGRAMS =
36EXTRA_DIST = CMakeLists.txt 37EXTRA_DIST = CMakeLists.txt
37DISTCLEANFILES = pidwraptest.txt 38DISTCLEANFILES = pidwraptest.txt
@@ -119,9 +120,15 @@ check_PROGRAMS += asn1test
119asn1test_SOURCES = asn1test.c 120asn1test_SOURCES = asn1test.c
120 121
121# asn1time 122# asn1time
122TESTS += asn1time
123check_PROGRAMS += asn1time 123check_PROGRAMS += asn1time
124asn1time_SOURCES = asn1time.c 124asn1time_SOURCES = asn1time.c
125if SMALL_TIME_T
126TESTS += asn1time_small.test
127XFAIL_TESTS += asn1time_small.test
128else
129TESTS += asn1time
130endif
131EXTRA_DIST += asn1time_small.test
125 132
126# asn1x509 133# asn1x509
127TESTS += asn1x509 134TESTS += asn1x509
@@ -617,12 +624,7 @@ rfc3779_SOURCES = rfc3779.c
617# rfc5280time 624# rfc5280time
618check_PROGRAMS += rfc5280time 625check_PROGRAMS += rfc5280time
619rfc5280time_SOURCES = rfc5280time.c 626rfc5280time_SOURCES = rfc5280time.c
620if SMALL_TIME_T
621TESTS += rfc5280time_small.test
622else
623TESTS += rfc5280time 627TESTS += rfc5280time
624endif
625EXTRA_DIST += rfc5280time_small.test
626 628
627# rmd_test 629# rmd_test
628TESTS += rmd_test 630TESTS += 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
2echo 1..1
3TEST=./asn1time
4if [ -e ./asn1time.exe ]; then
5 TEST=./asn1time.exe
6fi
7
8# map test failure to XFAIL and success to XPASS
9$TEST || echo -n "not "
10echo "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
2set -e
3echo 1..2
4TEST=./rfc5280time
5if [ -e ./rfc5280time.exe ]; then
6 TEST=./rfc5280time.exe
7fi
8$TEST
9echo "ok 1"
10echo "ok 2 - rfc5280time_64-bit # SKIP this system is unable to represent times past 2038"