diff options
Diffstat (limited to '')
| -rw-r--r-- | src/regress/lib/libssl/openssl-ruby/Makefile | 72 |
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 | |||
| 3 | OPENSSL_RUBY_TESTS = /usr/local/share/openssl-ruby-tests | ||
| 4 | RUBY_BINREV = 27 | ||
| 5 | RUBY = 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. | ||
| 10 | BUILDDIR = build | ||
| 11 | |||
| 12 | .if !exists(${OPENSSL_RUBY_TESTS}) | ||
| 13 | regress: | ||
| 14 | @echo package openssl-ruby-tests is required for this regress | ||
| 15 | @echo SKIPPED | ||
| 16 | .else | ||
| 17 | |||
| 18 | REGRESS_TARGETS += openssl-ruby-test | ||
| 19 | REGRESS_EXPECTED_FAILURES += openssl-ruby-test | ||
| 20 | |||
| 21 | openssl-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 | |||
| 37 | OPENSSL_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 | |||
| 46 | build: ${_BUILD_COOKIE} | ||
| 47 | test: ${_TEST_COOKIE} | ||
| 48 | |||
| 49 | _MAKE = cd ${.CURDIR} && exec ${.MAKE} | ||
| 50 | |||
| 51 | rebuild: | ||
| 52 | rm -f ${_BUILD_COOKIE} | ||
| 53 | ${_MAKE} build | ||
| 54 | |||
| 55 | retest: | ||
| 56 | rm -f ${_TEST_COOKIE} | ||
| 57 | ${_MAKE} test | ||
| 58 | |||
| 59 | CLEANFILES += ${_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> | ||
