aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-09-08 16:16:11 +0200
committerKaren Arutyunov <karen@codesynthesis.com>2017-09-11 13:57:29 +0300
commitffa0839de796fbefc48bacc4777648ff19b3fee6 (patch)
tree0f493314df633b6f35f9b9db78c7163506c8eed1 /tests
parent66e516ad81225b888469b24e726095533c4f9c4c (diff)
Add ability to pass scope to buildfile functions, add $install.resolve()
Diffstat (limited to 'tests')
-rw-r--r--tests/function/install/buildfile5
-rw-r--r--tests/function/install/testscript33
2 files changed, 38 insertions, 0 deletions
diff --git a/tests/function/install/buildfile b/tests/function/install/buildfile
new file mode 100644
index 0000000..356ca77
--- /dev/null
+++ b/tests/function/install/buildfile
@@ -0,0 +1,5 @@
+# file : tests/function/install/buildfile
+# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
+# license : MIT; see accompanying LICENSE file
+
+./: test{testscript} $b
diff --git a/tests/function/install/testscript b/tests/function/install/testscript
new file mode 100644
index 0000000..b0a0172
--- /dev/null
+++ b/tests/function/install/testscript
@@ -0,0 +1,33 @@
+# file : tests/function/install/testscript
+# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
+# license : MIT; see accompanying LICENSE file
+
+.include ../../common.test
+
++cat <<EOI >+build/bootstrap.build
+using config
+using install
+EOI
+
+root = ($cxx.target.class != 'windows' ? '/usr/' : 'C:\')
+
++cat <<"EOI" >=build/config.build
+config.version = 1
+config.install.root = $root
+EOI
+
+: realize
+:
+{
+ : existing
+ :
+ a = ($cxx.target.class != 'windows' ? '/usr/lib/a/' : 'C:\lib\a\');
+ $* <'print $install.resolve([dir_path] lib/a)' >$a
+
+ : non-existing
+ :
+ $* <'print $install.resolve([dir_path] foo/a)' 2>>EOE != 0
+ error: unknown installation directory name 'foo'
+ info: did you forget to specify config.install.foo?
+ EOE
+}