From e61c743644a27f47668d477f35903132f17b24bb Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Fri, 1 Oct 2021 11:52:05 +0200 Subject: [PATCH] test: add option `extraTestScript` This allows extending tests.py. --- test/lib/make-test.nix | 1 + test/lib/test-lib.nix | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/test/lib/make-test.nix b/test/lib/make-test.nix index ab1fec3..e7cf84f 100644 --- a/test/lib/make-test.nix +++ b/test/lib/make-test.nix @@ -42,6 +42,7 @@ name: testConfig: builtins.concatStringsSep "\n\n" [ initData (builtins.readFile ./../tests.py) + cfg.test.extraTestScript # Don't run tests in interactive mode. # is_interactive is set in ../run-tests.sh '' diff --git a/test/lib/test-lib.nix b/test/lib/test-lib.nix index f34c5d9..1de2b18 100644 --- a/test/lib/test-lib.nix +++ b/test/lib/test-lib.nix @@ -19,7 +19,11 @@ with lib; dictionary variable 'test_data'. The data is exported via JSON. ''; }; - + extraTestScript = mkOption { + type = types.lines; + default = ""; + description = "Extra lines added to the Python test script."; + }; container = { # Forwarded to extra-container. For descriptions, see # https://github.com/erikarvstedt/extra-container/blob/master/eval-config.nix