bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: misc/groups-dash fails due to enable-no-install-program=groups


From: Jim Meyering
Subject: Re: misc/groups-dash fails due to enable-no-install-program=groups
Date: Thu, 12 Mar 2009 14:44:57 +0100

Mike Frysinger wrote:
> On Thursday 12 March 2009 09:05:25 Jim Meyering wrote:
>> Mike Frysinger wrote:
>> > it's been a while, so i dont remember if this has been reported already,
>> > but if groups is disabled via the command line, the misc/groups-dash test
>> > is still run.  since the groups program is not coming from coreutils, the
>> > output is not as expected and things fail.  perhaps a new func in
>> > test-lib.sh like: require_program_()
>> > {
>> >   test -x "$abs_top_builddir/src/$1" || \
>> >     skip_test_ "the $1 program was disabled"
>> > }
>> > and then the groups test can do:
>> > require_program_ groups

Here's a patch to address that, plus one more in related territory:

>From 5f1733399c45c487e90d5e01e6283f3648a15060 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Thu, 12 Mar 2009 14:40:45 +0100
Subject: [PATCH 1/2] tests: skip the groups-dash test when "groups" is not built

* tests/misc/groups-dash: Skip if groups is not being installed.
Suggested by Mike Frysinger.
Also fail if groups exits with nonzero status.
---
 tests/misc/groups-dash |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/misc/groups-dash b/tests/misc/groups-dash
index 01a507d..7fc154d 100755
--- a/tests/misc/groups-dash
+++ b/tests/misc/groups-dash
@@ -1,7 +1,7 @@
 #!/bin/sh
 # ensure groups handles -- sanely

-# Copyright (C) 2007-2008 Free Software Foundation, Inc.
+# Copyright (C) 2007-2009 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
@@ -22,13 +22,14 @@ if test "$VERBOSE" = yes; then
 fi

 . $srcdir/test-lib.sh
+require_built_ groups

 # Coreutils 6.9 and earlier failed to display information on first argument
 # if later argument was --.
 fail=0
-groups none -- > out 2>&1
+groups none -- > out 2>&1 || fail=1
 echo $? >> out
-groups -- none -- > exp 2>&1
+groups -- none -- > exp 2>&1 || fail=1
 echo $? >> exp

 compare out exp || fail=1
--
1.6.2.rc1.285.gc5f54


>From 9b6e1e9618080d278f970fe686f76daec2fb7c06 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Thu, 12 Mar 2009 14:41:38 +0100
Subject: [PATCH 2/2] tests: groups-version: don't require that id be built

* tests/misc/groups-version: groups is now independent of id.
---
 tests/misc/groups-version |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/misc/groups-version b/tests/misc/groups-version
index 1862045..41e3c71 100755
--- a/tests/misc/groups-version
+++ b/tests/misc/groups-version
@@ -1,7 +1,7 @@
 #!/bin/sh
 # ensure groups --version output is similar to id --version

-# Copyright (C) 2007-2008 Free Software Foundation, Inc.
+# Copyright (C) 2007-2009 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
@@ -22,7 +22,7 @@ if test "$VERBOSE" = yes; then
 fi

 . $srcdir/test-lib.sh
-require_built_ groups id
+require_built_ groups

 fail=0
 groups --version | sed 's/^groups/id/; /^$/q' > out || fail=1
--
1.6.2.rc1.285.gc5f54




reply via email to

[Prev in Thread] Current Thread [Next in Thread]