aboutsummaryrefslogtreecommitdiff
path: root/tests/worker/build.test
blob: 3be9150935b18852b81a66633414b06a5621e5c9 (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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# file      : tests/worker/build.test
# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
# license   : TBC; see accompanying LICENSE file

# Note: requires TFTP server (see buildfile).

tftp = 127.0.0.1:55123/test

pkg = hello
ver = 1.0.0

#rep = /home/boris/work/build2/hello/repository/1/stable
rep = https://build2.org/pkg/1/stage/stable
#rep = https://build2.org/pkg/1/hello/stable

rfp = FF:DF:7D:38:67:4E:C3:82:65:7E:EE:1F:D4:80:EC:56:C4:33:5B:65:3F:9B:29:9A:30:56:B9:77:B9:F2:01:94

: pass
:
cat <<"EOI" >=manifest;
  : 1
  name: $pkg
  version: $ver
  repository: $rep
  trust: $rfp
  machine: linux-gcc
  target: x86_64-linux-gnu
  config: config.cc.coptions=-O3
  EOI
$* --verbose 3 --tftp-host "$tftp/$@" cc &x86_64-linux-gnu/*** 2>>"EOE";
  trace: build: bpkg -v create -d x86_64-linux-gnu --wipe config.cc.coptions=-O3 cc
  trace: build: bpkg -v add $rep
  trace: build: bpkg -v fetch --trust $rfp --trust-no
  trace: build: bpkg -v build --configure-only --yes $pkg/$ver
  trace: build: bpkg -v update $pkg
  trace: build: bpkg -v test $pkg
  trace: build: curl -s -S --upload-file - --max-time 10 tftp://$tftp/$@/manifest
  EOE
cat manifest >>~"%EOO%"
  : 1
  name: $pkg
  version: $ver
  status: success
  configure-status: success
  update-status: success
  test-status: success
  configure-log: \\
  %.*%+
  \\
  update-log: \\
  %.*%+
  \\
  test-log: \\
  %.*%+
  \\
  EOO


: fail-abnormal
:
cat <<"EOI" >=manifest;
  : 1
  foo: bar
  EOI
$* --verbose 3 --tftp-host "$tftp/$@" cc 2>>"EOE" != 0
  error: invalid task manifest: manifest:3:1: no task package name specified
  EOE


: fail-configure
:
cat <<"EOI" >=manifest;
  : 1
  name: bogus
  version: 1.2.3
  repository: $rep
  trust: $rfp
  machine: linux-gcc
  target: x86_64-linux-gnu
  EOI
$* --verbose 3 --tftp-host "$tftp/$@" cc &x86_64-linux-gnu/*** 2>>"EOE";
  trace: build: bpkg -v create -d x86_64-linux-gnu --wipe cc
  trace: build: bpkg -v add $rep
  trace: build: bpkg -v fetch --trust $rfp --trust-no
  trace: build: bpkg -v build --configure-only --yes bogus/1.2.3
  trace: build: curl -s -S --upload-file - --max-time 10 tftp://$tftp/$@/manifest
  EOE
cat manifest >>~"%EOO%"
  : 1
  name: bogus
  version: 1.2.3
  status: error
  configure-status: error
  configure-log: \\
  %.*%+
  \\
  EOO


: fail-update
:
cat <<"EOI" >=manifest;
  : 1
  name: $pkg
  version: $ver
  repository: $rep
  trust: $rfp
  machine: linux-gcc
  target: x86_64-linux-gnu
  config: config.cc.loptions=-lbogus
  EOI
$* --verbose 3 --tftp-host "$tftp/$@" cc &x86_64-linux-gnu/*** 2>>"EOE";
  trace: build: bpkg -v create -d x86_64-linux-gnu --wipe config.cc.loptions=-lbogus cc
  trace: build: bpkg -v add $rep
  trace: build: bpkg -v fetch --trust $rfp --trust-no
  trace: build: bpkg -v build --configure-only --yes $pkg/$ver
  trace: build: bpkg -v update $pkg
  trace: build: curl -s -S --upload-file - --max-time 10 tftp://$tftp/$@/manifest
  EOE
cat manifest >>~"%EOO%"
  : 1
  name: $pkg
  version: $ver
  status: error
  configure-status: success
  update-status: error
  configure-log: \\
  %.*%+
  \\
  update-log: \\
  %.*%+
  \\
  EOO