This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC] patch: libffi dejanu test framework


Hi all,

I here send a draft patch for dejagnufying the libffi testsuite.
The main reason for this patch is make it more (gcc) common on how tests
are executed, try to execute the testsuite every time to see regressions
and to make it easier to debug existing test cases.

Most of the test cases are the same as you'll see in ffitest.c. A bunch
is new (by me) to test closures more in depth.
And to be honest, a few are missing due to inability to test on non
ppc/sparc boxen.

I tried to use the dg framework where one can say how a testcase should
behave. You should be able to say which target should behave how. The
same as in gcc testsuite.
I mainly took libstdc++ for the transition as an example (thx PME!). In
the beginning I had the framework from
:pserver:anoncvs@sources.redhat.com:/cvs/libffi but then I was not
satiesfied on how one could take influence on a testcase. E.g, check the
output.
So I took the different implementations from gcc itself and tried to
brew something working.

Here the next point, I took dg-output to check if the output is correct
or not. I left the printf's in the tc's since when you have to debug it,
it is helpful to see directly what's going on.
I don't know if dg-output is ok or not.

I tested this patch on darwin with --disable--multilib, on solaris9 with
multilib and on ppc linux too with multilib.
Up to now I couldn't test as cross environment. Would be great if
someone could give this a try.

The auto* chain is 2.13 for *conf and 1.4 for *make. I didn't touch this since I read other(s) have already done this.

A side effect of this patch is the 'make clean' which should now work correctly.

I hope I didn't forget too much :)

And hopefully I didn't break too much. Though I'll promise a few
platforms will NOT pass all the tests.

At the moment I only know 2 platforms which will pass for sure :) (native libs only)But they both need some patches.
No, not solaris.


The patch consists of the diff attached and the tarfile containing the
new files. Spoken with zwol ;) and found this the best solution.
It is against cvs-head.

Also, I appreciate any comments, suggestions, corrections or whatever.

And finally a big thanks to all the people who helped me when I was
asking boring/stupid questions.

Regards,
Andreas

2003-08-28 Andreas Tobler <a.tobler@schweiz.ch>

	* Makefile.am: Add dejagnu test framework.
	* Makefile.in: Rebuilt.
	* configure.in: Add dejagnu test framework.
	* configure: Rebuilt.

	* testsuite/Makefile.am: New file.
	* testsuite/Makefile.in: Built
	* testsuite/lib/libffi-dg.exp: New file.
	* testsuite/config/default.exp: Likewise.
	* testsuite/libffi.call/call.exp: Likewise.
	* testsuite/libffi.call/ffitest.h: Likewise.
	* testsuite/libffi.call/closure_fn0.c: Likewise.
	* testsuite/libffi.call/closure_fn1.c: Likewise.
	* testsuite/libffi.call/closure_fn2.c: Likewise.
	* testsuite/libffi.call/closure_fn3.c: Likewise.
	* testsuite/libffi.call/cls_2byte.c: Likewise.
	* testsuite/libffi.call/cls_3byte1.c: Likewise.
	* testsuite/libffi.call/cls_3byte2.c: Likewise.
	* testsuite/libffi.call/cls_4byte.c: Likewise.
	* testsuite/libffi.call/cls_5byte.c: Likewise.
	* testsuite/libffi.call/cls_6byte.c: Likewise.
	* testsuite/libffi.call/cls_7byte.c: Likewise.
	* testsuite/libffi.call/cls_8byte.c: Likewise.
	* testsuite/libffi.call/cls_12byte.c: Likewise.
	* testsuite/libffi.call/cls_16byte.c: Likewise.
	* testsuite/libffi.call/cls_20byte.c: Likewise.
	* testsuite/libffi.call/cls_24byte.c: Likewise.
	* testsuite/libffi.call/cls_double.c: Likewise.
	* testsuite/libffi.call/cls_float.c: Likewise.
	* testsuite/libffi.call/cls_uchar.c: Likewise.
	* testsuite/libffi.call/cls_uint.c: Likewise.
	* testsuite/libffi.call/cls_ulonglong.c: Likewise.
	* testsuite/libffi.call/cls_ushort.c: Likewise.
	* testsuite/libffi.call/float.c: Likewise.
	* testsuite/libffi.call/float1.c: Likewise.
	* testsuite/libffi.call/float2.c: Likewise.
	* testsuite/libffi.call/many.c: Likewise.
	* testsuite/libffi.call/nested_struct.c: Likewise.
	* testsuite/libffi.call/nested_struct2.c: Likewise.
	* testsuite/libffi.call/problem.c: Likewise.
	* testsuite/libffi.call/problem1.c: Likewise.
	* testsuite/libffi.call/promotion.c: Likewise.
	* testsuite/libffi.call/return_ll.c: Likewise.
	* testsuite/libffi.call/return_sc.c: Likewise.
	* testsuite/libffi.call/return_uc.c: Likewise.
	* testsuite/libffi.call/strlen.c: Likewise.
	* testsuite/libffi.call/struct1.c: Likewise.
	* testsuite/libffi.call/struct2.c: Likewise.
	* testsuite/libffi.call/struct3.c: Likewise.
	* testsuite/libffi.call/struct4.c: Likewise.
	* testsuite/libffi.call/struct5.c: Likewise.
	* testsuite/libffi.call/struct6.c: Likewise.
	* testsuite/libffi.call/struct7.c: Likewise.
	* testsuite/libffi.call/struct8.c: Likewise.
	* testsuite/libffi.call/struct9.c: Likewise.
	
	* testsuite/libffi.special/special.exp: New file.
	* testsuite/libffi.special/ffitestcxx.h: Likewise.
	* testsuite/libffi.special/unwindtest.cc: Likewise.








