summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2008-01-02 01:01:18 +0000
committerMike Frysinger <vapier@gentoo.org>2008-01-02 01:01:18 +0000
commit5e6f40482c3609d9940619d490bd6e20580b6ef0 (patch)
treef027b708ea21a25bee97d276b9b8aed92f965cd4 /eclass
parenthandle linux-2.6.24+ where {i386,x86_64}=>{x86} (diff)
downloadhistorical-5e6f40482c3609d9940619d490bd6e20580b6ef0.tar.gz
historical-5e6f40482c3609d9940619d490bd6e20580b6ef0.tar.bz2
historical-5e6f40482c3609d9940619d490bd6e20580b6ef0.zip
eclass tests
Diffstat (limited to 'eclass')
-rw-r--r--eclass/tests/tests-common.sh10
-rwxr-xr-xeclass/tests/toolchain-funcs.sh56
2 files changed, 66 insertions, 0 deletions
diff --git a/eclass/tests/tests-common.sh b/eclass/tests/tests-common.sh
new file mode 100644
index 000000000000..8cd7d508b526
--- /dev/null
+++ b/eclass/tests/tests-common.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+source /etc/init.d/functions.sh
+
+inherit() {
+ local e
+ for e in "$@" ; do
+ source ../${e}.eclass
+ done
+}
diff --git a/eclass/tests/toolchain-funcs.sh b/eclass/tests/toolchain-funcs.sh
new file mode 100755
index 000000000000..83b8356e54e3
--- /dev/null
+++ b/eclass/tests/toolchain-funcs.sh
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+source tests-common.sh
+
+inherit toolchain-funcs
+
+#
+# TEST: tc-arch-kernel
+#
+test-tc-arch-kernel() {
+ local ret=0
+ KV=$1 ; shift
+ for CHOST in "$@" ; do
+ exp=${CHOST##*:}
+ CHOST=${CHOST%%:*}
+ actual=$(tc-arch-kernel)
+
+ if [[ ${actual} != ${exp:-${CHOST}} ]] ; then
+ eerror "Failure for CHOST: ${CHOST} Expected: ${exp} != Actual: ${actual}"
+ ((++ret))
+ fi
+ done
+ return ${ret}
+}
+ebegin "Testing tc-arch-kernel() (KV=2.6.0)"
+test-tc-arch-kernel 2.6.0 \
+ alpha arm{,eb}:arm avr32 bfin:blackfin cris hppa:parisc \
+ i{3..6}86:i386 ia64 m68k mips{,eb}:mips nios2 powerpc:ppc powerpc64:ppc64 \
+ s390{,x}:s390 sh{1..4}{,eb}:sh sparc{,64} vax x86_64
+eend $?
+ebegin "Testing tc-arch-kernel() (KV=2.6.30)"
+test-tc-arch-kernel 2.6.30 \
+ i{3..6}86:x86 x86_64:x86 \
+ powerpc{,64}:powerpc
+eend $?
+
+#
+# TEST: tc-arch
+#
+ebegin "Testing tc-arch"
+ret=0
+for CHOST in \
+ alpha arm{,eb}:arm avr32:avr bfin cris hppa i{3..6}86:x86 ia64 m68k \
+ mips{,eb}:mips nios2 powerpc:ppc powerpc64:ppc64 s390{,x}:s390 \
+ sh{1..4}{,eb}:sh sparc{,64}:sparc vax x86_64:amd64
+do
+ exp=${CHOST##*:}
+ CHOST=${CHOST%%:*}
+ actual=$(tc-arch)
+
+ if [[ ${actual} != ${exp:-${CHOST}} ]] ; then
+ eerror "Failure for CHOST: ${CHOST} Expected: ${exp} != Actual: ${actual}"
+ ((++ret))
+ fi
+done
+eend ${ret}