[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Coverage for libltdl/slist.c and fallout
From: |
Ralf Wildenhues |
Subject: |
Re: Coverage for libltdl/slist.c and fallout |
Date: |
Mon, 30 Nov 2009 21:53:53 +0100 |
User-agent: |
Mutt/1.5.20 (2009-08-09) |
Hi Peter,
* Peter Rosin wrote on Mon, Nov 30, 2009 at 09:01:48AM CET:
> Den 2009-11-29 22:27 skrev Ralf Wildenhues:
> >- In the end I grew really lazy and added the new test to the old
> >testsuite: that seemed the easiest way to integrate and catch all the
> >compilation and include flags from toplevel Makefile.am in order to
> >build and use a separate slist.o object. If this is not ok with you,
> >then please complain loudly.
>
> Whispering a complaint, see below...
Loud enough. While this:
> This will be the first .c file in the tests directory, is that
> really desirable at this point?
I don't really care about, and this:
> All other .c files for the old
> testsuite are in subdirs. But adding yet another subdir is not
> what I want either. bootstrapping takes forever as it is and
> that's the reason I don't want another directory,
is unrelated to bootstrap time (we could also use another subdir and
still build the stuff from toplevel Makefile.am; the thing that takes
lots of bootstrapping time is the multiple configure scripts, which I
am not going to add in any case).
However, this:
> I want fewer,
> and I want the old testsuite to go away ASAP.
is laudable, and while this:
> Shouldn't this new file end with .test as all other such files in
> the old testsuite?
I really don't care about (except that double-dots like foo.test.c
are problematic on some systems), your killing point:
> I also miss this file from the patch. Ahhh, is
> the testsuite running the produced executable? Does that work
> when doing a cross build? What about $EXEEXT?
is a very good reason to redo the testsuite part of the patch.
Thanks, I forgot to think about the cross case.
Incremental patch below, to be squashed in with the posted version.
Thanks,
Ralf
* tests/slist.at (SList functionality): New file, new test.
* Makefile.am (TESTSUITE_AT): Add tests/slist.at.
diff --git a/Makefile.am b/Makefile.am
index a1097c7..2b09991 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -484,6 +484,7 @@ TESTSUITE_AT = tests/testsuite.at \
tests/lt_dlopen_a.at \
tests/lt_dlopenext.at \
tests/ltdl-api.at \
+ tests/slist.at \
tests/need_lib_prefix.at \
tests/standalone.at \
tests/subproject.at \
@@ -672,7 +673,6 @@ COMMON_TESTS = \
tests/sh.test \
tests/suffix.test \
tests/tagtrace.test \
- tests/test-slist \
tests/cdemo-static.test \
tests/cdemo-static-make.test \
tests/cdemo-static-exec.test \
@@ -760,11 +760,6 @@ COMMON_TESTS = \
tests/cdemo-undef-make.test \
tests/cdemo-undef-exec.test
-check_PROGRAMS = tests/test-slist
-tests_test_slist_SOURCES = \
- tests/test-slist.c \
- libltdl/slist.c
-
tests/cdemo-undef-exec.log: tests/cdemo-undef-make.log
tests/cdemo-undef-make.log: tests/cdemo-undef.log
tests/cdemo-undef.log: @ORDER@ tests/cdemo-shared-exec.log
diff --git a/tests/test-slist.c b/tests/slist.at
similarity index 72%
rename from tests/test-slist.c
rename to tests/slist.at
index 40279a4..3c851c0 100644
--- a/tests/test-slist.c
+++ b/tests/slist.at
@@ -1,3 +1,30 @@
+
+# slist.at -- test slist.c -*- Autotest -*-
+#
+# Copyright (C) 2009 Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING. If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+####
+
+AT_SETUP([SList functionality])
+
+AT_DATA([test-slist.c], [[
#include <config.h>
#include <stdlib.h>
#include <string.h>
@@ -128,3 +155,15 @@ int main ()
assert (slist_delete (list, boxed_delete) == NULL);
return 0;
}
+]])
+
+CPPFLAGS="-I$top_srcdir/libltdl -I$top_srcdir/libltdl/libltdl
-I$abs_top_builddir"
+AT_CHECK([$CC $CPPFLAGS $CFLAGS -c test-slist.c],
+ [], [ignore], [ignore])
+AT_CHECK([$CC $CPPFLAGS $CFLAGS -c $top_srcdir/libltdl/slist.c],
+ [], [ignore], [ignore])
+AT_CHECK([$CC $CFLAGS $LDFLAGS -o test-slist test-slist.$OBJEXT slist.$OBJEXT],
+ [], [ignore], [ignore])
+LT_AT_EXEC_CHECK([./test-slist], [], [ignore], [ignore])
+
+AT_CLEANUP