Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/2] Introduce cross testing driver for gcc-cross
@ 2011-12-14  2:54 Khem Raj
  2011-12-14  2:55 ` [PATCH 1/2] eglibc-testing: Clean the test before running them Khem Raj
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Khem Raj @ 2011-12-14  2:54 UTC (permalink / raw)
  To: openembedded-core

Hi

One patch makes the eglibc testing driver a bit more informative
and cleans the tests before running

Second patch introduces generating a script which will drive
cross testing of gcc. This script is generated as part of do_compile
task and virtually one can test bootstrapping versions of gcc as
well if need be but mostly gcc-cross makes most sense since thats
the one we use all the time.

The following changes since commit b9dfccc018f32a47fc045f35d5f53d7269d791ed:

  gdk-pixbuf: Ensure the binaries can be relocated (2011-12-13 18:00:18 +0000)

are available in the git repository at:
  git://git.openembedded.org/openembedded-core-contrib kraj/gcc-cross-testing
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=kraj/gcc-cross-testing

Khem Raj (2):
  eglibc-testing: Clean the test before running them
  gcc-cross: Add cross testing driver for running regression testsuites

 meta/recipes-core/eglibc/eglibc-testing.inc |   36 ++++++++++-
 meta/recipes-devtools/gcc/gcc-cross.inc     |   91 ++++++++++++++++++++++++++-
 2 files changed, 125 insertions(+), 2 deletions(-)

-- 
1.7.5.4




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] eglibc-testing: Clean the test before running them
  2011-12-14  2:54 [PATCH 0/2] Introduce cross testing driver for gcc-cross Khem Raj
@ 2011-12-14  2:55 ` Khem Raj
  2011-12-14  2:55 ` [PATCH 2/2] gcc-cross: Add cross testing driver for running regression testsuites Khem Raj
  2011-12-22 17:59 ` [PATCH 0/2] Introduce cross testing driver for gcc-cross Saul Wold
  2 siblings, 0 replies; 4+ messages in thread
From: Khem Raj @ 2011-12-14  2:55 UTC (permalink / raw)
  To: openembedded-core

We make sure that we use final cross gcc to run the tests
since they require proper functioning libstdc++ and libssp
which are not staged in tcbootstrap sysroot

We cleanup the tests before we run them so they all
get run in case any of them were built and/or run during compilation

Make the script executable

Add more documentation to diagnose setup problems

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-core/eglibc/eglibc-testing.inc |   36 ++++++++++++++++++++++++++-
 1 files changed, 35 insertions(+), 1 deletions(-)

