aboutsummaryrefslogtreecommitdiff
path: root/tests/fetch.test
blob: ad0640eb40475981c62e1e056b8653892714440f (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
# 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

: add-dependency
:
{
  $clone_prj;
  $init -C prj-cfg @cfg &prj/build/bootstrap/*** &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
}