summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2021-05-03 18:21:00 +0000
committertb <>2021-05-03 18:21:00 +0000
commitfdf7e8b32db418930dcd62094f5310f1a0d24a72 (patch)
tree166e5755faf97abb09bcdce90071cb2d803d247c /src
parent9223b27a469fb86bb6f496d2ab36f8a6674fd10e (diff)
downloadopenbsd-fdf7e8b32db418930dcd62094f5310f1a0d24a72.tar.gz
openbsd-fdf7e8b32db418930dcd62094f5310f1a0d24a72.tar.bz2
openbsd-fdf7e8b32db418930dcd62094f5310f1a0d24a72.zip
Add scaffold to run the ruby/openssl regression tests
This test depends on the ruby/ruby-openssl-tests port that bundles the sources and tests of the Ruby OpenSSL gem below /usr/local. The Makefile compiles the openssl.so shared object below obj/ that provides Ruby bindings for the OpenSSL API. Once this is built, the regression tests are run. There are currently 4 failing tests, all related to the new verifier. At least one libssl bug is hidden behind a pend. All this will hopefully be fixed during this release cycle. This adds a decent amount of test coverage without being overly expensive. This way, regressions should be spotted during development so jeremy will no longer have to chase and work around them. Joint work with jeremy, positive feedback from bcook and jsing.
Diffstat (limited to 'src')
-rw-r--r--src/regress/lib/libssl/openssl-ruby/Makefile72
1 files changed, 72 insertions, 0 deletions
diff --git a/src/regress/lib/libssl/openssl-ruby/Makefile b/src/regress/lib/libssl/openssl-ruby/Makefile
new file mode 100644
index 0000000000..7a897157d1
--- /dev/null
+++ b/src/regress/lib/libssl/openssl-ruby/Makefile
@@ -0,0 +1,72 @@
1# $OpenBSD: Makefile,v 1.1 2021/05/03 18:21:00 tb Exp $
2
3OPENSSL_RUBY_TESTS = /usr/local/share/openssl-ruby-tests
4RUBY_BINREV = 27
5RUBY = ruby${RUBY_BINREV}
6
7# We work in a subdirectory of obj/ since extconf.rb generates a Makefile whose
8# name can't be customized in $PWD. An obj/Makefile in turn confuses either make
9# or bsd.*.mk. This hurts when things are in an unexpected state after a signal.
10BUILDDIR = build
11
12.if !exists(${OPENSSL_RUBY_TESTS})
13regress:
14 @echo package openssl-ruby-tests is required for this regress
15 @echo SKIPPED
16.else
17
18REGRESS_TARGETS += openssl-ruby-test
19REGRESS_EXPECTED_FAILURES += openssl-ruby-test
20
21openssl-ruby-test: retest
22
23_BUILDDIR_COOKIE = .builddir
24_BUILD_COOKIE = .build
25_TEST_COOKIE = .test
26
27${_BUILDDIR_COOKIE}:
28 mkdir -p ${BUILDDIR}
29 touch $@
30
31${_BUILD_COOKIE}: ${_BUILDDIR_COOKIE}
32 cd ${BUILDDIR} && \
33 ${RUBY} ${OPENSSL_RUBY_TESTS}/ext/openssl/extconf.rb && \
34 make;
35 touch $@
36
37OPENSSL_RUBY_TESTSRC = ${OPENSSL_RUBY_TESTS}/test/openssl/test_*.rb
38${_TEST_COOKIE}: ${_BUILD_COOKIE} ${_BUILDDIR_COOKIE}
39 cd ${BUILDDIR} && \
40 ${RUBY} -I. -I${OPENSSL_RUBY_TESTS}/test/openssl \
41 -I${OPENSSL_RUBY_TESTS}/lib \
42 -e 'Dir["${OPENSSL_RUBY_TESTSRC}"].each{|f| require f}' \
43 -- --no-use-color --no-show-detail-immediately
44 touch $@
45
46build: ${_BUILD_COOKIE}
47test: ${_TEST_COOKIE}
48
49_MAKE = cd ${.CURDIR} && exec ${.MAKE}
50
51rebuild:
52 rm -f ${_BUILD_COOKIE}
53 ${_MAKE} build
54
55retest:
56 rm -f ${_TEST_COOKIE}
57 ${_MAKE} test
58
59CLEANFILES += ${_BUILD_COOKIE} ${_TEST_COOKIE} ${_BUILDDIR_COOKIE}
60
61. if make(clean) || make(cleandir)
62. if exists(${BUILDDIR})
63.BEGIN:
64 rm -r ${BUILDDIR}
65. endif
66. endif
67
68.PHONY: build rebuild test retest
69
70.endif
71
72.include <bsd.regress.mk>