aboutsummaryrefslogtreecommitdiff
path: root/tests/b-info/testscript
blob: 2ec5f4e30ffa120d802a2fd8a4cc2e324458de68 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# file      : tests/b-info/testscript
# license   : MIT; see accompanying LICENSE file

# Note that when cross-testing we unlikely be able to run build2 on the
# target platform.
#
+if ($test.target != $build.host)
  exit
end

sp = ' '
test.options += -b $recall($build.path)

: basic
:
{
  mkdir -p prj/build;

  cat <<EOI >=prj/build/bootstrap.build;
    project = prj

    using version
    using config
    using dist
    EOI

  cat <<EOI >=prj/buildfile;
    ./: subprj/
    EOI

  cat <<EOI >=prj/manifest;
    : 1
    name: prj
    version: 1.2.3-a.0.z
    summary: test project
    license: MIT
    EOI

  mkdir -p prj/subprj/build;

  cat <<EOI >=prj/subprj/build/bootstrap.build;
    project =

    using config
    using dist
    EOI

  touch prj/subprj/buildfile;

  # Note: may produce an actual version snapshot id if the testscript runs
  # inside the libbutl project source directory.
  #
  $* prj >>/~"%EOO%";
    project: prj
    %version: 1.2.3-a.0.\\.+%d
    summary: test project
    url:$sp
    %src_root: .+/prj/%
    %out_root: .+/prj/%
    amalgamation: ../../../../
    subprojects: @subprj/
    operations: update clean
    meta-operations: perform configure disfigure dist info
    modules: version config dist
    EOO

  $* prj/subprj >>/~"%EOO%"
    project:$sp
    version:$sp
    summary:$sp
    url:$sp
    %src_root: .+/subprj/%
    %out_root: .+/subprj/%
    amalgamation: ../
    subprojects:$sp
    operations: update clean
    meta-operations: perform configure disfigure dist info
    modules: config dist
    EOO
}

: error
:
$* prj 2>>/~%EOE% != 0
  %error: .+%
  %  info: .+%?
  EOE