about summary refs log tree commit diff stats
path: root/tests/infrastructure/driver.sh
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-11-24 18:01:02 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-11-24 18:24:58 +0100
commit445ee1fa4a9e82250d21c66ba957a1e19077efd9 (patch)
tree6efbe6a5fe6fcad0da3b57443b246f53eaa81588 /tests/infrastructure/driver.sh
parentfix(modules/nvim/opts): Ensure a consistent fileformat (diff)
downloadnixos-config-445ee1fa4a9e82250d21c66ba957a1e19077efd9.tar.gz
nixos-config-445ee1fa4a9e82250d21c66ba957a1e19077efd9.zip
tests(infrastructure/driver): Support setting the golden file
Diffstat (limited to '')
-rw-r--r--tests/infrastructure/driver.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/infrastructure/driver.sh b/tests/infrastructure/driver.sh
index 52f7d3ad..f8688161 100644
--- a/tests/infrastructure/driver.sh
+++ b/tests/infrastructure/driver.sh
@@ -63,6 +63,15 @@ __test_eval() {
                 ;;
             esac
             ;;
+        "SetGolden")
+            msg "Trying to set '$args' as golden file."
+            [ -f "$args" ] || {
+                msg "Argument is not a file!"
+                exit 1
+            }
+            printf "%s" "$args" >"$__TEST_EVAL_GOLDEN_FILE"
+            msg "Set golden file to: '$args'"
+            ;;
         *)
             msg "Unrecognized command: '$cmd'"
             exit 1