From 8e8d599b129d35f638f2c1957c869b054a38b021 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 13 Jul 2017 22:19:18 +0300 Subject: Make tests to be a sub-project --- build/export.build | 15 +++++++++++++++ build/root.build | 3 +-- tests/agent/buildfile | 8 +++++--- tests/build/.gitignore | 1 + tests/build/bootstrap.build | 9 +++++++++ tests/build/root.build | 7 +++++++ tests/buildfile | 5 +++++ tests/integration/buildfile | 9 ++++++--- tests/integration/testscript | 2 +- tests/machine/buildfile | 8 +++++--- tests/worker/buildfile | 8 +++++--- 11 files changed, 60 insertions(+), 15 deletions(-) create mode 100644 build/export.build create mode 100644 tests/build/.gitignore create mode 100644 tests/build/bootstrap.build create mode 100644 tests/build/root.build create mode 100644 tests/buildfile diff --git a/build/export.build b/build/export.build new file mode 100644 index 0000000..8cd1646 --- /dev/null +++ b/build/export.build @@ -0,0 +1,15 @@ +# file : build/export.build +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : TBC; see accompanying LICENSE file + +$out_root/: +{ + include bbot/ +} + +if ($import.target == exe{bbot-agent}) + export $out_root/bbot/exe{bbot-agent} +elif ($import.target == exe{bbot-worker}) + export $out_root/bbot/exe{bbot-worker} +else + assert false unknown target $import.target diff --git a/build/root.build b/build/root.build index 4661de1..f63ff10 100644 --- a/build/root.build +++ b/build/root.build @@ -21,9 +21,8 @@ cxx.poptions =+ "-I$out_root" "-I$src_root" # using? cli -# All exe{} in tests/ and unit-tests/ are, well, tests. +# All exe{} in unit-tests/ are, well, tests. # -tests/exe{*}: test = true unit-tests/exe{*}: test = true # Specify the test target for cross-testing. diff --git a/tests/agent/buildfile b/tests/agent/buildfile index 7e93da0..3dc4ef5 100644 --- a/tests/agent/buildfile +++ b/tests/agent/buildfile @@ -2,7 +2,9 @@ # copyright : Copyright (c) 2014-2017 Code Synthesis Ltd # license : TBC; see accompanying LICENSE file -./: ../../bbot/exe{bbot-agent} test{testscript} file{btrfs-cpdir btrfs-rmdir} -dir{./}: test = ../../bbot/exe{bbot-agent} +# Setup the bbot-agent that we are testing. +# +import agent = bbot%exe{bbot-agent} -include ../../bbot/ +./: test{testscript} file{btrfs-cpdir btrfs-rmdir} $agent +dir{./}: test = $agent diff --git a/tests/build/.gitignore b/tests/build/.gitignore new file mode 100644 index 0000000..225c27f --- /dev/null +++ b/tests/build/.gitignore @@ -0,0 +1 @@ +config.build diff --git a/tests/build/bootstrap.build b/tests/build/bootstrap.build new file mode 100644 index 0000000..23281ac --- /dev/null +++ b/tests/build/bootstrap.build @@ -0,0 +1,9 @@ +# file : tests/build/bootstrap.build +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : TBC; see accompanying LICENSE file + +project = # Unnamed subproject. + +using config +using dist +using test diff --git a/tests/build/root.build b/tests/build/root.build new file mode 100644 index 0000000..588bc62 --- /dev/null +++ b/tests/build/root.build @@ -0,0 +1,7 @@ +# file : tests/build/root.build +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : TBC; see accompanying LICENSE file + +# Specify the test target for cross-testing. +# +test.target = $cxx.target diff --git a/tests/buildfile b/tests/buildfile new file mode 100644 index 0000000..e90a9db --- /dev/null +++ b/tests/buildfile @@ -0,0 +1,5 @@ +# file : tests/buildfile +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : TBC; see accompanying LICENSE file + +./: {*/ -build/} diff --git a/tests/integration/buildfile b/tests/integration/buildfile index f054694..2f33955 100644 --- a/tests/integration/buildfile +++ b/tests/integration/buildfile @@ -2,7 +2,10 @@ # copyright : Copyright (c) 2014-2017 Code Synthesis Ltd # license : TBC; see accompanying LICENSE file -./: ../../bbot/exe{bbot-agent bbot-worker} test{testscript} file{tftp-map} -dir{./}: test = ../../bbot/exe{bbot-agent} +# Setup the bbot-agent and bbot-worker that we are testing. +# +import agent = bbot%exe{bbot-agent} +import worker = bbot%exe{bbot-worker} -include ../../bbot/ +./: test{testscript} file{tftp-map} $agent $worker +dir{./}: test = $agent diff --git a/tests/integration/testscript b/tests/integration/testscript index bf66324..fcb3b19 100644 --- a/tests/integration/testscript +++ b/tests/integration/testscript @@ -49,7 +49,7 @@ controller = --fake-request ../task --dump-result pkg = hello ver = 1.0.0 -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 +cat <<"EOI" >=task : 1 diff --git a/tests/machine/buildfile b/tests/machine/buildfile index a9f6ac3..fb532fc 100644 --- a/tests/machine/buildfile +++ b/tests/machine/buildfile @@ -2,7 +2,9 @@ # copyright : Copyright (c) 2014-2017 Code Synthesis Ltd # license : TBC; see accompanying LICENSE file -./: ../../bbot/exe{bbot-agent} test{testscript} -dir{./}: test = ../../bbot/exe{bbot-agent} +# Setup the bbot-agent that we are testing. +# +import agent = bbot%exe{bbot-agent} -include ../../bbot/ +./: test{testscript} $agent +dir{./}: test = $agent diff --git a/tests/worker/buildfile b/tests/worker/buildfile index 7d0a206..0b2b35e 100644 --- a/tests/worker/buildfile +++ b/tests/worker/buildfile @@ -20,7 +20,9 @@ sudo /usr/sbin/in.tftpd \ #\ -./: ../../bbot/exe{bbot-worker} test{bootstrap startup build} -dir{./}: test = ../../bbot/exe{bbot-worker} +# Setup the bbot-worker that we are testing. +# +import worker = bbot%exe{bbot-worker} -include ../../bbot/ +./: test{*} $worker +dir{./}: test = $worker -- cgit v1.1