diff options
Diffstat (limited to 'tests/manifest')
-rw-r--r-- | tests/manifest/buildfile | 1 | ||||
-rw-r--r-- | tests/manifest/driver.cxx | 11 | ||||
-rw-r--r-- | tests/manifest/machine-header.testscript | 19 | ||||
-rw-r--r-- | tests/manifest/result-request.testscript | 32 | ||||
-rw-r--r-- | tests/manifest/result.testscript | 32 | ||||
-rw-r--r-- | tests/manifest/task-request.testscript | 81 | ||||
-rw-r--r-- | tests/manifest/task-response.testscript | 60 | ||||
-rw-r--r-- | tests/manifest/task.testscript | 192 |
8 files changed, 403 insertions, 25 deletions
diff --git a/tests/manifest/buildfile b/tests/manifest/buildfile index dd469ab..7dc2517 100644 --- a/tests/manifest/buildfile +++ b/tests/manifest/buildfile @@ -1,5 +1,4 @@ # file : tests/manifest/buildfile -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file import libs = libbutl%lib{butl} diff --git a/tests/manifest/driver.cxx b/tests/manifest/driver.cxx index df5abf8..9c0fcf9 100644 --- a/tests/manifest/driver.cxx +++ b/tests/manifest/driver.cxx @@ -1,18 +1,19 @@ // file : tests/manifest/driver.cxx -*- C++ -*- -// copyright : Copyright (c) 2014-2019 Code Synthesis Ltd // license : MIT; see accompanying LICENSE file #include <ios> // ios_base::failbit, ios_base::badbit #include <string> -#include <cassert> #include <iostream> -#include <libbutl/utility.mxx> // operator<<(ostream,exception) -#include <libbutl/manifest-parser.mxx> -#include <libbutl/manifest-serializer.mxx> +#include <libbutl/utility.hxx> // operator<<(ostream,exception) +#include <libbutl/manifest-parser.hxx> +#include <libbutl/manifest-serializer.hxx> #include <libbbot/manifest.hxx> +#undef NDEBUG +#include <cassert> + using namespace std; using namespace butl; using namespace bbot; diff --git a/tests/manifest/machine-header.testscript b/tests/manifest/machine-header.testscript index c9ea898..559a107 100644 --- a/tests/manifest/machine-header.testscript +++ b/tests/manifest/machine-header.testscript @@ -1,5 +1,4 @@ # file : tests/manifest/machine-header.testscript -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file test.options += -m @@ -14,6 +13,8 @@ test.options += -m id: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 name: windows_10-msvc_14 summary: Windows 10 build 1607 with VC 14 update 3 + role: build + ram-minimum: 4194304 EOF } @@ -53,6 +54,22 @@ EOI summary: Windows summary: Windows EOI + + : ram-maximum + : + $* <<EOI 2>'stdin:3:1: error: machine maximum RAM redefinition' == 1 + : 1 + ram-maximum: 4194304 + ram-maximum: 4194304 + EOI + + : role + : + $* <<EOI 2>'stdin:3:1: error: machine role redefinition' == 1 + : 1 + role: build + role: auxiliary + EOI } : empty diff --git a/tests/manifest/result-request.testscript b/tests/manifest/result-request.testscript index cd001c1..6d0e5b1 100644 --- a/tests/manifest/result-request.testscript +++ b/tests/manifest/result-request.testscript @@ -1,5 +1,4 @@ # file : tests/manifest/result-request.testscript -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file test.options += -rq @@ -15,10 +14,12 @@ test.options += -rq : 1 session: abcd challenge: YQo= + agent-checksum: 1 : name: libfoo version: 1.0 status: error + worker-checksum: 1 EOF : no-challenge @@ -26,10 +27,12 @@ test.options += -rq $* <<EOF >>EOF : 1 session: abcd + agent-checksum: 1 : name: libfoo version: 1.0 status: error + worker-checksum: 1 EOF } @@ -52,6 +55,14 @@ test.options += -rq challenge: YQo= challenge: YQo= EOI + + : agent-checksum + : + $* <<EOI 2>'stdin:3:1: error: result request agent checksum redefinition' == 1 + : 1 + agent-checksum: 1 + agent-checksum: 1 + EOI } : invalid @@ -77,6 +88,13 @@ test.options += -rq : 1 challenge: EOI + + : empty-agent-checksum + : + $* <<EOI 2>'stdin:2:16: error: empty result request agent checksum' == 1 + : 1 + agent-checksum: + EOI } : unknown-name @@ -96,11 +114,21 @@ EOI challenge: YQo= EOI + + : agent-checksum + : + $* <<EOI 2>'stdin:4:1: error: no result request agent checksum specified' == 1 + : 1 + session: abc + challenge: YQo= + EOI + : result : - $* <<EOI 2>'stdin:4:1: error: result manifest expected' == 1 + $* <<EOI 2>'stdin:5:1: error: result manifest expected' == 1 : 1 session: abc challenge: YQo= + agent-checksum: 1 EOI } diff --git a/tests/manifest/result.testscript b/tests/manifest/result.testscript index b6c9785..b48a691 100644 --- a/tests/manifest/result.testscript +++ b/tests/manifest/result.testscript @@ -1,5 +1,4 @@ # file : tests/manifest/result.testscript -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file test.options += -r @@ -19,18 +18,20 @@ test.options += -r configure-status: success update-status: warning test-status: error - configure-log: \ + configure-log:\ conf line 1 conf line 2 \ - update-log: \ + update-log:\ update line 1 update line 2 \ - test-log: \ + test-log:\ test line 1 test line 2 \ + worker-checksum: 1 + dependency-checksum: 12345 EOF : update-error @@ -42,14 +43,16 @@ test.options += -r status: error configure-status: warning update-status: error - configure-log: \ + configure-log:\ conf line 1 conf line 2 \ - update-log: \ + update-log:\ update line 1 update line 2 \ + worker-checksum: 1 + dependency-checksum: 12345 EOF : early-abort @@ -107,12 +110,20 @@ test.options += -r configure-log: configured configure-log: configured EOI + + : worker-checksum + : + $* <<EOI 2>'stdin:3:1: error: result worker checksum redefinition' == 1 + : 1 + worker-checksum: 1 + worker-checksum: 1 + EOI } : invalid : { - : name-empty + : empty-name : $* <<EOI 2>'stdin:2:6: error: invalid result package name: length is less than two characters' == 1 : 1 @@ -182,6 +193,13 @@ test.options += -r update-log: log EOI } + + : empty-worker-checksum + : + $* <<EOI 2>'stdin:2:17: error: empty result worker checksum' == 1 + : 1 + worker-checksum: + EOI } : unknown-name diff --git a/tests/manifest/task-request.testscript b/tests/manifest/task-request.testscript index fecf849..79f3982 100644 --- a/tests/manifest/task-request.testscript +++ b/tests/manifest/task-request.testscript @@ -1,5 +1,4 @@ # file : tests/manifest/task-request.testscript -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file test.options += -tq @@ -16,7 +15,10 @@ test.options += -tq agent: upsa toolchain-name: queue toolchain-version: 0.5.0 + interactive-mode: both + interactive-login: 10.5.0.1:5901 fingerprint: 1105fb394ee870adb154b7abfbbae5755df7dcef6c81db34e8d1b68d2653734e + auxiliary-ram: 41943040 : id: a2b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 name: windows_10-msvc_14 @@ -71,6 +73,14 @@ test.options += -tq fingerprint: 1105fb394ee870adb154b7abfbbae5755df7dcef6c81db34e8d1b68d2653734e fingerprint: 1105fb394ee870adb154b7abfbbae5755df7dcef6c81db34e8d1b68d2653734e EOI + + : auxiliary-ram + : + $* <<EOI 2>'stdin:3:1: error: auxiliary machines RAM limit redefinition' == 1 + : 1 + auxiliary-ram: 41943040 + auxiliary-ram: 41943040 + EOI } : empty @@ -89,6 +99,13 @@ test.options += -tq : 1 toolchain-name: EOI + + : auxiliary-ram + : + $* <<EOI 2>'stdin:2:15: error: auxiliary machines RAM limit should be 64-bit unsigned integer' == 1 + : 1 + auxiliary-ram: + EOI } : invalid-toolchain-version @@ -125,3 +142,65 @@ toolchain-name: queue toolchain-version: 0.5.0 fingerprint: 1105fb394ee870adb154b7abfbbae5755df7dcef6c81db34e8d1b68d2653734e EOI + +: interactive +: +{ + : redefinition + : + { + : mode + : + $* <<EOI 2>'stdin:3:1: error: task request interactive mode redefinition' == 1 + : 1 + interactive-mode: true + interactive-mode: both + EOI + + : login + : + $* <<EOI 2>'stdin:3:1: error: task request interactive login redefinition' == 1 + : 1 + interactive-login: 10.5.0.1:5901 + interactive-login: 10.5.0.1:5901 + EOI + } + + : invalid + : + { + : mode + : + $* <<EOI 2>"stdin:2:19: error: invalid task request interactive mode 'on'" == 1 + : 1 + interactive-mode: on + EOI + + : login + : + $* <<EOI 2>'stdin:2:19: error: empty task request interactive login' == 1 + : 1 + interactive-login: + EOI + } + + : no-login + : + $* <<EOI 2>'stdin:6:1: error: no task request interactive login specified' == 1 + : 1 + agent: upsa + toolchain-name: queue + toolchain-version: 0.5.0 + interactive-mode: both + EOI + + : unexpected-login + : + $* <<EOI 2>'stdin:5:1: error: interactive login specified for non-interactive mode' == 1 + : 1 + agent: upsa + toolchain-name: queue + toolchain-version: 0.5.0 + interactive-login: 10.5.0.1:5901 + EOI +} diff --git a/tests/manifest/task-response.testscript b/tests/manifest/task-response.testscript index 45bae22..7615127 100644 --- a/tests/manifest/task-response.testscript +++ b/tests/manifest/task-response.testscript @@ -1,5 +1,4 @@ # file : tests/manifest/task-response.testscript -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file test.options += -ts @@ -19,6 +18,8 @@ test.options += -ts session: abcd challenge: cc6585375ef81898cc60791b11852e3d2ed9ebb82ebb0874010fe0e6f9ebdb73 result-url: https://cppget.org/?build-result + bindist-upload-url: https://cppget.org/?upload=bindist + agent-checksum: 1 : name: libfoo version: 1.0 @@ -27,7 +28,7 @@ test.options += -ts target: x86_64-microsoft-win32-msvc14.0 EOF - : no-challenge + : no-optional : $* <<EOF >>EOF : 1 @@ -76,6 +77,23 @@ test.options += -ts result-url: https://cppget.org/?build-result result-url: https://cppget.org/?build-result EOI + + : upload-url + : + $* <<EOI 2>'stdin:4:1: error: task response upload url redefinition' == 1 + : 1 + bindist-upload-url: https://cppget.org/?upload=bindist + other-upload-url: https://cppget.org/?upload=other + bindist-upload-url: https://cppget.org/?upload=bindist + EOI + + : agent-checksum + : + $* <<EOI 2>'stdin:3:1: error: task response agent checksum redefinition' == 1 + : 1 + agent-checksum: 1 + agent-checksum: 1 + EOI } : invalid @@ -119,6 +137,44 @@ test.options += -ts EOI } + : upload-url + : + { + : empty + : + $* <<EOI 2>'stdin:2:20: error: empty task response upload url' == 1 + : 1 + bindist-upload-url: + EOI + + : redundant + : + $* <<EOI 2>'stdin:4:1: error: unexpected task response upload url' == 1 + : 1 + session: + bindist-upload-url: https://cppget.org/?upload=bindist + EOI + } + + : agent-checksum + : + { + : empty + : + $* <<EOI 2>'stdin:2:16: error: empty task response agent checksum' == 1 + : 1 + agent-checksum: + EOI + + : redundant + : + $* <<EOI 2>'stdin:4:1: error: unexpected task response agent checksum' == 1 + : 1 + session: + agent-checksum: 1 + EOI + } + : task-unexpected : $* <<EOI 2>'stdin:3:1: error: single task response manifest expected' == 1 diff --git a/tests/manifest/task.testscript b/tests/manifest/task.testscript index 9852f91..8320f59 100644 --- a/tests/manifest/task.testscript +++ b/tests/manifest/task.testscript @@ -1,5 +1,4 @@ # file : tests/manifest/task.testscript -# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file test.options += -t @@ -13,16 +12,53 @@ test.options += -t : $* <<EOF >>EOF : 1 - name: libfoo + name: foo + version: 1.0 + repository-url: http://pkg.example.org/1/math + trust: AB:0D:3F:C1:B0:13:E4:0E:AD:4A:08:06:AE:F3:85:DB:E2:27:5F:83:11:47:A2:7\ + 8:64:3C:73:60:F8:66:3A:A4 + requires: host + tests: foo-tests + examples: foo-examples + dependency-checksum: 12345 + machine: windows_10-msvc_14 + auxiliary-machine-pgsql: x86_64-linux_debian_12-postgresql_16 + auxiliary-machine: x86_64-linux_debian_12-mysql* + target: x86_64-microsoft-win32-msvc14.0 + environment: lld + auxiliary-environment:\ + PGSQL_DATABASE_HOST=192.168.0.1 + PGSQL_DATABASE_PORT=1245 + \ + target-config: config.cc.coptions=/Z7 config.cc.loptions=/DEBUG + package-config: config.foo.network=true + warning-regex: '^warning: ' '^.+: warning: ' + interactive: error + worker-checksum: 1 + EOF + + # @@ TMP Remove when toolchain 0.16.0 is released. + # + : no-package-config + : + $* <<EOF >>EOF + : 1 + name: foo version: 1.0 repository-url: http://pkg.example.org/1/math trust: AB:0D:3F:C1:B0:13:E4:0E:AD:4A:08:06:AE:F3:85:DB:E2:27:5F:83:11:47:A2:7\ 8:64:3C:73:60:F8:66:3A:A4 + requires: host + tests: foo-tests + examples: foo-examples + dependency-checksum: 12345 machine: windows_10-msvc_14 target: x86_64-microsoft-win32-msvc14.0 environment: lld config: config.cc.coptions=/Z7 config.cc.loptions=/DEBUG warning-regex: '^warning: ' '^.+: warning: ' + interactive: error + worker-checksum: 1 EOF : no-config-regex-environment @@ -66,6 +102,53 @@ test.options += -t target: x86_64-microsoft-win32-msvc14.0 EOO + : requires + : + { + $* <<EOF >>EOF + : 1 + name: foo + version: 1.0 + repository-url: http://pkg.example.org/1/math + requires: {c++ >= 14 windows} + requires: host + machine: windows + target: x86_64-microsoft-win32-msvc14.0 + EOF + } + + : requires-invalid + : + { + $* <<EOI 2>>EOE != 0 + : 1 + name: foo + version: 1.0 + repository-url: http://pkg.example.org/1/math + requires: {c++ >= 14 windows + machine: windows + target: x86_64-microsoft-win32-msvc14.0 + EOI + stdin:5:29: error: requirement or '}' expected + EOE + } + + : tests + : + { + $* <<EOF >>EOF + : 1 + name: libfoo + version: 1.0 + repository-url: http://pkg.example.org/1/math + tests: libfoo-tests + examples: libfoo-examples == 1.2.3 + benchmarks: libfoo-benchmarks ~1.2.0 + machine: windows + target: x86_64-microsoft-win32-msvc14.0 + EOF + } + : config : { @@ -94,6 +177,34 @@ test.options += -t EOF } + : host + : + { + : true + : + $* <<EOF >>EOF + : 1 + name: libfoo + version: 1.0 + repository-url: http://pkg.example.org/1/math + machine: windows + target: x86_64-microsoft-win32-msvc14.0 + host: true + EOF + + : false + : + $* <<EOF >>EOF + : 1 + name: libfoo + version: 1.0 + repository-url: http://pkg.example.org/1/math + machine: windows + target: x86_64-microsoft-win32-msvc14.0 + host: false + EOF + } + : trust-yes : $* <<EOF >>EOF @@ -143,6 +254,14 @@ test.options += -t machine: windows_10-msvc_14 EOI + : auxiliary-machine + : + $* <<EOI 2>'stdin:3:1: error: task auxiliary machine environment redefinition' == 1 + : 1 + auxiliary-machine-pgsql: x86_64-linux_debian_12-postgresql_16 + auxiliary-machine-pgsql: x86_64-linux_debian_12-postgresql_14 + EOI + : target : $* <<EOI 2>'stdin:3:1: error: task target redefinition' == 1 @@ -151,14 +270,38 @@ test.options += -t target: x86_64-microsoft-win32-msvc14.0 EOI + : auxiliary-environment + : + $* <<EOI 2>'stdin:7:1: error: task auxiliary environment redefinition' == 1 + : 1 + auxiliary-environment: + \ + PGSQL_DATABASE_HOST=192.168.0.1 + PGSQL_DATABASE_PORT=1245 + \ + auxiliary-environment: + \ + PGSQL_DATABASE_HOST=192.168.0.1 + PGSQL_DATABASE_PORT=1245 + \ + EOI + : config : - $* <<EOI 2>'stdin:3:1: error: task configuration redefinition' == 1 + $* <<EOI 2>'stdin:3:1: error: task target configuration redefinition' == 1 : 1 config: config.cc.coptions=/Z7 config: config.cc.loptions=/DEBUG EOI + : host + : + $* <<EOI 2>'stdin:3:1: error: task host value redefinition' == 1 + : 1 + host: true + host: false + EOI + : warning-regex : $* <<EOI 2>'stdin:3:1: error: task warning regex redefinition' == 1 @@ -166,6 +309,22 @@ test.options += -t warning-regex: '^warning: ' warning-regex: '^.+: warning: ' EOI + + : interactive + : + $* <<EOI 2>'stdin:3:1: error: task interactive value redefinition' == 1 + : 1 + interactive: error + interactive: warning + EOI + + : worker-checksum + : + $* <<EOI 2>'stdin:3:1: error: task worker checksum redefinition' == 1 + : 1 + worker-checksum: 1 + worker-checksum: 1 + EOI } : invalid @@ -237,12 +396,12 @@ test.options += -t target: EOI - : config + : target-config : { : empty : - $* <<EOI 2>'stdin:2:8: error: empty task configuration' == 1 + $* <<EOI 2>'stdin:2:8: error: empty task target configuration' == 1 : 1 config: EOI @@ -261,13 +420,20 @@ test.options += -t : $* <<EOI 2>'stdin:3:7: error: invalid task configuration: unterminated quoted string' == 1 : 1 - config: \ + config:\ 'abc=x \ EOI } } + : host + : + $* <<EOI 2>"stdin:2:7: error: invalid task host value 'yes'" == 1 + : 1 + host: yes + EOI + : warning-regex : { @@ -294,6 +460,20 @@ test.options += -t : 1 trust: abc EOI + + : interactive + : + $* <<EOI 2>'stdin:2:13: error: empty task interactive value' == 1 + : 1 + interactive: + EOI + + : worker-checksum + : + $* <<EOI 2>'stdin:2:17: error: empty task worker checksum' == 1 + : 1 + worker-checksum: + EOI } : unknown-name |