aboutsummaryrefslogtreecommitdiff
path: root/tests/worker/build.testscript
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-09-04 15:09:13 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-09-04 15:09:13 +0300
commitf399c3b02c8a97f20d92245cf6b3d0b6b0e1e874 (patch)
tree6d3207da4a3499910c50fcc53aab88c8dcb48311 /tests/worker/build.testscript
parent273fa333112b16811d15755ebe55defb9508c073 (diff)
Rename .test/test{} to .testscript/testscript{}
Diffstat (limited to 'tests/worker/build.testscript')
-rw-r--r--tests/worker/build.testscript137
1 files changed, 137 insertions, 0 deletions
diff --git a/tests/worker/build.testscript b/tests/worker/build.testscript
new file mode 100644
index 0000000..3d32e0a
--- /dev/null
+++ b/tests/worker/build.testscript
@@ -0,0 +1,137 @@
+# file : tests/worker/build.testscript
+# copyright : Copyright (c) 2014-2018 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_url = /home/boris/work/build2/hello/repository/1/stable
+rep_url = https://build2.org/pkg/1/stage/stable
+#rep_url = https://build2.org/pkg/1/hello/stable
+rep_type = pkg
+
+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-url: $rep_url
+ repository-type: $rep_type
+ 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_url
+ 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-url: $rep_url
+ repository-type: $rep_type
+ 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_url
+ 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-url: $rep_url
+ repository-type: $rep_type
+ 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_url
+ 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