diff options
author | 2011-12-15 05:23:15 +0000 | |
---|---|---|
committer | 2011-12-15 05:23:15 +0000 | |
commit | 73e6cf7e9baa64477cde7885a2bde378fa85772d (patch) | |
tree | 84ee1dafc48abcd1bab26d500aabdc2bcad16746 /eclass/tests | |
parent | relocate tests to tests/ subdir (diff) | |
download | historical-73e6cf7e9baa64477cde7885a2bde378fa85772d.tar.gz historical-73e6cf7e9baa64477cde7885a2bde378fa85772d.tar.bz2 historical-73e6cf7e9baa64477cde7885a2bde378fa85772d.zip |
relocate tests to tests/ subdir
Diffstat (limited to 'eclass/tests')
-rwxr-xr-x | eclass/tests/flag-o-matic.sh | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/eclass/tests/flag-o-matic.sh b/eclass/tests/flag-o-matic.sh new file mode 100755 index 000000000000..357741771bf5 --- /dev/null +++ b/eclass/tests/flag-o-matic.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +source tests-common.sh + +inherit flag-o-matic + +CFLAGS="-a -b -c=1" +CXXFLAGS="-x -y -z=2" +LDFLAGS="-l -m -n=3" + +tbegin "is-flag" +! (is-flag 1 2 3) 2>/dev/null +tend $? + +tbegin "is-ldflag" +! (is-ldflag 1 2 3) 2>/dev/null +tend $? + +while read exp flag ; do + [[ -z ${exp}${flag} ]] && continue + + tbegin "is-flagq ${flag}" + is-flagq ${flag} + [[ ${exp} -eq $? ]] + tend $? "CFLAGS=${CFLAGS}" +done <<<" + 1 -l + 0 -a + 0 -x +" + +while read exp flag ; do + [[ -z ${exp}${flag} ]] && continue + + tbegin "is-ldflagq ${flag}" + is-ldflagq "${flag}" + [[ ${exp} -eq $? ]] + tend $? "LDFLAGS=${LDFLAGS}" +done <<<" + 1 -a + 0 -n=* + 1 -n +" + +tbegin "strip-unsupported-flags" +strip-unsupported-flags +[[ ${CFLAGS} == "" ]] && [[ ${CXXFLAGS} == "-z=2" ]] +tend $? "CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS}" + +texit |