aboutsummaryrefslogtreecommitdiff
path: root/tests/function/install/testscript
blob: 12cd506a8db8fddcca8df91e1d51ebff7401059a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# file      : tests/function/install/testscript
# license   : MIT; see accompanying LICENSE file

.include ../../common.testscript

+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?
    <stdin>:1:8: info: while calling install.resolve(dir_path)
  EOE
}