diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/build/root.build | 9 | ||||
-rw-r--r-- | tests/buildtab/driver.cxx | 12 | ||||
-rw-r--r-- | tests/buildtab/testscript | 22 | ||||
-rw-r--r-- | tests/manifest/driver.cxx | 10 | ||||
-rw-r--r-- | tests/manifest/machine-header.testscript | 18 | ||||
-rw-r--r-- | tests/manifest/result-request.testscript | 31 | ||||
-rw-r--r-- | tests/manifest/result.testscript | 31 | ||||
-rw-r--r-- | tests/manifest/task-request.testscript | 80 | ||||
-rw-r--r-- | tests/manifest/task-response.testscript | 59 | ||||
-rw-r--r-- | tests/manifest/task.testscript | 224 |
10 files changed, 432 insertions, 64 deletions
diff --git a/tests/build/root.build b/tests/build/root.build index bb274d3..f97c101 100644 --- a/tests/build/root.build +++ b/tests/build/root.build @@ -13,6 +13,15 @@ if ($cxx.target.system == 'win32-msvc') if ($cxx.class == 'msvc') cxx.coptions += /wd4251 /wd4275 /wd4800 +elif ($cxx.id == 'gcc') +{ + cxx.coptions += -Wno-maybe-uninitialized -Wno-free-nonheap-object # libbutl + + if ($cxx.version.major >= 13) + cxx.coptions += -Wno-dangling-reference +} +elif ($cxx.id.type == 'clang' && $cxx.version.major >= 15) + cxx.coptions += -Wno-unqualified-std-cast-call # Every exe{} in this subproject is by default a test. # diff --git a/tests/buildtab/driver.cxx b/tests/buildtab/driver.cxx index 13d0d71..1ea4331 100644 --- a/tests/buildtab/driver.cxx +++ b/tests/buildtab/driver.cxx @@ -2,12 +2,14 @@ // license : MIT; see accompanying LICENSE file #include <ios> // ios::failbit, ios::badbit -#include <cassert> #include <iostream> -#include <libbutl/utility.mxx> // operator<<(ostream,exception) +#include <libbutl/utility.hxx> // operator<<(ostream,exception) + +#include <libbbot/build-target-config.hxx> -#include <libbbot/build-config.hxx> +#undef NDEBUG +#include <cassert> using namespace std; using namespace butl; @@ -25,9 +27,9 @@ try cin.exceptions (ios::failbit | ios::badbit); cout.exceptions (ios::failbit | ios::badbit); - const build_configs& configs (parse_buildtab (cin, "cin")); + const build_target_configs& configs (parse_buildtab (cin, "cin")); - for (const build_config& c: configs) + for (const build_target_config& c: configs) { cout << c.machine_pattern << ' ' << c.name << ' ' << c.target; diff --git a/tests/buildtab/testscript b/tests/buildtab/testscript index c9b5389..6c8b054 100644 --- a/tests/buildtab/testscript +++ b/tests/buildtab/testscript @@ -6,11 +6,13 @@ : Roundtrip buildtab. : { - : all-fileds-combinations + : all-fields-combinations : $* <<EOI >>EOO - windows*-vc_14* windows-vc_14-32 i686-microsoft-win32-msvc14.0 all - windows*-vc_14* windows-vc_14-32-debug i686-microsoft-win32-msvc14.0 "" config.cc.coptions=/Z7 config.cc.loptions=/DEBUG ~"warning C4\d{3}: " + windows*-vc_14* windows-vc_14 i686-microsoft-win32-msvc14.0 all + windows*-vc_14* windows-vc_14-debug i686-microsoft-win32-msvc14.0 "" config.cc.coptions=/Z7 config.cc.loptions=/DEBUG ~"warning C4\d{3}: " + + windows*-vc_14* windows-vc_14 x86_64-microsoft-win32-msvc14.0 all linux_debian_8*-gcc_4.9 linux_debian_8-gcc_4.9 x86_64-linux-gnu "all default linux gcc gcc-4+:gcc-3+" - - - gcc-5+:gcc-4+ @@ -21,8 +23,9 @@ windows_10*-clang_9.0_msvc_16.3 windows_10-clang_9.0_msvc_16.3_lld x86_64-microsoft-win32-msvc14.2/lld "all default windows clang" EOI - windows*-vc_14* windows-vc_14-32 i686-microsoft-win32-msvc14.0 all - windows*-vc_14* windows-vc_14-32-debug i686-microsoft-win32-msvc14.0 "" config.cc.coptions=/Z7 config.cc.loptions=/DEBUG ~"warning C4\d{3}: " + windows*-vc_14* windows-vc_14 i686-microsoft-win32-msvc14.0 all + windows*-vc_14* windows-vc_14-debug i686-microsoft-win32-msvc14.0 "" config.cc.coptions=/Z7 config.cc.loptions=/DEBUG ~"warning C4\d{3}: " + windows*-vc_14* windows-vc_14 x86_64-microsoft-win32-msvc14.0 all linux_debian_8*-gcc_4.9 linux_debian_8-gcc_4.9 x86_64-linux-gnu "all default linux gcc gcc-4+:gcc-3+" linux_debian_9*-gcc_7.3 linux_debian_9-gcc_7.3 x86_64-linux-gnu "all default linux gcc gcc-7+:gcc-6+" linux_debian_9*-gcc_7.3 linux_debian_9-gcc_7.3-O3 x86_64-linux-gnu "all default linux gcc optimized gcc-7+:gcc-6+" config.cc.coptions=-O3 @@ -52,14 +55,15 @@ $* <<EOI 2>>EOE == 1 windows*-vc_14* EOI - cin:1:16: error: no configuration name found + cin:1:16: error: no target configuration name found EOE : dup : - $* <<EOI 2>'cin:2:17: error: duplicate configuration name' == 1 - windows*-vc_14* windows-vc_14-32 i686-microsoft-win32-msvc14.0 default - windows*-vc_14* windows-vc_14-32 i686-microsoft-win32-msvc14.0 default + $* <<EOI 2>'cin:3:31: error: duplicate target configuration name/target' == 1 + windows*-vc_14* windows-vc_14 i686-microsoft-win32-msvc14.0 default + windows*-vc_14* windows-vc_14 x86_64-microsoft-win32-msvc14.0 default + windows*-vc_14* windows-vc_14 i686-microsoft-win32-msvc14.0 default EOI } diff --git a/tests/manifest/driver.cxx b/tests/manifest/driver.cxx index 821aa63..9c0fcf9 100644 --- a/tests/manifest/driver.cxx +++ b/tests/manifest/driver.cxx @@ -3,15 +3,17 @@ #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 84295d2..559a107 100644 --- a/tests/manifest/machine-header.testscript +++ b/tests/manifest/machine-header.testscript @@ -13,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 } @@ -52,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 e2c4a94..6d0e5b1 100644 --- a/tests/manifest/result-request.testscript +++ b/tests/manifest/result-request.testscript @@ -14,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 @@ -25,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 } @@ -51,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 @@ -76,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 @@ -95,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 c530170..b48a691 100644 --- a/tests/manifest/result.testscript +++ b/tests/manifest/result.testscript @@ -18,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 @@ -41,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 @@ -106,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 @@ -181,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 4b797f6..79f3982 100644 --- a/tests/manifest/task-request.testscript +++ b/tests/manifest/task-request.testscript @@ -15,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 @@ -70,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 @@ -88,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 @@ -124,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 e7dbdb9..7615127 100644 --- a/tests/manifest/task-response.testscript +++ b/tests/manifest/task-response.testscript @@ -18,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 @@ -26,7 +28,7 @@ test.options += -ts target: x86_64-microsoft-win32-msvc14.0 EOF - : no-challenge + : no-optional : $* <<EOF >>EOF : 1 @@ -75,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 @@ -118,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 65ecd29..8320f59 100644 --- a/tests/manifest/task.testscript +++ b/tests/manifest/task.testscript @@ -12,18 +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 - test-exclude: libfoo-tests/1.0 - test-exclude: libfoo-examples/1.0 + 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 @@ -67,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 : { @@ -95,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 @@ -144,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 @@ -152,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 @@ -167,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 @@ -224,37 +382,6 @@ test.options += -t EOE } - : test-exclude - : - { - : invalid-name - : - $* <<EOI 2>>EOE == 1 - : 1 - test-exclude: 0ibfoo-tests/1.0 - EOI - stdin:2:15: error: invalid test exclusion package name: illegal first character (must be alphabetic) - EOE - - : no-version - : - $* <<EOI 2>>EOE == 1 - : 1 - test-exclude: libfoo-tests - EOI - stdin:2:15: error: invalid test exclusion package: '/' is expected - EOE - - : invalid-version - : - $* <<EOI 2>>EOE == 1 - : 1 - test-exclude: libfoo-tests/+1 - EOI - stdin:2:15: error: invalid test exclusion package version: unexpected end - EOE - } - : machine-empty : $* <<EOI 2>'stdin:2:9: error: empty task machine' == 1 @@ -269,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 @@ -293,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 : { @@ -326,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 |