diff --git a/meta/recipes-core/eglibc/eglibc-testing.inc b/meta/recipes-core/eglibc/eglibc-testing.inc
index fb632ba..2cd7c6a 100644
--- a/meta/recipes-core/eglibc/eglibc-testing.inc
+++ b/meta/recipes-core/eglibc/eglibc-testing.inc
@@ -32,16 +32,50 @@ do_compile_append () {
 	sed -i -e "/^STAGING/d" ${B}/${HOST_PREFIX}testeglibc
 	sed -i -e "/^LD_LIBRARY_PATH/d" ${B}/${HOST_PREFIX}testeglibc
 	sed -i -e "/^PSEUDO/d" ${B}/${HOST_PREFIX}testeglibc
+
+	# point to real sysroot not the toolchain bootstrap sysroot
+	sed -i -e "s/\-tcbootstrap//g" ${B}/${HOST_PREFIX}testeglibc
+
+	# use the final cross-gcc to test since some tests need libstdc++
+	sed -i -e "s/^PATH=.*\.gcc-cross-intermediate\:/PATH=/g" ${B}/${HOST_PREFIX}testeglibc
+
 	# append execution part script
 cat >> ${B}/${HOST_PREFIX}testeglibc << STOP
 target="\$1"
 if [ "x\$target" = "x" ]
 then
-	echo "Please specify the target machine and remote user in for of user@target"
+	echo "Please specify the target machine and remote user in form of user@target"
 	exit 1;
 fi
+ssh \$target ls \$PWD\ >& /dev/null
+if [ "x\$?" != "x0" ]
+then
+	echo "Failed connecting to \$target it could be because of:"
+	echo "1. You dont have passwordless ssh setup to access \$target"
+	echo "2. NFS share on \$target is not mounted or if mounted then not matching the build tree layout."
+	echo "   The tree should be accessible at same location on build host and target"
+	echo "   You can add nfs-server to IMAGE_FEATURES to get the nfs client on target"
+	echo "3. nfs server on build host is not running."
+	echo "   Please make sure that you have 'no_root_squash' added in /etc/exports if you want"
+	echo "   to test as root user on target (usually its recommended to create a non"
+	echo "   root user."
+	echo "   As a sanity check make sure that target can read/write to the eglibc build tree"
+	echo "   Please refer to ${S}/EGLIBC.cross-testing for further instructions on setup"
+	exit 1
+fi
+	echo "# we test using cross compiler from real sysroot therefore override the" > ${B}/configparms
+	echo "# definitions that come from ${B}/config.make" >> ${B}/configparms
+
+	echo "CC = ${CC}" >> ${B}/configparms
+	echo "CXX = ${CXX}" >> ${B}/configparms
+	sed -i -e "s/\-tcbootstrap//g" ${B}/configparms
+
 wrapper="${S}/scripts/cross-test-ssh.sh \$target"
 localedef="${STAGING_BINDIR_NATIVE}/cross-localedef --little-endian --uint32-align=4"
+make tests-clean
 make cross-localedef="\$localedef" cross-test-wrapper="\$wrapper" -k check
+rm -rf ${B}/configparms
 STOP
+
+	chmod +x ${B}/${HOST_PREFIX}testeglibc
 }
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] gcc-cross: Add cross testing driver for running regression testsuites
  2011-12-14  2:54 [PATCH 0/2] Introduce cross testing driver for gcc-cross Khem Raj
  2011-12-14  2:55 ` [PATCH 1/2] eglibc-testing: Clean the test before running them Khem Raj
@ 2011-12-14  2:55 ` Khem Raj
  2011-12-22 17:59 ` [PATCH 0/2] Introduce cross testing driver for gcc-cross Saul Wold
  2 siblings, 0 replies; 4+ messages in thread
From: Khem Raj @ 2011-12-14  2:55 UTC (permalink / raw)
  To: openembedded-core

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

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-devtools/gcc/gcc-cross.inc |   91 ++++++++++++++++++++++++++++++-
 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 5a796bc..0b31a8c 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
 
 do_compile () {
 	oe_runmake all-host all-target-libgcc
-}
+	# now generate script to drive testing
+	echo "#!/usr/bin/env sh" >${B}/${TARGET_PREFIX}testgcc
+	set >> ${B}/${TARGET_PREFIX}testgcc
+	# prune out the unneeded vars
+	sed -i -e "/^BASH/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^USER/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^OPT/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^DIRSTACK/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^EUID/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^FUNCNAME/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^GROUPS/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^HOST/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^HOME/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^IFS/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^LC_ALL/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^LOGNAME/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^MACHTYPE/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^OSTYPE/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^PIPE/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^SHELL/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^'/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^UID/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^TERM/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^PATCH_GET/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^PKG_/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^POSIXLY_/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^PPID/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^PS4/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^Q/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^SHLVL/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^STAGING/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^LD_LIBRARY_PATH/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^PSEUDO/d" ${B}/${TARGET_PREFIX}testgcc
+
+	# append execution part of the script
+cat >> ${B}/${TARGET_PREFIX}testgcc << STOP
+target="\$1"
+shift
+usage () {
+	echo "Usage:"
+	echo "\$0 user@target 'extra options to dejagnu'"
+	echo "\$0 target 'extra options to dejagnu'"
+	echo "\$0 target"
+	echo "e.g. \$0 192.168.7.2 ' dg.exp=visibility-d.c'"
+	echo "will only run visibility-d.c test case"
+	echo "e.g. \$0 192.168.7.2 '/-mthumb dg.exp=visibility-d.c'"
+	echo "will only run visibility-d.c test case in thumb mode"
+	echo "You need to have dejagnu autogen expect installed"
+	echo "on the build host"
+    }
+if [ "x\$target" = "x" ]
+then
+	echo "Please specify the target machine and remote user in form of user@target"
+	usage
+	exit 1;
+fi
+
+echo "\$target" | grep −q "@" >& /dev/null
+if [ "x\$?" = "x0" ]
+then
+   user=echo \$target | cut -d '@' -f 1
+   target=echo \$target | cut -d '@' -f 2
+else
+   user=\$USER
+fi
+ssh \$user@\$target date >& /dev/null
+if [ "x\$?" != "x0" ]
+then
+	echo "Failed connecting to \$user@\$target it could be because"
+	echo "you don't have passwordless ssh setup to access \$target"
+	echo "or sometimes host key has been changed"
+	echo "in such case do something like below on build host"
+	echo "ssh-keygen -f "~/.ssh/known_hosts" -R \$target"
+	echo "and then try ssh \$user@\$target"
+
+	usage
+	exit 1
+fi
+	echo "lappend boards_dir [pwd]/../../.." > ${B}/site.exp
+	echo "load_generic_config \"unix\"" > ${B}/${MACHINE_ARCH}.exp
+	echo "set_board_info username \$user" >> ${B}/${MACHINE_ARCH}.exp
+	echo "set_board_info rsh_prog ssh" >> ${B}/${MACHINE_ARCH}.exp
+	echo "set_board_info rcp_prog scp" >> ${B}/${MACHINE_ARCH}.exp
+	echo "set_board_info hostname \$target" >> ${B}/${MACHINE_ARCH}.exp
+	DEJAGNU=${B}/site.exp make -k check RUNTESTFLAGS="--target_board=${MACHINE_ARCH}\$@"
 
+STOP
+
+	chmod +x ${B}/${TARGET_PREFIX}testgcc
+
+}
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] Introduce cross testing driver for gcc-cross
  2011-12-14  2:54 [PATCH 0/2] Introduce cross testing driver for gcc-cross Khem Raj
  2011-12-14  2:55 ` [PATCH 1/2] eglibc-testing: Clean the test before running them Khem Raj
  2011-12-14  2:55 ` [PATCH 2/2] gcc-cross: Add cross testing driver for running regression testsuites Khem Raj
@ 2011-12-22 17:59 ` Saul Wold
  2 siblings, 0 replies; 4+ messages in thread
