~emersion/mrsh

ca14ccf6f07bfe528e3c2436e720063cbcdafafd — Simon Ser 8 months ago d770b82
meson: add build option for reference shell
3 files changed, 10 insertions(+), 3 deletions(-)

M meson_options.txt
M test/harness.sh
M test/meson.build
M meson_options.txt => meson_options.txt +7 -0
@@ 19,3 19,10 @@ option(
	value: true,
	description: 'Build example programs',
)

option(
	'reference-shell',
	type: 'string',
	value: 'sh',
	description: 'Reference shell used in tests',
)

M test/harness.sh => test/harness.sh +2 -2
@@ 5,7 5,7 @@ testcase="$1"
echo "Running with mrsh"
mrsh_out=$("$MRSH" "$testcase")
mrsh_ret=$?
echo "Running with reference shell"
echo "Running with reference shell ($REF_SH)"
ref_out=$("$REF_SH" "$testcase")
ref_ret=$?
if [ $mrsh_ret -ne $ref_ret ] || [ "$mrsh_out" != "$ref_out" ]


@@ 15,7 15,7 @@ then
	echo >&2 "mrsh: $mrsh_ret"
	echo >&2 "$mrsh_out"
	echo >&2 ""
	echo >&2 "ref: $ref_ret"
	echo >&2 "ref ($REF_SH): $ref_ret"
	echo >&2 "$ref_out"
	echo >&2 ""
	exit 1

M test/meson.build => test/meson.build +1 -1
@@ 1,5 1,5 @@
harness = find_program('./harness.sh')
ref_sh = find_program('sh', required: false)
ref_sh = find_program(get_option('reference-shell'), required: false)

test_files = [
	'conformance/if.sh',