[augeas-devel] [PATCH] Remove some absolute paths for binaries.
Jim Meyering
jim at meyering.net
Thu May 29 17:11:20 UTC 2008
David Lutterkort <dlutter at redhat.com> wrote:
> On Thu, 2008-05-29 at 18:32 +0200, Jim Meyering wrote:
>> You can run a test individually via, e.g.,
>>
>> make check -C tests TESTS=test-lenses.sh
>> make check -C tests TESTS=fatest
>
> I didn't know that ... in that case ACK for the patch.
I realized the definitions of top_builddir and top_srcdir in
TESTS_ENVIRONMENT are no longer needed, so the change-set I
pushed is slightly different:
changeset: 498:31480646df8e
tag: tip
user: Jim Meyering <meyering at redhat.com>
date: Thu May 29 19:09:14 2008 +0200
files: tests/Makefile.am tests/augtest tests/rec-initdefault.rb tests/test-interpreter.sh tests/test-lenses.sh
description:
Remove some absolute paths for binaries.
* tests/Makefile.am [TESTS_ENVIRONMENT]: Add a PATH definition that
lets tests invoke "augtool" and "augparse" without any absolute prefix.
Remove top_builddir and top_srcdir definitions; no longer needed.
* tests/augtest: Remove definition of AUGTOOL. Update use.
* tests/test-lenses.sh: Likewise for AUGPARSE.
* tests/test-interpreter.sh: Likewise.
* tests/rec-initdefault.rb: Use 'augtool -n' in place of #{AUGTOOL}.
diff --git a/tests/Makefile.am b/tests/Makefile.am
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -14,8 +14,8 @@
check_PROGRAMS = fatest
-TESTS_ENVIRONMENT = top_builddir=$(abs_top_builddir) \
- top_srcdir=$(abs_top_srcdir)
+TESTS_ENVIRONMENT = \
+ PATH='$(abs_top_builddir)/src$(PATH_SEPARATOR)'"$$PATH"
TESTS = $(check_SCRIPTS) $(check_PROGRAMS) augtest
diff --git a/tests/augtest b/tests/augtest
--- a/tests/augtest
+++ b/tests/augtest
@@ -23,7 +23,6 @@
TEST_DIR=File::join(TOP_SRCDIR, "tests")
-AUGTOOL="#{TOP_BUILDDIR}/src/augtool -n"
AUGEAS_ROOT=File::join(TOP_BUILDDIR, "build", "augtest")
AUGEAS_LENS_LIB=File::join(TOP_SRCDIR, "lenses")
@@ -63,7 +62,7 @@
redir = echo ? "" : "> /dev/null"
printf("Test %-#{WIDTH}s ... ", File::basename(test, ".rb"))
unless skip
- IO.popen("#{AUGTOOL} #{augtool_check} #{redir}", "w") do |io|
+ IO.popen("augtool -n #{augtool_check} #{redir}", "w") do |io|
io.print(commands)
io.puts("\nquit")
end
diff --git a/tests/rec-initdefault.rb b/tests/rec-initdefault.rb
--- a/tests/rec-initdefault.rb
+++ b/tests/rec-initdefault.rb
@@ -7,7 +7,7 @@
# Query for the record that holds the initdefault
record=""
-`#{AUGTOOL} match '/files/etc/inittab/*/action' initdefault`.each do |l|
+`augtool -n match '/files/etc/inittab/*/action' initdefault`.each do |l|
if l =~ %r{^(/files/etc/inittab/[0-9]+)}
record = $1
end
diff --git a/tests/test-interpreter.sh b/tests/test-interpreter.sh
--- a/tests/test-interpreter.sh
+++ b/tests/test-interpreter.sh
@@ -31,7 +31,7 @@
fi
printf "$action %-30s ... " $(basename $g .aug)
set +e
- errs=$(${AUGPARSE} -I ${MODULES} $g 2>&1 > /dev/null)
+ errs=$(augparse -I ${MODULES} $g 2>&1 > /dev/null)
ret=$?
set -e
if [[ $ret -eq $ret_fail ]]; then
diff --git a/tests/test-lenses.sh b/tests/test-lenses.sh
--- a/tests/test-lenses.sh
+++ b/tests/test-lenses.sh
@@ -12,7 +12,6 @@
[[ -n "$top_srcdir" ]] || top_srcdir=$TOPDIR
-AUGPARSE=${top_builddir}/src/augparse
LENS_DIR=${top_srcdir}/lenses
TESTS=$LENS_DIR/tests/test_*.aug
@@ -23,7 +22,7 @@
do
printf "%-30s ... " $(basename $t .aug)
set +e
- ${AUGPARSE} -I $LENS_DIR $t > $LOG 2>&1
+ augparse -I $LENS_DIR $t > $LOG 2>&1
ret=$?
set -e
if [[ ! $ret -eq 0 ]]; then
More information about the augeas-devel
mailing list