[Parted-commits] GNU Parted Official Repository: Changes to 'master'

Jim Meyering meyering at alioth.debian.org
Sun Jun 8 21:45:42 UTC 2008


 libparted/tests/Makefile.am    |   26 +++++++++++++++++---------
 libparted/tests/disk.c         |    2 +-
 libparted/tests/label.c        |    2 +-
 libparted/tests/t1000-label.sh |    5 +++--
 libparted/tests/t2000-disk.sh  |    5 +++--
 5 files changed, 25 insertions(+), 15 deletions(-)

New commits:
commit b521054f9ece81e409b9e910b756825d7e6907ac
Author: Jim Meyering <meyering at redhat.com>
Date:   Sun Jun 8 23:18:02 2008 +0200

    adjust tests here (libparted/tests/), as done for tests/
    
    * libparted/tests/Makefile.am (init.sh): Don't emit code to
    source test-lib.sh.
    * libparted/tests/t1000-label.sh: Source test-lib.sh, not init.sh.
    * libparted/tests/t2000-disk.sh: Likewise.

diff --git a/libparted/tests/Makefile.am b/libparted/tests/Makefile.am
index fc42a43..cde1602 100644
--- a/libparted/tests/Makefile.am
+++ b/libparted/tests/Makefile.am
@@ -28,7 +28,6 @@ init.sh: Makefile.in
 	rm -f $@-t $@
 	echo 'PARTED_USABLE_TEST_DIR=$(PARTED_USABLE_TEST_DIR)' > $@-t
 	echo 'abs_top_srcdir=$(abs_top_srcdir)' >> $@-t
-	echo '. $(abs_top_srcdir)/tests/test-lib.sh' >> $@-t
 	echo 'PATH=$(abs_builddir)$(PATH_SEPARATOR)$$PATH; export PATH' >> $@-t
 	chmod a-w $@-t
 	mv $@-t $@
diff --git a/libparted/tests/t1000-label.sh b/libparted/tests/t1000-label.sh
index c7a4d66..900433f 100755
--- a/libparted/tests/t1000-label.sh
+++ b/libparted/tests/t1000-label.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# Copyright (C) 2007 Free Software Foundation, Inc.
+# Copyright (C) 2007-2008 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -19,7 +19,8 @@ test_description='run the label unit tests in a directory supporting O_DIRECT'
 # This wrapper around the ./label binary is used to find a directory
 # in which one can open a file with the O_DIRECT flag.
 
-. ./init.sh
+: ${top_srcdir=../..}
+. $top_srcdir/tests/test-lib.sh
 
 test_expect_success \
     'run the actual tests' 'label'
diff --git a/libparted/tests/t2000-disk.sh b/libparted/tests/t2000-disk.sh
index 7a85b98..ae261a9 100755
--- a/libparted/tests/t2000-disk.sh
+++ b/libparted/tests/t2000-disk.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-# Copyright (C) 2007 Free Software Foundation, Inc.
+# Copyright (C) 2007-2008 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -19,7 +19,8 @@ test_description='run the disk unit tests in a directory supporting O_DIRECT'
 # This wrapper around the ./label binary is used to find a directory
 # in which one can open a file with the O_DIRECT flag.
 
-. ./init.sh
+: ${top_srcdir=../..}
+. $top_srcdir/tests/test-lib.sh
 
 test_expect_success \
     'run the actual tests' 'disk'

commit 1179e95b2133861c4841b14b76c2076e80cef4d6
Author: Jim Meyering <meyering at redhat.com>
Date:   Sun Jun 8 23:06:49 2008 +0200

    fix compile/link problems in libparted/tests
    
    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.

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;



More information about the Parted-commits mailing list