about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorRobert Hensing2024-08-12 13:15:50 +0200
committerRobert Hensing2024-08-12 13:47:36 +0200
commitc516c03bf4296809ee0f6db30cd02b08ba71ebe8 (patch)
tree41f6b2564fdc326271f8d04433dbbc16ab76edae /lib
parent8a6c85d88678f53143e63542649e7836d699e9ac (diff)
lib/tests/modules.sh: Do not redirect diagnostics to stdout
It still prints its own diagnostics to stdout, but it's always done that.
Diffstat (limited to 'lib')
-rwxr-xr-xlib/tests/modules.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/tests/modules.sh b/lib/tests/modules.sh
index 06713ec3ef67..7dcfa5231cd1 100755
--- a/lib/tests/modules.sh
+++ b/lib/tests/modules.sh
@@ -13,7 +13,7 @@ set -o errexit -o noclobber -o nounset -o pipefail
 shopt -s failglob inherit_errexit
 
 # https://stackoverflow.com/a/246128/6605742
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
 
 cd "$DIR"/modules
 
@@ -40,7 +40,7 @@ reportFailure() {
     local attr=$1
     shift
     local script="import ./default.nix { modules = [ $* ];}"
-    echo 2>&1 "$ nix-instantiate -E '$script' -A '$attr' --eval-only --json"
+    echo "$ nix-instantiate -E '$script' -A '$attr' --eval-only --json"
     evalConfig "$attr" "$@" || true
     ((++fail))
 }
@@ -52,7 +52,7 @@ checkConfigOutput() {
         ((++pass))
     else
         echo "test failure at $(loc):"
-        echo 2>&1 "error: Expected result matching '$outputContains', while evaluating"
+        echo "error: Expected result matching '$outputContains', while evaluating"
         reportFailure "$@"
     fi
 }
@@ -63,14 +63,14 @@ checkConfigError() {
     shift
     if err="$(evalConfig "$@" 2>&1 >/dev/null)"; then
         echo "test failure at $(loc):"
-        echo 2>&1 "error: Expected error code, got exit code 0, while evaluating"
+        echo "error: Expected error code, got exit code 0, while evaluating"
         reportFailure "$@"
     else
         if echo "$err" | grep -zP --silent "$errorContains" ; then
             ((++pass))
         else
             echo "test failure at $(loc):"
-            echo 2>&1 "error: Expected error matching '$errorContains', while evaluating"
+            echo "error: Expected error matching '$errorContains', while evaluating"
             reportFailure "$@"
         fi
     fi