From ed437dbd3483baa3d15d1d86d8f057d9112653b1 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 14 Aug 2019 14:36:44 +0300 Subject: Add support for default options files --- tests/rep-info.testscript | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'tests/rep-info.testscript') 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 + } +} -- cgit v1.1