aboutsummaryrefslogtreecommitdiff
path: root/tests/fetch.test
blob: 7fec857af6c0eab6123b444ce47342a2af8ca85e (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# file      : tests/fetch.test
# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
# license   : MIT; see accompanying LICENSE file

.include common.test project.test

new    += 2>!
init   += cc "config.cxx=$config.cxx" -d prj 2>!
status += --all
deinit += -d prj

: add-dependency
:
{
  $clone_prj;
  $init -C prj-cfg @cfg &prj-cfg/***;

  $new -t lib --vcs none libfoo &libfoo/*** 2>!;
  $new -t lib --vcs none libbar &libbar/*** 2>!;

  cat <<EOI >+prj/repositories.manifest;
    :
    role: prerequisite
    location: ../libfoo
    type: dir
    :
    role: complement
    location: ../libbar
    type: dir
    EOI

  $* 2>>/"EOE";
    fetching dir:$~/libbar \(complements dir:$~/prj\)
    fetching dir:$~/libfoo \(prerequisite of dir:$~/prj\)
    EOE

  $status -d prj >'prj configured 0.1.0-a.0.19700101000000';

  $bpkg list --complements --prerequisites -d prj-cfg >>/"EOO";
    dir:$~/prj $~/prj
      complement dir:$~/libbar $~/libbar
      prerequisite dir:$~/libfoo $~/libfoo
    EOO

  $deinit 2>>/"EOE"
    deinitializing in project $~/prj/
    synchronizing:
      drop prj
    EOE
}