You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-full-overlay/eclass/tests/autotools_eaclocal_amflags.sh

34 lines
781 B

#!/bin/bash
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
source tests-common.sh || exit
EAPI=7
inherit autotools
test-it() {
tbegin "eaclocal_amflags $1: $2"
printf "ACLOCAL_AMFLAGS = %b\n" "$2" > Makefile.am
local flags=$(eaclocal_amflags) exp=${3:-$2}
[[ "${flags}" == "${exp}" ]]
if ! tend $? ; then
printf '### INPUT:\n%s\n' "$2"
printf '### FILE:\n%s\n' "$(<Makefile.am)"
printf '### EXPECTED:\n%s\n' "${exp}"
printf '### ACTUAL:\n%s\n' "${flags}"
fi
rm Makefile.am
}
test-it simple "-Im4"
test-it simple "-I m4 -I lakdjfladsfj /////"
test-it shell-exec '`echo hi`' "hi"
test-it shell-exec '`echo {0..3}`' "0 1 2 3"
test-it multiline '-I oneline \\\n\t-I twoline' "-I oneline -I twoline"
texit