aboutsummaryrefslogtreecommitdiff
path: root/tests/common.test
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-05-14 21:03:01 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-05-15 18:12:12 +0300
commit1ffe9fa27ee9829c16446a09aa5bd94bcc60ab68 (patch)
treefef5df69e64ab0c64dc299e864e04185b7d022e0 /tests/common.test
parent602b71ed970b8ca9fea19c0103be7a977179d50d (diff)
Add update, clean, and test commands tests
Diffstat (limited to 'tests/common.test')
-rw-r--r--tests/common.test34
1 files changed, 19 insertions, 15 deletions
diff --git a/tests/common.test b/tests/common.test
index f66d9eb..8578f5c 100644
--- a/tests/common.test
+++ b/tests/common.test
@@ -5,14 +5,25 @@
# Commonly-used variables setup and driver command line.
#
+# Variables for supporting Windows/POSIX testscript variants.
+#
+win32 = ($cxx.target.class == 'windows')
+exe = ($win32 ? '.exe' : '')
+
# Use the same build system driver as the one running the tests (as opposed
-# to one that may or may not be found via PATH). A common approach will be to
-# run build2 as a sanity check in a directory produced/updated by the bdep
-# command being tested.
+# to one that may or may not be found via PATH). This implies that we don't
+# support cross-testing.
+#
+# A common approach will be to run build2 as a sanity check in a directory
+# produced/updated by a command being tested.
#
build = $recall($build.path)
test.options += --build $build
+# @@ It would be nice to query bdep for the bpkg path it uses.
+#
+bpkg = ("$config.bdep.test.bpkg" != '' ? "$config.bdep.test.bpkg" : "bpkg$exe")
+
# Helper commands that can be used by tests to prepare the testing environment
# or validate an outcome of the command being tested. They are likely to get
# additional options and redirects appended prior to use. A common approach
@@ -21,24 +32,17 @@ test.options += --build $build
# (for example, to make sure that configuration post-test state is valid and is
# as expected).
#
+clean = $* clean
+deinit = $* deinit
+init = $* init
+fetch = $* fetch
new = $* new
status = $* status
-init = $* init
sync = $* sync
-fetch = $* fetch
-deinit = $* deinit
+update = $* update
# All testscripts are named after bdep commands, for example sync.test. So the
# testscript scope id is a name of the command being tested.
#
cmd = [string] $@
test.arguments = $cmd
-
-# Convenience variables for supporting Windows/POSIX testscript variants.
-#
-win32 = ($cxx.target.class == 'windows')
-exe = ($win32 ? '.exe' : '')
-
-# @@ It would be nice to query bdep for the bpkg path it uses.
-#
-bpkg = ("$config.bdep.test.bpkg" != '' ? "$config.bdep.test.bpkg" : "bpkg$exe")