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
commitadce76407c11e590bd7b90a85ab9f861af068268 (patch)
tree166e5755faf97abb09bcdce90071cb2d803d247c /src
parent05cbd644600c749902fa17e1bdbfa1c1203a6823 (diff)
downloadopenbsd-adce76407c11e590bd7b90a85ab9f861af068268.tar.gz
openbsd-adce76407c11e590bd7b90a85ab9f861af068268.tar.bz2
openbsd-adce76407c11e590bd7b90a85ab9f861af068268.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>