[augeas-devel] [PATCH 3 of 3] Use --nostdinc in tests
David Lutterkort
lutter at redhat.com
Mon Sep 8 23:39:09 UTC 2008
10 files changed, 15 insertions(+), 13 deletions(-)
src/try | 8 ++++----
tests/augtest | 2 +-
tests/test-bug-1.sh | 2 +-
tests/test-get.sh | 2 +-
tests/test-interpreter.sh | 2 +-
tests/test-lenses.sh | 2 +-
tests/test-mv.sh | 3 ++-
tests/test-put-symlink.sh | 2 +-
tests/test-save-empty.sh | 3 ++-
tests/test-valgrind.sh | 2 +-
# HG changeset patch
# User David Lutterkort <dlutter at redhat.com>
# Date 1220917106 25200
# Node ID 82b2999874f0a1331fb3c63b0a0776e96f6d87a7
# Parent 23f8be079bbab4e16c3a7b112308f9a149d4d0b7
Use --nostdinc in tests
We never want to use installed lenses in the tests; they should only be
read from the directories that are specified explicitly
diff -r 23f8be079bba -r 82b2999874f0 src/try
--- a/src/try Mon Sep 08 16:34:19 2008 -0700
+++ b/src/try Mon Sep 08 16:38:26 2008 -0700
@@ -26,14 +26,14 @@
cd $topdir/src
if [[ "x$1" == "xgdb" ]] ; then
- libtool --mode=execute gdb -x $GDBCMDS ./augtool
+ libtool --mode=execute gdb -x $GDBCMDS ./augtool --nostdinc
elif [[ "x$1" == "xvalgrind" ]] ; then
- libtool --mode=execute valgrind --leak-check=full ./augtool < $AUGCMDS
+ libtool --mode=execute valgrind --leak-check=full ./augtool --nostdinc < $AUGCMDS
elif [[ "x$1" == "xcli" ]] ; then
shift
- ./augtool "$@"
+ ./augtool --nostdinc "$@"
else
- ./augtool "$@" < $AUGCMDS
+ ./augtool --nostdinc "$@" < $AUGCMDS
echo
for f in $(find $AUGEAS_ROOT -name \*.augnew); do
echo "File $f"
diff -r 23f8be079bba -r 82b2999874f0 tests/augtest
--- a/tests/augtest Mon Sep 08 16:34:19 2008 -0700
+++ b/tests/augtest Mon Sep 08 16:38:26 2008 -0700
@@ -62,7 +62,7 @@
redir = echo ? "" : "> /dev/null"
printf("Test %-#{WIDTH}s ... ", File::basename(test, ".rb"))
unless skip
- IO.popen("augtool -n #{augtool_check} #{redir}", "w") do |io|
+ IO.popen("augtool --nostdinc -n #{augtool_check} #{redir}", "w") do |io|
io.print(commands)
io.puts("\nquit")
end
diff -r 23f8be079bba -r 82b2999874f0 tests/test-bug-1.sh
--- a/tests/test-bug-1.sh Mon Sep 08 16:34:19 2008 -0700
+++ b/tests/test-bug-1.sh Mon Sep 08 16:38:26 2008 -0700
@@ -18,7 +18,7 @@
EOF
ln $file $file.orig
-augtool -I $abs_top_srcdir/lenses -r $root > /dev/null <<EOF
+augtool --nostdinc -I $abs_top_srcdir/lenses -r $root > /dev/null <<EOF
ins invalid before /files/etc/logrotate.d/test/rule
save
EOF
diff -r 23f8be079bba -r 82b2999874f0 tests/test-get.sh
--- a/tests/test-get.sh Mon Sep 08 16:34:19 2008 -0700
+++ b/tests/test-get.sh Mon Sep 08 16:38:26 2008 -0700
@@ -9,5 +9,5 @@
export AUGEAS_LENS_LIB=$abs_top_srcdir/lenses
export AUGEAS_ROOT=$abs_top_srcdir/tests/root
-augtool print '/augeas/files' | grep -q /error && ret=1 || ret=0
+augtool --nostdinc print '/augeas/files' | grep -q /error && ret=1 || ret=0
exit $ret
diff -r 23f8be079bba -r 82b2999874f0 tests/test-interpreter.sh
--- a/tests/test-interpreter.sh Mon Sep 08 16:34:19 2008 -0700
+++ b/tests/test-interpreter.sh Mon Sep 08 16:38:26 2008 -0700
@@ -32,7 +32,7 @@
fi
printf "$action %-30s ... " $(basename $g .aug)
set +e
- errs=$(augparse -I ${MODULES} $g 2>&1 > /dev/null)
+ errs=$(augparse --nostdinc -I ${MODULES} $g 2>&1 > /dev/null)
ret=$?
set -e
if [ $ret -eq $ret_fail ]; then
diff -r 23f8be079bba -r 82b2999874f0 tests/test-lenses.sh
--- a/tests/test-lenses.sh Mon Sep 08 16:34:19 2008 -0700
+++ b/tests/test-lenses.sh Mon Sep 08 16:38:26 2008 -0700
@@ -22,7 +22,7 @@
do
printf "%-30s ... " $(basename "$t" .aug)
set +e
- augparse -I "$LENS_DIR" "$t" > "$LOG" 2>&1
+ augparse --nostdinc -I "$LENS_DIR" "$t" > "$LOG" 2>&1
ret=$?
set -e
if [ ! $ret -eq 0 ]; then
diff -r 23f8be079bba -r 82b2999874f0 tests/test-mv.sh
--- a/tests/test-mv.sh Mon Sep 08 16:34:19 2008 -0700
+++ b/tests/test-mv.sh Mon Sep 08 16:38:26 2008 -0700
@@ -1,7 +1,8 @@
#! /bin/bash
aug_mv() {
-(augtool -r /dev/null | grep -v '/augeas\|augtool' | tr '\n' ' ') <<EOF
+opts='--nostdinc -r /dev/null'
+(augtool $opts | grep -v '/augeas\|augtool' | tr '\n' ' ') <<EOF
set /a/b/c value
mv $1 $2
print
diff -r 23f8be079bba -r 82b2999874f0 tests/test-put-symlink.sh
--- a/tests/test-put-symlink.sh Mon Sep 08 16:34:19 2008 -0700
+++ b/tests/test-put-symlink.sh Mon Sep 08 16:38:26 2008 -0700
@@ -16,7 +16,7 @@
(cd $(dirname $HOSTS) && ln -s ../other/hosts $(basename $HOSTS))
-augtool -b -r $ROOT > /dev/null <<EOF
+augtool --nostdinc -b -r $ROOT > /dev/null <<EOF
set /files/etc/hosts/1/alias myhost
save
EOF
diff -r 23f8be079bba -r 82b2999874f0 tests/test-save-empty.sh
--- a/tests/test-save-empty.sh Mon Sep 08 16:34:19 2008 -0700
+++ b/tests/test-save-empty.sh Mon Sep 08 16:38:26 2008 -0700
@@ -4,7 +4,8 @@
# but that we do create new files correctly
save_hosts() {
-(augtool -r $ROOT -I $abs_top_srcdir/lenses | grep ^/augeas) <<EOF
+opts="--nostdinc -r $ROOT -I $abs_top_srcdir/lenses"
+(augtool $opts | grep ^/augeas) <<EOF
set /files/etc/hosts/1/ipaddr 127.0.0.1
set /files/etc/hosts/1/canonical localhost
save
diff -r 23f8be079bba -r 82b2999874f0 tests/test-valgrind.sh
--- a/tests/test-valgrind.sh Mon Sep 08 16:34:19 2008 -0700
+++ b/tests/test-valgrind.sh Mon Sep 08 16:38:26 2008 -0700
@@ -16,5 +16,5 @@
do
echo Run $(basename $t .aug)
set +e
- ${AUGPARSE} -I $LENS_DIR $t
+ ${AUGPARSE} --nostdinc -I $LENS_DIR $t
done
More information about the augeas-devel
mailing list