Index: Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libffi/Makefile.am,v
retrieving revision 1.27
diff -u -r1.27 Makefile.am
--- Makefile.am	13 Jun 2003 02:23:26 -0000	1.27
+++ Makefile.am	27 Aug 2003 11:58:46 -0000
@@ -2,7 +2,11 @@
 
 AUTOMAKE_OPTIONS = cygnus
 
+if TESTSUBDIR
+SUBDIRS = include testsuite
+else
 SUBDIRS = include
+endif
 
 EXTRA_DIST = LICENSE ChangeLog.v1 src/mips/ffi.c src/mips/n32.S \
 		src/mips/n32.s src/mips/o32.S src/mips/o32.s \
@@ -52,6 +56,7 @@
 	"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
 	"PICFLAG=$(PICFLAG)" \
 	"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
+	"RUNTESTFLAGS=$(RUNTESTFLAGS)" \
 	"SHELL=$(SHELL)" \
 	"exec_prefix=$(exec_prefix)" \
 	"infodir=$(infodir)" \
@@ -83,7 +88,6 @@
 
 noinst_PROGRAMS = ffitest
 
-ffitest_OBJECTS = ffitest.lo
 ffitest_LDADD = libffi.la
 ffitest_LDFLAGS = -shared-libgcc
 
@@ -178,7 +182,7 @@
 libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SH64)
 endif
 
-AM_CFLAGS = -fexceptions
+AM_CFLAGS = -Wall -g -fexceptions
 
 libffi_la_LDFLAGS = -release $(VERSION) 
 
@@ -231,3 +235,7 @@
 
 ## ################################################################
 
+CLEANFILES = $(libffi_convenience_la_OBJECTS)		\
+	     $(libffi_la_OBJECTS) 			\
+	     $(libffi_convenience_la_OBJECTS:.lo=.o)	\
+	     $(libffi_la_OBJECTS:.lo=.o)
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/libffi/configure.in,v
retrieving revision 1.43
diff -u -r1.43 configure.in
--- configure.in	13 Jun 2003 02:23:26 -0000	1.43
+++ configure.in	27 Aug 2003 11:58:46 -0000
@@ -32,7 +32,8 @@
 AC_SUBST(libffi_basedir)
 AC_CONFIG_AUX_DIR(${libffi_basedir}..)
 
-AC_CANONICAL_HOST
+AC_CANONICAL_SYSTEM
+target_alias=${target_alias-$host_alias}
 
 AM_PROG_LIBTOOL
 
@@ -42,8 +43,13 @@
 AM_MAINTAINER_MODE
 
 AC_PROG_CC
+
 AC_PROG_LIBTOOL
 
+dnl The -no-testsuite modules omit the test subdir.
+AM_CONDITIONAL(TESTSUBDIR, test -d $srcdir/testsuite)
+
+
 TARGETDIR="unknown"
 case "$host" in
 mips-sgi-irix5.* | mips-sgi-irix6.*) TARGET=MIPS; TARGETDIR=mips;;
@@ -78,6 +84,8 @@
 sh64-*-linux* | sh5*-*-linux*) TARGET=SH64; TARGETDIR=sh64;;
 esac
 
+AC_SUBST(AM_RUNTESTFLAGS)
+
 if test $TARGETDIR = unknown; then
   AC_ERROR("libffi has not been ported to $host.")
 fi
@@ -221,7 +229,7 @@
   multilib_arg=
 fi
 
-AC_OUTPUT(include/Makefile include/ffi.h Makefile,
+AC_OUTPUT(include/Makefile testsuite/Makefile include/ffi.h Makefile,
 [
 if test -n "$CONFIG_FILES"; then
    LD="${ORIGINAL_LD_FOR_MULTILIBS}"

Attachment: testsuite-libffi.tar.gz
Description: GNU Zip compressed data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]