aboutsummaryrefslogtreecommitdiff
path: root/tests/fetch.testscript
blob: b10d3c403fe1e0958661f08ce1dd90050ec65631 (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
51
52
53
54
# file      : tests/fetch.testscript
# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd
# license   : MIT; see accompanying LICENSE file

.include common.testscript project.testscript

config_cxx = cc config.cxx=$quote($recall($cxx.path) $cxx.mode, true)

new    += 2>!
init   += $config_cxx -d prj 2>!
status += --all -d prj
deinit += -d prj

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

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

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

  cat <<EOI >+prj/manifest;
    depends: libfoo
    depends: libbar
    EOI

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

  $status libfoo libbar >>~%EOO%;
    %libfoo available \[.+\]%
    %libbar available .+%
    EOO

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