Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address various issues with meson builds #385

Merged
merged 6 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/address-sanitizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:
name: Address sanitizer logs on ${{ matrix.name }}
path: |
builddir/meson-logs/
builddir/tests/*.log
builddir/tests/tmp.${{ matrix.token }}/p11prov-debug.log
builddir/tests/tmp.${{ matrix.token }}/testvars
builddir/tests/tmp.${{ matrix.token }}/openssl.cnf
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ jobs:
name: Test logs on macOS-12 with ${{ matrix.token }}
path: |
builddir/meson-logs/*
builddir/tests/*.log
builddir/tests/tmp.${{ matrix.token }}/p11prov-debug.log
builddir/tests/tmp.${{ matrix.token }}/testvars
builddir/tests/tmp.${{ matrix.token }}/openssl.cnf
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
.PHONY: all check check-style check-style-show check-style-fix clean generate-code generate-docs

all:
meson setup builddir
meson compile -C builddir
if [ ! -d "builddir" ]; then \
meson setup builddir; \
fi; \
simo5 marked this conversation as resolved.
Show resolved Hide resolved
meson compile -C builddir pkcs11

check:
meson test -C builddir
Expand Down
44 changes: 21 additions & 23 deletions tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,20 @@ if nss_softokn.found()
endif
endif

softoken_conf = custom_target(
'generate softoken configuration',
output: 'tmp.softokn.log',
env: conf_env,
command: [
find_program('setup-softokn.sh'),
],
capture: true,
)
test_setup = {
'setup_softokn': {'suite': 'softokn', 'exe': find_program('setup-softokn.sh')},
'setup_softhsm': {'suite': 'softhsm', 'exe': find_program('setup-softhsm.sh')},
}

softhsm_conf = custom_target(
'generate softhsm configuration',
output: 'tmp.softhsm.log',
env: conf_env,
command: [
find_program('setup-softhsm.sh'),
],
capture: true,
)
foreach name, targs : test_setup
test(
name,
targs.get('exe'),
simo5 marked this conversation as resolved.
Show resolved Hide resolved
suite: targs.get('suite'),
env: conf_env,
is_parallel: false,
)
endforeach

test_env = environment({
'TEST_PATH': meson.current_source_dir(),
Expand Down Expand Up @@ -109,10 +104,13 @@ test_programs = [
'pincache',
]

test_executables = []
foreach t : test_programs
executable(t, '@[email protected]'.format(t),
include_directories: [configinc],
dependencies: [libcrypto, libssl])
t = executable(t, '@[email protected]'.format(t),
build_by_default: false,
include_directories: [configinc],
dependencies: [libcrypto, libssl])
test_executables += [t]
endforeach

tests = {
Expand Down Expand Up @@ -148,9 +146,9 @@ foreach t, extra_args : tests
test_wrapper,
args: '@0@-@[email protected]'.format(t, suite),
suite: suite,
depends: [softoken_conf, softhsm_conf],
env: test_env,
is_parallel: is_parallel,
depends: test_executables,
is_parallel: false,
)
endforeach
endforeach
7 changes: 6 additions & 1 deletion tests/test-wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,10 @@ for option in "${TEST_PARAMS[@]}"; do
fi
done

LOGFILE="${TESTBLDDIR}/${TEST_NAME}.${TOKEN_DRIVER}.log"

echo "Executing ${COMMAND}"
${COMMAND}
(
set -o pipefail
${COMMAND} | tee "${LOGFILE}"
)
Loading