aboutsummaryrefslogtreecommitdiff
path: root/tests/rep-info.testscript
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-08-14 14:36:44 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-08-16 14:53:54 +0300
commited437dbd3483baa3d15d1d86d8f057d9112653b1 (patch)
treecbf3974e8b1774ccccd818442cf042e501190b09 /tests/rep-info.testscript
parent80ee886ca0bd3e41434621a056125c92f31b1aea (diff)
Add support for default options files
Diffstat (limited to 'tests/rep-info.testscript')
-rw-r--r--tests/rep-info.testscript45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/rep-info.testscript b/tests/rep-info.testscript
index 822dada..ed1f1d3 100644
--- a/tests/rep-info.testscript
+++ b/tests/rep-info.testscript
@@ -353,3 +353,48 @@ else
%fragment: \.+%
EOO
}
+
+: default-options-files
+:
+{
+ : specified-dir
+ :
+ {
+ $cfg_create -d cfg 2>! &cfg/***;
+
+ mkdir cfg/.build2;
+
+ echo '--directory .' >= cfg/.build2/bpkg-rep-info.options;
+
+ $* $rep/testing -d cfg 2>>/~%EOE%d != 0;
+ %\.+/specified-dir/cfg/.build2/bpkg-rep-info.options: error: --directory\|-d in default options file%
+ EOE
+
+ # Disable default options files loading.
+ #
+ $* --no-default-options --name $rep/testing -d cfg >>"EOO"
+ pkg:build2.org/rep-info/testing ($rep/testing)
+ EOO
+ }
+
+ : current-dir
+ :
+ {
+ mkdir .bpkg; # Pretend we are in the configuration directory.
+ mkdir .build2;
+
+ echo '--directory .' >= .build2/bpkg-rep-info.options;
+
+ # Load options from the current (configuration) directory.
+ #
+ $* $rep/testing 2>>/~%EOE%d != 0;
+ %\.+/current-dir/.build2/bpkg-rep-info.options: error: --directory\|-d in default options file%
+ EOE
+
+ # Disable loading options from the current (configuration) directory.
+ #
+ $* --name -d '' $rep/testing >>"EOO"
+ pkg:build2.org/rep-info/testing ($rep/testing)
+ EOO
+ }
+}