[PATCH v3] build: Drop serial_tests.
by Richard W.M. Jones
Same as v2, except:
- Drop the RUN_OUTPUT_FILE functionality completely. It will be
replaced with enhanced .trs files as discussed.
- Rebase on head.
Rich.
9 years
[PATCH supermin] build: use a custom test driver
by Pino Toscano
Use a custom test driver for running the tests: based on the test-driver
provided by automake, it adds the running time of the test in each .trs
file.
---
configure.ac | 1 +
guestfs-test-driver | 151 ++++++++++++++++++++++++++++++++++++++++++++++++++++
tests/Makefile.am | 2 +
3 files changed, 154 insertions(+)
create mode 100755 guestfs-test-driver
diff --git a/configure.ac b/configure.ac
index 8cbfa0a..6ff60c6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,6 +19,7 @@ dnl Written by Richard W.M. Jones <rjones(a)redhat.com>
AC_INIT([supermin],[5.1.13])
AM_INIT_AUTOMAKE(foreign)
+AC_REQUIRE_AUX_FILE([guestfs-test-driver])
dnl Check for basic C environment.
AC_PROG_CC_STDC
diff --git a/guestfs-test-driver b/guestfs-test-driver
new file mode 100755
index 0000000..09854c2
--- /dev/null
+++ b/guestfs-test-driver
@@ -0,0 +1,151 @@
+#! /bin/sh
+# test-driver - basic testsuite driver script.
+
+scriptversion=2013-07-13.22; # UTC
+
+# Copyright (C) 2011-2015 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
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake(a)gnu.org> or send patches to
+# <automake-patches(a)gnu.org>.
+
+# Make unconditional expansion of undefined variables an error. This
+# helps a lot in preventing typo-related bugs.
+set -u
+
+usage_error ()
+{
+ echo "$0: $*" >&2
+ print_usage >&2
+ exit 2
+}
+
+print_usage ()
+{
+ cat <<END
+Usage:
+ test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
+ [--expect-failure={yes|no}] [--color-tests={yes|no}]
+ [--enable-hard-errors={yes|no}] [--]
+ TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
+The '--test-name', '--log-file' and '--trs-file' options are mandatory.
+END
+}
+
+test_name= # Used for reporting.
+log_file= # Where to save the output of the test script.
+trs_file= # Where to save the metadata of the test run.
+expect_failure=no
+color_tests=no
+enable_hard_errors=yes
+while test $# -gt 0; do
+ case $1 in
+ --help) print_usage; exit $?;;
+ --version) echo "test-driver $scriptversion"; exit $?;;
+ --test-name) test_name=$2; shift;;
+ --log-file) log_file=$2; shift;;
+ --trs-file) trs_file=$2; shift;;
+ --color-tests) color_tests=$2; shift;;
+ --expect-failure) expect_failure=$2; shift;;
+ --enable-hard-errors) enable_hard_errors=$2; shift;;
+ --) shift; break;;
+ -*) usage_error "invalid option: '$1'";;
+ *) break;;
+ esac
+ shift
+done
+
+missing_opts=
+test x"$test_name" = x && missing_opts="$missing_opts --test-name"
+test x"$log_file" = x && missing_opts="$missing_opts --log-file"
+test x"$trs_file" = x && missing_opts="$missing_opts --trs-file"
+if test x"$missing_opts" != x; then
+ usage_error "the following mandatory options are missing:$missing_opts"
+fi
+
+if test $# -eq 0; then
+ usage_error "missing argument"
+fi
+
+if test $color_tests = yes; then
+ # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
+ red='[0;31m' # Red.
+ grn='[0;32m' # Green.
+ lgn='[1;32m' # Light green.
+ blu='[1;34m' # Blue.
+ mgn='[0;35m' # Magenta.
+ std='[m' # No color.
+else
+ red= grn= lgn= blu= mgn= std=
+fi
+
+do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
+trap "st=129; $do_exit" 1
+trap "st=130; $do_exit" 2
+trap "st=141; $do_exit" 13
+trap "st=143; $do_exit" 15
+
+# Test script is run here.
+start_t="$(date +'%s')"
+"$@" >$log_file 2>&1
+estatus=$?
+end_t="$(date +'%s')"
+
+if test $enable_hard_errors = no && test $estatus -eq 99; then
+ tweaked_estatus=1
+else
+ tweaked_estatus=$estatus
+fi
+
+case $tweaked_estatus:$expect_failure in
+ 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
+ 0:*) col=$grn res=PASS recheck=no gcopy=no;;
+ 77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
+ 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
+ *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
+ *:*) col=$red res=FAIL recheck=yes gcopy=yes;;
+esac
+
+# Report the test outcome and exit status in the logs, so that one can
+# know whether the test passed or failed simply by looking at the '.log'
+# file, without the need of also peaking into the corresponding '.trs'
+# file (automake bug#11814).
+echo "$res $test_name (exit status: $estatus)" >>$log_file
+
+# Report outcome to console.
+echo "${col}${res}${std}: $test_name"
+
+# Register the test result, and other relevant metadata.
+echo ":test-result: $res" > $trs_file
+echo ":global-test-result: $res" >> $trs_file
+echo ":recheck: $recheck" >> $trs_file
+echo ":copy-in-global-log: $gcopy" >> $trs_file
+echo ":guestfs-time: $(($end_t - $start_t))" >> $trs_file
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 4ebc748..49a8edf 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -17,6 +17,8 @@
#
# Written by Richard W.M. Jones <rjones(a)redhat.com>
+LOG_DRIVER = env $(SHELL) $(top_srcdir)/guestfs-test-driver
+
EXTRA_DIST = \
automake2junit.ml \
$(TESTS)
--
2.1.0
9 years
[PATCH 0/4] Provide better fake virtio-* test data for virt-v2v.
by Richard W.M. Jones
Patch 1 moves the v2v/fake-virtio-win and v2v/fake-virt-tools
directories to the recently created test-data/ hierarchy. This is
just refactoring with no functional change at all.
Patches 2-4 then extend the available (fake) virtio-win drivers:
- Patch 2 adds all of the drivers from the virtio-win RPM.
- Patch 3 adds all of the drivers from the virtio-win ISO (which are
different from the virtio-win RPM, for various reasons that don't
make sense).
- Patch 4 adds bits of the *.inf files, which will allow us to do
proper driver discovery in future. See Vadim's posting here:
https://www.redhat.com/archives/libguestfs/2015-October/msg00352.html
Rich.
9 years
[PATCH] tests/c-api: cache available features
by Pino Toscano
Build a list of all the features used in action tests, and lazily read
them as needed. This reduces the number of guestfs_feature_available
calls for a full run from 117 to 18.
---
generator/tests_c_api.ml | 77 +++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 73 insertions(+), 4 deletions(-)
diff --git a/generator/tests_c_api.ml b/generator/tests_c_api.ml
index 6be753f..8c4e5ef 100644
--- a/generator/tests_c_api.ml
+++ b/generator/tests_c_api.ml
@@ -28,6 +28,8 @@ open Optgroups
open Actions
open Structs
+module StringSet = Set.Make (String)
+
(* Generate the C API tests. *)
let rec generate_c_api_tests () =
generate_header CStyle GPLv2plus;
@@ -41,6 +43,7 @@ let rec generate_c_api_tests () =
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <stdbool.h>
#include \"guestfs.h\"
#include \"guestfs-internal-frontend.h\"
@@ -53,6 +56,74 @@ let rec generate_c_api_tests () =
#error Missing GUESTFS_ISO_SYSTEM_ID for the current OS
#endif
+struct feature {
+ const char *name;
+ bool read;
+ bool available;
+};
+
+";
+
+ (* Get a list of all the features. *)
+ let features =
+ List.fold_left (
+ fun acc { optional = optional; tests = tests } ->
+ let acc =
+ match optional with
+ | Some group -> StringSet.add group acc
+ | None -> acc in
+ List.fold_left (
+ fun acc test ->
+ match test with
+ | (_, IfAvailable group, _, _) -> StringSet.add group acc
+ | (_, (Always|IfNotCrossAppliance|Disabled), _, _) -> acc
+ ) acc tests
+ ) StringSet.empty all_functions in
+ let features = List.sort compare (StringSet.elements features) in
+ let nr_features = List.length features in
+ pr "size_t nr_features = %d;\n" nr_features;
+ pr "\n";
+ pr "struct feature features[%d] = {\n" nr_features;
+ List.iter (
+ fun feature ->
+ pr " { .name = \"%s\", .read = false, .available = false },\n"
+ feature
+ ) features;
+ pr "};\n";
+ pr "\n";
+
+ pr "\
+static bool
+is_feature_available (guestfs_h *g, const char *feature)
+{
+ size_t i;
+
+ for (i = 0; i < nr_features; ++i) {
+ struct feature *f = &features[i];
+
+ if (STRNEQ (f->name, feature))
+ continue;
+
+ if (!f->read) {
+ const char *array[] = { f->name, NULL };
+ int res = guestfs_feature_available (g, (char **) array);
+ if (res < 0) {
+ fprintf (stderr,
+ \"call to guestfs_feature_available(%%s) failed: %%d, %%s\\n\",
+ f->name, guestfs_last_errno (g), guestfs_last_error (g));
+ exit (EXIT_FAILURE);
+ }
+
+ f->available = res > 0;
+ f->read = true;
+ }
+
+ return f->available;
+ }
+
+ return false;
+}
+
";
(* Generate a list of commands which are not tested anywhere. *)
@@ -140,12 +211,10 @@ static int
* support is available in the daemon.
*)
let group_test group =
- let sym = gensym "features" in
- pr " const char *%s[] = { \"%s\", NULL };\n" sym group;
- pr " if (!guestfs_feature_available (g, (char **) %s)) {\n" sym;
+ pr " if (!is_feature_available (g, \"%s\")) {\n" group;
pr " skipped (\"%s\", \"group %%s not available in daemon\",\n"
test_name;
- pr " %s[0]);\n" sym;
+ pr " \"%s\");\n" group;
pr " return 0;\n";
pr " }\n";
pr "\n"
--
2.1.0
9 years
[PATCH 1/2] test-data: phony-guests: Don't use *.tmp.* temporary files.
by Richard W.M. Jones
---
test-data/phony-guests/Makefile.am | 3 +--
test-data/phony-guests/make-archlinux-img.sh | 4 ++--
test-data/phony-guests/make-coreos-img.sh | 10 ++++----
test-data/phony-guests/make-debian-img.sh | 10 ++++----
test-data/phony-guests/make-fedora-img.pl | 34 ++++++++++++++--------------
test-data/phony-guests/make-ubuntu-img.sh | 14 ++++++------
test-data/phony-guests/make-windows-img.sh | 4 ++--
7 files changed, 39 insertions(+), 40 deletions(-)
diff --git a/test-data/phony-guests/Makefile.am b/test-data/phony-guests/Makefile.am
index 98922c7..f05aeb9 100644
--- a/test-data/phony-guests/Makefile.am
+++ b/test-data/phony-guests/Makefile.am
@@ -63,8 +63,7 @@ check_DATA = $(disk_images) guests-all-good.xml
CLEANFILES = \
$(check_DATA) \
guests-all-good.xml \
- stamp-fedora-md.img \
- *.tmp.*
+ stamp-fedora-md.img
# Make several different blank images. These are not guests, but we
# include them in the libvirt fake XML to make sure that virt-df and
diff --git a/test-data/phony-guests/make-archlinux-img.sh b/test-data/phony-guests/make-archlinux-img.sh
index 5c848d2..066df09 100755
--- a/test-data/phony-guests/make-archlinux-img.sh
+++ b/test-data/phony-guests/make-archlinux-img.sh
@@ -23,7 +23,7 @@ set -e
# Create a disk image.
guestfish <<EOF
-sparse archlinux.img.tmp.$$ 512M
+sparse archlinux.img-t 512M
run
# Format the disk.
@@ -55,4 +55,4 @@ mkdir /boot/grub
touch /boot/grub/grub.conf
EOF
-mv archlinux.img.tmp.$$ archlinux.img
+mv archlinux.img-t archlinux.img
diff --git a/test-data/phony-guests/make-coreos-img.sh b/test-data/phony-guests/make-coreos-img.sh
index b8e0816..1de2f25 100755
--- a/test-data/phony-guests/make-coreos-img.sh
+++ b/test-data/phony-guests/make-coreos-img.sh
@@ -22,7 +22,7 @@ export LANG=C
set -e
# lsb-release file.
-cat > release.tmp.$$ <<'EOF'
+cat > archlinux.release <<'EOF'
DISTRIB_ID=CoreOS
DISTRIB_RELEASE=647.0.0
DISTRIB_CODENAME="Red Dog"
@@ -31,7 +31,7 @@ EOF
# Create a disk image.
guestfish <<EOF
-sparse coreos.img.tmp.$$ 512M
+sparse coreos.img-t 512M
run
part-init /dev/sda gpt
@@ -73,11 +73,11 @@ mkdir /root
mkdir /home
write /etc/coreos/update.conf "GROUP=stable"
-upload release.tmp.$$ /usr/share/coreos/lsb-release
+upload archlinux.release /usr/share/coreos/lsb-release
ln-s ../usr/share/coreos/lsb-release /etc/lsb-release
write /etc/hostname "coreos.invalid"
EOF
-rm release.tmp.$$
-mv coreos.img.tmp.$$ coreos.img
+rm archlinux.release
+mv coreos.img-t coreos.img
diff --git a/test-data/phony-guests/make-debian-img.sh b/test-data/phony-guests/make-debian-img.sh
index b52758f..637bd4b 100755
--- a/test-data/phony-guests/make-debian-img.sh
+++ b/test-data/phony-guests/make-debian-img.sh
@@ -22,7 +22,7 @@ export LANG=C
set -e
# fstab file.
-cat > fstab.tmp.$$ <<EOF
+cat > debian.fstab <<EOF
LABEL=BOOT /boot ext2 default 0 0
/dev/debian/root / ext2 default 0 0
/dev/debian/usr /usr ext2 default 1 2
@@ -32,7 +32,7 @@ EOF
# Create a disk image.
guestfish <<EOF
-sparse debian.img.tmp.$$ 512M
+sparse debian.img-t 512M
run
# Format the disk.
@@ -78,7 +78,7 @@ mkdir-p /var/lib/dpkg
mkdir /var/lib/urandom
mkdir /var/log
-upload fstab.tmp.$$ /etc/fstab
+upload debian.fstab /etc/fstab
write /etc/debian_version "5.0.1"
write /etc/hostname "debian.invalid"
@@ -92,5 +92,5 @@ mkdir /boot/grub
touch /boot/grub/grub.conf
EOF
-rm fstab.tmp.$$
-mv debian.img.tmp.$$ debian.img
+rm debian.fstab
+mv debian.img-t debian.img
diff --git a/test-data/phony-guests/make-fedora-img.pl b/test-data/phony-guests/make-fedora-img.pl
index 520a02d..41521e7 100755
--- a/test-data/phony-guests/make-fedora-img.pl
+++ b/test-data/phony-guests/make-fedora-img.pl
@@ -49,9 +49,9 @@ foreach ('LAYOUT', 'SRCDIR') {
}
if ($ENV{LAYOUT} eq 'partitions') {
- push (@images, "fedora.img.tmp.$$");
+ push (@images, "fedora.img-t");
- open (my $fstab, '>', "fstab.tmp.$$") or die;
+ open (my $fstab, '>', "fedora.fstab") or die;
print $fstab <<EOF;
LABEL=BOOT /boot ext2 default 0 0
LABEL=ROOT / ext2 default 0 0
@@ -60,9 +60,9 @@ EOF
$bootdev = '/dev/sda1';
- $g->disk_create ("fedora.img.tmp.$$", "raw", $IMAGE_SIZE);
+ $g->disk_create ("fedora.img-t", "raw", $IMAGE_SIZE);
- $g->add_drive ("fedora.img.tmp.$$");
+ $g->add_drive ("fedora.img-t");
$g->launch ();
$g->part_init ('/dev/sda', 'mbr');
@@ -74,9 +74,9 @@ EOF
}
elsif ($ENV{LAYOUT} eq 'partitions-md') {
- push (@images, "fedora-md1.img.tmp.$$", "fedora-md2.img.tmp.$$");
+ push (@images, "fedora-md1.img-t", "fedora-md2.img-t");
- open (my $fstab, '>', "fstab.tmp.$$") or die;
+ open (my $fstab, '>', "fedora.fstab") or die;
print $fstab <<EOF;
/dev/md0 /boot ext2 default 0 0
LABEL=ROOT / ext2 default 0 0
@@ -103,7 +103,7 @@ EOF
$g->md_create ('boot', ['/dev/sda1', '/dev/sdb1']);
$g->md_create ('root', ['/dev/sda2', '/dev/sdb2']);
- open (my $mdadm, '>', "mdadm.tmp.$$") or die;
+ open (my $mdadm, '>', "fedora.mdadm") or die;
print $mdadm <<EOF;
MAILADDR root
AUTO +imsm +1.x -all
@@ -123,9 +123,9 @@ EOF
}
elsif ($ENV{LAYOUT} eq 'btrfs') {
- push (@images, "fedora-btrfs.img.tmp.$$");
+ push (@images, "fedora-btrfs.img-t");
- open (my $fstab, '>', "fstab.tmp.$$") or die;
+ open (my $fstab, '>', "fedora.fstab") or die;
print $fstab <<EOF;
LABEL=BOOT /boot ext2 default 0 0
LABEL=ROOT / btrfs subvol=root 0 0
@@ -135,9 +135,9 @@ EOF
$bootdev = '/dev/sda1';
- $g->disk_create ("fedora-btrfs.img.tmp.$$", "raw", $IMAGE_SIZE);
+ $g->disk_create ("fedora-btrfs.img-t", "raw", $IMAGE_SIZE);
- $g->add_drive ("fedora-btrfs.img.tmp.$$");
+ $g->add_drive ("fedora-btrfs.img-t");
$g->launch ();
$g->part_init ('/dev/sda', 'mbr');
@@ -206,15 +206,15 @@ $g->chmod (0, '/etc/shadow');
$g->lsetxattr ('security.selinux', "system_u:object_r:shadow_t:s0\0", 30,
'/etc/shadow');
-$g->upload ("fstab.tmp.$$", '/etc/fstab');
+$g->upload ("fedora.fstab", '/etc/fstab');
$g->write ('/etc/motd', "Welcome to Fedora release 14 (Phony)\n");
$g->write ('/etc/redhat-release', 'Fedora release 14 (Phony)');
$g->write ('/etc/fedora-release', 'Fedora release 14 (Phony)');
$g->write ('/etc/sysconfig/network', 'HOSTNAME=fedora.invalid');
-if (-f "mdadm.tmp.$$") {
- $g->upload ("mdadm.tmp.$$", '/etc/mdadm.conf');
- unlink ("mdadm.tmp.$$") or die;
+if (-f "fedora.mdadm") {
+ $g->upload ("fedora.mdadm", '/etc/mdadm.conf');
+ unlink ("fedora.mdadm") or die;
}
$g->upload ($ENV{SRCDIR}.'/fedora-name.db', '/var/lib/rpm/Name');
@@ -252,8 +252,8 @@ $g->mknod (0777, 10, 10, '/bin/test7');
$g->shutdown ();
$g->close ();
-unlink ("fstab.tmp.$$") or die;
+unlink ("fedora.fstab") or die;
foreach my $img (@images) {
- $img =~ /^(.*)\.tmp\.\d+$/ or die;
+ $img =~ /^(.*)-t$/ or die;
rename ($img, $1) or die;
}
diff --git a/test-data/phony-guests/make-ubuntu-img.sh b/test-data/phony-guests/make-ubuntu-img.sh
index d546aee..a3aa610 100755
--- a/test-data/phony-guests/make-ubuntu-img.sh
+++ b/test-data/phony-guests/make-ubuntu-img.sh
@@ -22,7 +22,7 @@ export LANG=C
set -e
# fstab file.
-cat > fstab.tmp.$$ <<EOF
+cat > ubuntu.fstab <<EOF
LABEL=BOOT /boot ext2 default 0 0
/dev/sda2 / ext2 default 1 2
@@ -31,7 +31,7 @@ LABEL=BOOT /boot ext2 default 0 0
EOF
# lsb-release file.
-cat > release.tmp.$$ <<'EOF'
+cat > ubuntu.release <<'EOF'
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.10
DISTRIB_CODENAME=maverick
@@ -40,7 +40,7 @@ EOF
# Create a disk image.
guestfish <<EOF
-sparse ubuntu.img.tmp.$$ 512M
+sparse ubuntu.img-t 512M
run
# Format the disk.
@@ -68,9 +68,9 @@ mkdir /usr
mkdir-p /var/lib/dpkg
mkdir /var/lib/urandom
-upload fstab.tmp.$$ /etc/fstab
+upload ubuntu.fstab /etc/fstab
write /etc/debian_version "5.0.1"
-upload release.tmp.$$ /etc/lsb-release
+upload ubuntu.release /etc/lsb-release
write /etc/hostname "ubuntu.invalid"
upload $SRCDIR/debian-packages /var/lib/dpkg/status
@@ -81,5 +81,5 @@ mkdir /boot/grub
touch /boot/grub/grub.conf
EOF
-rm fstab.tmp.$$ release.tmp.$$
-mv ubuntu.img.tmp.$$ ubuntu.img
+rm ubuntu.fstab ubuntu.release
+mv ubuntu.img-t ubuntu.img
diff --git a/test-data/phony-guests/make-windows-img.sh b/test-data/phony-guests/make-windows-img.sh
index 0c2fe69..4075238 100755
--- a/test-data/phony-guests/make-windows-img.sh
+++ b/test-data/phony-guests/make-windows-img.sh
@@ -37,7 +37,7 @@ fi
# Create a disk image.
guestfish <<EOF
-sparse windows.img.tmp.$$ 512M
+sparse windows.img-t 512M
run
# Format the disk.
@@ -69,4 +69,4 @@ touch /autoexec.bat
EOF
-mv windows.img.tmp.$$ windows.img
+mv windows.img-t windows.img
--
2.5.0
9 years
[PATCH] build: Remove support for automake < 1.13.
by Richard W.M. Jones
RHEL 6 has automake 1.13.4. Since we have stopped supporting RHEL 5,
there is no need for the complex macro to check for older versions of
automake that didn't have 'serial_tests'.
---
configure.ac | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
diff --git a/configure.ac b/configure.ac
index 88f5568..9fde5c5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -30,22 +30,7 @@ AC_SUBST([RELEASE_DATE], [2015-11-04])
AC_CONFIG_AUX_DIR([build-aux])
-dnl Initialize automake. automake < 1.12 didn't have serial-tests and
-dnl gives an error if it sees this, but for automake >= 1.13
-dnl serial-tests is required so we have to include it. Solution is to
-dnl test for the version of automake (by running an external command)
-dnl and provide it if necessary. Note we have to do this entirely using
-dnl m4 macros since automake queries this macro by running
-dnl 'autoconf --trace'.
-m4_define([serial_tests], [
- m4_esyscmd([automake --version | head -1 | awk '
- {
- split ($NF, version, ".");
- if (version[1] == 1 && version[2] >= 12)
- print "serial-tests";
- }'
- ])
-])
+dnl Initialize automake.
AM_INIT_AUTOMAKE(foreign serial_tests subdir-objects) dnl NB: Do not [quote] this parameter.
m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])
--
2.5.0
9 years