From: Saul Wold @ 2011-12-22 17:59 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

On 12/13/2011 06:54 PM, Khem Raj wrote:
> Hi
>
> One patch makes the eglibc testing driver a bit more informative
> and cleans the tests before running
>
> Second patch introduces generating a script which will drive
> cross testing of gcc. This script is generated as part of do_compile
> task and virtually one can test bootstrapping versions of gcc as
> well if need be but mostly gcc-cross makes most sense since thats
> the one we use all the time.
>
> The following changes since commit b9dfccc018f32a47fc045f35d5f53d7269d791ed:
>
>    gdk-pixbuf: Ensure the binaries can be relocated (2011-12-13 18:00:18 +0000)
>
> are available in the git repository at:
>    git://git.openembedded.org/openembedded-core-contrib kraj/gcc-cross-testing
>    http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=kraj/gcc-cross-testing
>
> Khem Raj (2):
>    eglibc-testing: Clean the test before running them
>    gcc-cross: Add cross testing driver for running regression testsuites
>
>   meta/recipes-core/eglibc/eglibc-testing.inc |   36 ++++++++++-
>   meta/recipes-devtools/gcc/gcc-cross.inc     |   91 ++++++++++++++++++++++++++-
>   2 files changed, 125 insertions(+), 2 deletions(-)
>

Merged to OE-Core

Thanks
	Sau!



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-12-22 18:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-14  2:54 [PATCH 0/2] Introduce cross testing driver for gcc-cross Khem Raj
2011-12-14  2:55 ` [PATCH 1/2] eglibc-testing: Clean the test before running them Khem Raj
2011-12-14  2:55 ` [PATCH 2/2] gcc-cross: Add cross testing driver for running regression testsuites Khem Raj
2011-12-22 17:59 ` [PATCH 0/2] Introduce cross testing driver for gcc-cross Saul Wold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox