aboutsummaryrefslogtreecommitdiff
path: root/ax_add_guile_test_env.m4
blob: 722f915bf12fa966a727364b0b46202c4eeca831 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
dnl SPDX-License-Identifier: CC0-1.0
dnl
dnl Copyright (C) 2023, 2025 Wojtek Kosior <koszko@koszko.org>
dnl
dnl This file proviced an autoconf macro that generates a test-env script
dnl suitable for use in Guile projects.
dnl
# AX_ADD_GUILE_TEST_ENV([FILENAME = test-env],
#                       [PRE_INST_ENV_PATH = pre-inst-env],
#                       [TEST_SCM_ROOT_PATH = tests/guile],
#                       [TEST_GO_ROOT_PATH = tests/guile])
# ------------------------------------------------------------------------------
AC_DEFUN([AX_ADD_GUILE_TEST_ENV], [
printf '%s' '
set -eu

BUILD_DIR="$(cd "$(dirname "[$]0")" && pwd -P)"

export LAWRENCE_TEST_SCM_ROOT='m4_default([$3], [tests/guile])'
export LAWRENCE_TEST_GO_ROOT='m4_default([$4], [tests/guile])'

$BUILD_DIR/'m4_default([$2], [pre-inst-env])' "[$]@"
' > m4_default([$1], [test-env])

chmod 755 m4_default([$1], [test-env])
])dnl AX_ADD_GUILE_TEST_ENV