Skip to content

Commit

Permalink
build: Move test-init.sh from trust to common
Browse files Browse the repository at this point in the history
Signed-off-by: Daiki Ueno <[email protected]>
  • Loading branch information
ueno authored and ZoltanFridrich committed Sep 15, 2023
1 parent 70b7ee8 commit ef2e9fd
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 5 deletions.
17 changes: 17 additions & 0 deletions common/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,23 @@ libp11_tool_dep = declare_dependency(link_with: libp11_tool,
# Tests ----------------------------------------------------------------

if get_option('test')
test_init_conf = configuration_data()
test_init_conf.set_quoted('prefix', prefix)
test_init_conf.set_quoted('exec_prefix', prefix)
test_init_conf.set_quoted('datarootdir', prefix / datadir)
test_init_conf.set_quoted('datadir', prefix / datadir)
test_init_conf.set_quoted('sysconfdir', prefix / sysconfdir)
test_init_conf.set_quoted('libdir', prefix / libdir)
test_init_conf.set_quoted('libexecdir', prefix / libexecdir)
test_init_conf.set_quoted('privatedir', prefix / privatedir)
test_init_conf.set_quoted('with_trust_paths', trust_paths)

configure_file(
input: 'test-init.sh.in',
output: 'test-init.sh',
configuration: test_init_conf,
)

common_tests = [
'test-tests',
'test-compat',
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -684,12 +684,12 @@ AM_CONDITIONAL(WITH_BASH_COMPLETION, [test "$with_bash_completion" = "yes"])


AC_CONFIG_FILES([Makefile
common/test-init.sh
doc/Makefile
doc/manual/Makefile
po/Makefile.in
p11-kit/p11-kit-1.pc
p11-kit/pkcs11.conf.example
trust/test-init.sh
])
AC_OUTPUT

Expand Down
4 changes: 2 additions & 2 deletions trust/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,8 @@ noinst_SCRIPTS += trust/test-extract.sh trust/test-trust.sh

if !OS_WIN32
installcheck-local:
builddir="$(abs_top_builddir)/trust" $(SHELL) $(srcdir)/trust/test-extract.sh
builddir="$(abs_top_builddir)/trust" $(SHELL) $(srcdir)/trust/test-trust.sh
abs_top_builddir="$(abs_top_builddir)" $(SHELL) $(srcdir)/trust/test-extract.sh
abs_top_builddir="$(abs_top_builddir)" $(SHELL) $(srcdir)/trust/test-trust.sh
endif

EXTRA_DIST += \
Expand Down
7 changes: 6 additions & 1 deletion trust/test-extract.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/sh

. "${builddir=.}/test-init.sh"
test "${abs_top_builddir+set}" = set || {
echo "set abs_top_builddir" 1>&2
exit 1
}

. "$abs_top_builddir/common/test-init.sh"
: ${DD=dd}

teardown()
Expand Down
7 changes: 6 additions & 1 deletion trust/test-trust.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/sh

. "${builddir=.}/test-init.sh"
test "${abs_top_builddir+set}" = set || {
echo "set abs_top_builddir" 1>&2
exit 1
}

. "$abs_top_builddir/common/test-init.sh"

test_disable_in_proxy()
{
Expand Down

0 comments on commit ef2e9fd

Please sign in to comment.