aboutsummaryrefslogtreecommitdiff
path: root/tests/config.test
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-02-22 00:58:53 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-03-15 19:15:55 +0300
commita791b1ce0fa2bc9859474fb6f7a9c0ff8cbd1d4a (patch)
tree3c9823a54e6e28a8c8f9fb281d82ad2a67c117ba /tests/config.test
parent755a99a7ebf24e00675e2f2e0f5184825ad74c4a (diff)
Port test.sh to testscript
Diffstat (limited to 'tests/config.test')
-rw-r--r--tests/config.test27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/config.test b/tests/config.test
new file mode 100644
index 0000000..c40d24b
--- /dev/null
+++ b/tests/config.test
@@ -0,0 +1,27 @@
+# file : tests/config.test
+# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
+# license : MIT; see accompanying LICENSE file
+
+# Create an empty configuration that will be copied by subsequent tests and
+# scopes setup commands. The common approach will be that group scopes copy and
+# modify the parent scope configuration as required by the nested tests and
+# scopes. Tests will also clone the parent scope configuration to optionally
+# modify it, use and cleanup at the end. Note that configuration can not be
+# shared between multiple bpkg processes. Also we need to make sure that
+# configurations are not cloned while being used by bpkg.
+#
++$cfg_create -d cfg 2>- &cfg/***
+
+# The most commonly used configuration cloning command that copies it from the
+# parent scope working directory.
+#
+clone_cfg = cp -r ../cfg ./
+
+# Clones the original (presumably empty) configuration from the root scope
+# working directory.
+#
+clone_root_cfg = cp -r $~/cfg ./
+
+# Setup a test command to use a cloned configuration directory by default.
+#
+test.arguments += -d cfg