summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2011-12-16 14:33:36 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-12-19 09:29:17 +0000
commit2480cc6a169f7d34d82d9e22c52f700e772ab45d (patch)
treee1774f906ccc98bde4cf7e2b374b7ac7d2c46aa1 /meta/recipes-devtools
parent6082313b5547a3734a095f66eb930bd890867224 (diff)
downloadpoky-2480cc6a169f7d34d82d9e22c52f700e772ab45d.tar.gz
gcc-cross: Add cross testing driver for running regression testsuites
This script will be generated into the build directory of gcc-cross It should be testing gcc and g++. libstdc++ tests are not run since we build them as part of gcc-runtime but we can test them here by building them with 'make all' and then running the tests The script expects passwordless ssh access to target and is used in form ./arm-oe-linux-gnueabi-testgcc kraj@192.168.7.2 inside the builddir of gcc-cross (From OE-Core rev: 130b534fdb0b292158981a12d7d5f01c1a14cb2a) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/gcc/gcc-cross.inc91
1 files changed, 90 insertions, 1 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc
index 5a796bcde6..0b31a8c8a3 100644
--- a/meta/recipes-devtools/gcc/gcc-cross.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross.inc
@@ -8,5 +8,94 @@ require gcc-package-cross.inc
8 8
9do_compile () { 9do_compile () {
10 oe_runmake all-host all-target-libgcc 10 oe_runmake all-host all-target-libgcc
11} 11 # now generate script to drive testing
12 echo "#!/usr/bin/env sh" >${B}/${TARGET_PREFIX}testgcc
13 set >> ${B}/${TARGET_PREFIX}testgcc
14 # prune out the unneeded vars
15 sed -i -e "/^BASH/d" ${B}/${TARGET_PREFIX}testgcc
16 sed -i -e "/^USER/d" ${B}/${TARGET_PREFIX}testgcc
17 sed -i -e "/^OPT/d" ${B}/${TARGET_PREFIX}testgcc
18 sed -i -e "/^DIRSTACK/d" ${B}/${TARGET_PREFIX}testgcc
19 sed -i -e "/^EUID/d" ${B}/${TARGET_PREFIX}testgcc
20 sed -i -e "/^FUNCNAME/d" ${B}/${TARGET_PREFIX}testgcc
21 sed -i -e "/^GROUPS/d" ${B}/${TARGET_PREFIX}testgcc
22 sed -i -e "/^HOST/d" ${B}/${TARGET_PREFIX}testgcc
23 sed -i -e "/^HOME/d" ${B}/${TARGET_PREFIX}testgcc
24 sed -i -e "/^IFS/d" ${B}/${TARGET_PREFIX}testgcc
25 sed -i -e "/^LC_ALL/d" ${B}/${TARGET_PREFIX}testgcc
26 sed -i -e "/^LOGNAME/d" ${B}/${TARGET_PREFIX}testgcc
27 sed -i -e "/^MACHTYPE/d" ${B}/${TARGET_PREFIX}testgcc
28 sed -i -e "/^OSTYPE/d" ${B}/${TARGET_PREFIX}testgcc
29 sed -i -e "/^PIPE/d" ${B}/${TARGET_PREFIX}testgcc
30 sed -i -e "/^SHELL/d" ${B}/${TARGET_PREFIX}testgcc
31 sed -i -e "/^'/d" ${B}/${TARGET_PREFIX}testgcc
32 sed -i -e "/^UID/d" ${B}/${TARGET_PREFIX}testgcc
33 sed -i -e "/^TERM/d" ${B}/${TARGET_PREFIX}testgcc
34 sed -i -e "/^PATCH_GET/d" ${B}/${TARGET_PREFIX}testgcc
35 sed -i -e "/^PKG_/d" ${B}/${TARGET_PREFIX}testgcc
36 sed -i -e "/^POSIXLY_/d" ${B}/${TARGET_PREFIX}testgcc
37 sed -i -e "/^PPID/d" ${B}/${TARGET_PREFIX}testgcc
38 sed -i -e "/^PS4/d" ${B}/${TARGET_PREFIX}testgcc
39 sed -i -e "/^Q/d" ${B}/${TARGET_PREFIX}testgcc
40 sed -i -e "/^SHLVL/d" ${B}/${TARGET_PREFIX}testgcc
41 sed -i -e "/^STAGING/d" ${B}/${TARGET_PREFIX}testgcc
42 sed -i -e "/^LD_LIBRARY_PATH/d" ${B}/${TARGET_PREFIX}testgcc
43 sed -i -e "/^PSEUDO/d" ${B}/${TARGET_PREFIX}testgcc
44
45 # append execution part of the script
46cat >> ${B}/${TARGET_PREFIX}testgcc << STOP
47target="\$1"
48shift
49usage () {
50 echo "Usage:"
51 echo "\$0 user@target 'extra options to dejagnu'"
52 echo "\$0 target 'extra options to dejagnu'"
53 echo "\$0 target"
54 echo "e.g. \$0 192.168.7.2 ' dg.exp=visibility-d.c'"
55 echo "will only run visibility-d.c test case"
56 echo "e.g. \$0 192.168.7.2 '/-mthumb dg.exp=visibility-d.c'"
57 echo "will only run visibility-d.c test case in thumb mode"
58 echo "You need to have dejagnu autogen expect installed"
59 echo "on the build host"
60 }
61if [ "x\$target" = "x" ]
62then
63 echo "Please specify the target machine and remote user in form of user@target"
64 usage
65 exit 1;
66fi
67
68echo "\$target" | grep −q "@" >& /dev/null
69if [ "x\$?" = "x0" ]
70then
71 user=echo \$target | cut -d '@' -f 1
72 target=echo \$target | cut -d '@' -f 2
73else
74 user=\$USER
75fi
76ssh \$user@\$target date >& /dev/null
77if [ "x\$?" != "x0" ]
78then
79 echo "Failed connecting to \$user@\$target it could be because"
80 echo "you don't have passwordless ssh setup to access \$target"
81 echo "or sometimes host key has been changed"
82 echo "in such case do something like below on build host"
83 echo "ssh-keygen -f "~/.ssh/known_hosts" -R \$target"
84 echo "and then try ssh \$user@\$target"
85
86 usage
87 exit 1
88fi
89 echo "lappend boards_dir [pwd]/../../.." > ${B}/site.exp
90 echo "load_generic_config \"unix\"" > ${B}/${MACHINE_ARCH}.exp
91 echo "set_board_info username \$user" >> ${B}/${MACHINE_ARCH}.exp
92 echo "set_board_info rsh_prog ssh" >> ${B}/${MACHINE_ARCH}.exp
93 echo "set_board_info rcp_prog scp" >> ${B}/${MACHINE_ARCH}.exp
94 echo "set_board_info hostname \$target" >> ${B}/${MACHINE_ARCH}.exp
95 DEJAGNU=${B}/site.exp make -k check RUNTESTFLAGS="--target_board=${MACHINE_ARCH}\$@"
12 96
97STOP
98
99 chmod +x ${B}/${TARGET_PREFIX}testgcc
100
101}