summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2012-11-29 11:04:53 +0100
committerMartin Jansa <Martin.Jansa@gmail.com>2015-12-10 13:35:24 +0100
commitf16dca081b84ba5daec7a7a073f819f7ba21dcbb (patch)
treeed94d29aa95bad3e81b63474d151c2c320074f81
parent192da885e92d3b163b9c4e6b8151c9ecc6062b14 (diff)
downloadopenembedded-core-contrib-f16dca081b84ba5daec7a7a073f819f7ba21dcbb.tar.gz
openembedded-core-contrib-f16dca081b84ba5daec7a7a073f819f7ba21dcbb.tar.bz2
openembedded-core-contrib-f16dca081b84ba5daec7a7a073f819f7ba21dcbb.zip
scripts/tune/test.sh: add test script used to test MACHINE/DEFAULTUNE combinations
* add fake machine configs to test changed tune-* files * add script which will walk through all fake machines and all their available tunes and run bitbake -e Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rwxr-xr-xscripts/tune/test.sh52
1 files changed, 52 insertions, 0 deletions
diff --git a/scripts/tune/test.sh b/scripts/tune/test.sh
new file mode 100755
index 0000000000..b1fbbe79be
--- /dev/null
+++ b/scripts/tune/test.sh
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+# for each tune file generates list of available tunes
+# then for each combination of machine and tune lists PACKAGE_ARCHS, CC, TUNE_CCARGS*, TUNE_PKGARCH
+
+# To have the same sorting rules
+export LC_ALL=C
+
+TUNE_TEST_DIR=`dirname $0`
+
+INCLUDES_TO_TEST=`find openembedded-core/meta/conf/machine/include/ -name tune-\*.inc | sort | sed 's%openembedded-core/meta/%%g'`
+INCLUDES=`echo "${INCLUDES_TO_TEST}" | wc -l`
+INCLUDE=0
+
+for I in ${INCLUDES_TO_TEST}; do
+ M=`basename ${I} | sed 's/\.inc//g; s/^tune-/fake-/g'`
+ INCLUDE=`expr ${INCLUDE} + 1`
+ echo "Testing fake MACHINE ${M} for include ${I} (${INCLUDE}/${INCLUDES})"
+ echo "require ${I}" > openembedded-core/meta/conf/machine/${M}.conf
+ MACHINE=${M} bitbake -e openssl > ${TUNE_TEST_DIR}/log.${M} 2>&1
+ grep "\(^export CC=\)\|\(^TUNE_CCARGS\)\|\(^TUNE_FEATURES=\)\|\(^PACKAGE_ARCHS=\)\|\(^TUNE_PKGARCH=\)\|\(^AVAILTUNES=\)" \
+ ${TUNE_TEST_DIR}/log.${M} | sort |\
+ sed "s#--sysroot=[^ \"]*/${M}#--sysroot=SYSROOTS/${M}#g" \
+ > ${TUNE_TEST_DIR}/env.${M}
+ if [ `cat ${TUNE_TEST_DIR}/env.${M} | wc -l` -lt 6 ] ; then
+ echo "ERROR: something wrong in ${TUNE_TEST_DIR}/log.${M}"
+ rm -f ${TUNE_TEST_DIR}/env.${M}
+ continue
+ else
+ rm -f ${TUNE_TEST_DIR}/log.${M}
+ fi
+ AVAILTUNES=`grep '^AVAILTUNES=' ${TUNE_TEST_DIR}/env.${M} | sed 's/^[^"]*"\([^"]*\)"/\1/g' | tr ' ' '\n'`;
+ TUNES=`echo "${AVAILTUNES}" | wc -l`
+ TUNE=0
+ for T in ${AVAILTUNES}; do
+ TUNE=`expr ${TUNE} + 1`
+ echo "Testing DEFAULTTUNE ${T} (${TUNE}/${TUNES}) for fake MACHINE ${M} (${INCLUDE}/${INCLUDES})"
+ echo "DEFAULTTUNE = \"${T}\"" >> openembedded-core/meta/conf/machine/${M}.conf;
+ MACHINE=${M} bitbake -e openssl > ${TUNE_TEST_DIR}/log.${M}.${T} 2>&1
+ grep "\(^export CC=\)\|\(^TUNE_CCARGS\)\|\(^TUNE_FEATURES=\)\|\(^PACKAGE_ARCHS=\)\|\(^TUNE_PKGARCH=\)" \
+ ${TUNE_TEST_DIR}/log.${M}.${T} | sort |\
+ sed "s#--sysroot=[^ \"]*/${M}#--sysroot=SYSROOTS/${M}#g" \
+ > ${TUNE_TEST_DIR}/env.${M}.${T}
+ if [ `cat ${TUNE_TEST_DIR}/env.${M}.${T} | wc -l` -lt 5 ] ; then
+ echo "ERROR: something wrong in ${TUNE_TEST_DIR}/log.${M}.${T}"
+ rm -f ${TUNE_TEST_DIR}/env.${M}.${T}
+ continue
+ else
+ rm -f ${TUNE_TEST_DIR}/log.${M}.${T}
+ fi
+ done
+done