aboutsummaryrefslogtreecommitdiff
path: root/tests/common.testscript
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-08-19 23:41:49 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-08-22 12:52:58 +0300
commita37431f8109cb67937ad5356e8209a7151ad5a61 (patch)
treeff0f37fbf7d1bb9a36a9349a67676d9d145bdee4 /tests/common.testscript
parent1508c382589fe62b7d8829c9cd23ba5ab4bdf913 (diff)
Make testscripts to ignore user's default options files
Diffstat (limited to 'tests/common.testscript')
-rw-r--r--tests/common.testscript24
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/common.testscript b/tests/common.testscript
index 1914625..2340491 100644
--- a/tests/common.testscript
+++ b/tests/common.testscript
@@ -13,7 +13,29 @@
# produced or updated by a command being tested.
#
build = $recall($build.path)
-test.options += --build $build
+
+# Disable loading the user's default options files (that may affect the test
+# commands execution) for bdep, bpkg, and build2.
+#
+options_guard = $~/.build2
++mkdir $options_guard
+
++echo '--no-default-options' >=$options_guard/b.options
++echo '--no-default-options' >=$options_guard/bpkg.options
++echo '--no-default-options' >=$options_guard/bdep.options
+
+test.options += --default-options $options_guard \
+--build $build --build-option "--default-options=$options_guard" \
+--bpkg-option "--default-options=$options_guard" \
+--bpkg-option "--build-option=--default-options=$options_guard"
+
+build = $build --default-options $options_guard
+
++cat <<"EOI" >=$options_guard/bdep-sync-implicit.options
+--build-option "--default-options=$options_guard"
+--bpkg-option "--default-options=$options_guard"
+--bpkg-option "--build-option=--default-options=$options_guard"
+EOI
# Check that git version is the minimum supported one or above. The lowest
# common denominator for bdep commands is 2.1.0.