aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-05-11 15:58:26 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-05-11 15:58:26 +0200
commit9a614840171d3b9a169eb57318187ad4e8d9bf17 (patch)
tree2254e0d120abe8cd08716b0aaf39e14e3f82d133
parent023f1a286b7dfe80eb80a9e6924e492cf6f3f80a (diff)
Add --immediate|-i and --recursive|-r options to test command
-rw-r--r--bdep/status.cxx3
-rw-r--r--bdep/test.cli26
-rw-r--r--bdep/test.hxx12
3 files changed, 33 insertions, 8 deletions
diff --git a/bdep/status.cxx b/bdep/status.cxx
index 2b04f9d..3c8dfe3 100644
--- a/bdep/status.cxx
+++ b/bdep/status.cxx
@@ -46,8 +46,7 @@ namespace bdep
"--constraint",
(o.old_available () ? "--old-available" : nullptr),
(o.immediate () ? "--immediate" :
- o.recursive () ? "--recursive" :
- nullptr),
+ o.recursive () ? "--recursive" : nullptr),
pkgs);
}
diff --git a/bdep/test.cli b/bdep/test.cli
index d1fd931..8c76386 100644
--- a/bdep/test.cli
+++ b/bdep/test.cli
@@ -28,11 +28,17 @@ namespace bdep
\h|DESCRIPTION|
The \cb{test} command tests the project packages in one or more build
- configurations. Underneath it executes the \l{bpkg-pkg-test(1)} command
- which itself is not much more than the build system \cb{test} operation
- (see \l{b(1)} for details). As a result, the main utility of this command
- is the ability to refer to build configurations by names and to project
- packages implicitly via the current working directory.
+ configurations. Additionally, immediate or all dependencies of the
+ project packages can be tested by specifying the
+ \c{\b{--immediate}|\b{-i}} or \c{\b{--recursive}|\b{-r}} options,
+ respectively.
+
+ Underneath \cb{test} executes the \l{bpkg-pkg-test(1)} command which
+ itself is not much more than the build system \cb{test} operation (see
+ \l{b(1)} for details). As a result, the main utility of this command is
+ the ability to refer to build configurations by names and to project
+ packages implicitly via the current working directory as well as to
+ test dependencies.
If no project or package directory is specified, then the current working
directory is assumed. If no configuration is specified, then the default
@@ -45,5 +51,15 @@ namespace bdep
class cmd_test_options: project_options
{
"\h|TEST OPTIONS|"
+
+ bool --immediate|-i
+ {
+ "Also test immediate dependencies."
+ }
+
+ bool --recursive|-r
+ {
+ "Also test all dependencies, recursively."
+ }
};
}
diff --git a/bdep/test.hxx b/bdep/test.hxx
index b057c24..ff983b2 100644
--- a/bdep/test.hxx
+++ b/bdep/test.hxx
@@ -19,12 +19,22 @@ namespace bdep
const cstrings& pkgs,
const strings& cfg_vars)
{
- run_bpkg (2, o, "test", "-d", c->path, cfg_vars, pkgs);
+ run_bpkg (2,
+ o,
+ "test",
+ "-d", c->path,
+ (o.immediate () ? "--immediate" :
+ o.recursive () ? "--recursive" : nullptr),
+ cfg_vars,
+ pkgs);
}
inline int
cmd_test (const cmd_test_options& o, cli::scanner& args)
{
+ if (o.immediate () && o.recursive ())
+ fail << "both --immediate|-i and --recursive|-r specified";
+
return cmd_build (o, &cmd_test, args);
}
}