aboutsummaryrefslogtreecommitdiff
path: root/tests
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
parent80ee886ca0bd3e41434621a056125c92f31b1aea (diff)
Add support for default options files
Diffstat (limited to 'tests')
-rw-r--r--tests/rep-create.testscript17
-rw-r--r--tests/rep-info.testscript45
2 files changed, 62 insertions, 0 deletions
diff --git a/tests/rep-create.testscript b/tests/rep-create.testscript
index 487acf0..a7b9e19 100644
--- a/tests/rep-create.testscript
+++ b/tests/rep-create.testscript
@@ -147,6 +147,23 @@
EOO
}
+ : remote-key-option-failure
+ :
+ : Test that bpkg-rep-create fails for the remote --key option.
+ :
+ {
+ $clone_rep;
+
+ touch .git; # Pretend we are in the git repository.
+
+ mkdir .build2;
+ echo "--key $key" >=.build2/bpkg-rep-create.options;
+
+ $* 1/stable/ 2>>/~%EOE% != 0
+ %.+/bpkg-rep-create.options: error: --key <name> in remote default options file%
+ EOE
+ }
+
: without-key
:
$clone_rep;
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
+ }
+}