[PATCH] fix compile/link problems in libparted/tests
Jim Meyering
meyering at redhat.com
Sun Jun 8 21:06:49 UTC 2008
Since I didn't have check-devel installed where I'd been testing,
nothing was built in libparted/tests/.
* libparted/tests/label.c (main): Add argc and argv declarations.
* libparted/tests/disk.c (main): Likewise.
Reported by Frodo Baggins <frodo.drogo at gmail.com>.
* libparted/tests/Makefile.am (LDADD, AM_CPPFLAGS): Define, to compile
and link against gnulib-provided functions.
(label_CFLAGS, label_LDADD, disk_LDADD, etc.): Adjust.
(TESTS_ENVIRONMENT): Define, to propagate top_srcdir to test scripts.
---
libparted/tests/Makefile.am | 25 +++++++++++++++++--------
libparted/tests/disk.c | 2 +-
libparted/tests/label.c | 2 +-
3 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/libparted/tests/Makefile.am b/libparted/tests/Makefile.am
index d526207..fc42a43 100644
--- a/libparted/tests/Makefile.am
+++ b/libparted/tests/Makefile.am
@@ -1,18 +1,24 @@
# This file is part of GNU Parted
-# Copyright (C) 1999, 2000, 2001, 2007 Free Software Foundation, Inc.
+# Copyright (C) 1999-2001, 2007-2008 Free Software Foundation, Inc.
#
# This file may be modified and/or distributed without restriction.
TESTS = t1000-label.sh t2000-disk.sh
EXTRA_DIST = $(TESTS)
-bin_PROGRAMS = label disk
-label_CFLAGS = $(CHECK_CFLAGS) -I$(top_srcdir)/include
-label_LDADD = $(CHECK_LIBS) $(top_builddir)/libparted/libparted.la
-label_SOURCES = common.h common.c label.c
+bin_PROGRAMS = label disk
-disk_CFLAGS = $(CHECK_CFLAGS) -I$(top_srcdir)/include
-disk_LDADD = $(CHECK_LIBS) $(top_builddir)/libparted/libparted.la
-disk_SOURCES = common.h common.c disk.c
+LDADD = \
+ $(top_builddir)/libparted/libparted.la \
+ $(top_builddir)/lib/libparted.la \
+ $(CHECK_LIBS)
+
+AM_CPPFLAGS = \
+ $(CHECK_CFLAGS) \
+ -I$(top_srcdir)/lib \
+ -I$(top_srcdir)/include
+
+label_SOURCES = common.h common.c label.c
+disk_SOURCES = common.h common.c disk.c
MAINTAINERCLEANFILES = Makefile.in
@@ -26,3 +32,6 @@ init.sh: Makefile.in
echo 'PATH=$(abs_builddir)$(PATH_SEPARATOR)$$PATH; export PATH' >> $@-t
chmod a-w $@-t
mv $@-t $@
+
+TESTS_ENVIRONMENT = \
+ top_srcdir='$(top_srcdir)'
diff --git a/libparted/tests/disk.c b/libparted/tests/disk.c
index cf69b00..6e6d483 100644
--- a/libparted/tests/disk.c
+++ b/libparted/tests/disk.c
@@ -86,7 +86,7 @@ START_TEST (test_duplicate)
END_TEST
int
-main (void)
+main (int argc, char **argv)
{
set_program_name (argv[0]);
int number_failed;
diff --git a/libparted/tests/label.c b/libparted/tests/label.c
index aa825f9..2871c2c 100644
--- a/libparted/tests/label.c
+++ b/libparted/tests/label.c
@@ -148,7 +148,7 @@ START_TEST (test_clone_label)
END_TEST
int
-main (void)
+main (int argc, char **argv)
{
set_program_name (argv[0]);
int number_failed;
--
1.5.6.rc0.30.g7c3f3
More information about the parted-devel
mailing list