From 14f56876f64e7557ef695633b31e9a1c093f9c3e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 26 Jan 2016 13:33:01 +0200 Subject: Implement pkg-test|test command --- bpkg/bpkg.cli | 5 +++++ bpkg/bpkg.cxx | 2 ++ bpkg/buildfile | 2 ++ bpkg/pkg-test | 21 +++++++++++++++++++++ bpkg/pkg-test.cli | 36 ++++++++++++++++++++++++++++++++++++ doc/cli.sh | 2 +- 6 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 bpkg/pkg-test create mode 100644 bpkg/pkg-test.cli diff --git a/bpkg/bpkg.cli b/bpkg/bpkg.cli index cf0125e..295c627 100644 --- a/bpkg/bpkg.cli +++ b/bpkg/bpkg.cli @@ -100,6 +100,11 @@ namespace bpkg "\l{bpkg-pkg-update(1)} \- update package" } + bool pkg-test|test + { + "\l{bpkg-pkg-test(1)} \- test package" + } + bool pkg-clean|clean { "\l{bpkg-pkg-clean(1)} \- clean package" diff --git a/bpkg/bpkg.cxx b/bpkg/bpkg.cxx index dc318ed..35fb796 100644 --- a/bpkg/bpkg.cxx +++ b/bpkg/bpkg.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -186,6 +187,7 @@ try PKG_COMMAND (install); PKG_COMMAND (purge); PKG_COMMAND (status); + PKG_COMMAND (test); PKG_COMMAND (uninstall); PKG_COMMAND (unpack); PKG_COMMAND (update); diff --git a/bpkg/buildfile b/bpkg/buildfile index 52d4520..e4f5756 100644 --- a/bpkg/buildfile +++ b/bpkg/buildfile @@ -33,6 +33,7 @@ exe{bpkg}: \ {hxx }{ pkg-install } {hxx ixx cxx}{ pkg-install-options } \ {hxx cxx}{ pkg-purge } {hxx ixx cxx}{ pkg-purge-options } \ {hxx cxx}{ pkg-status } {hxx ixx cxx}{ pkg-status-options } \ +{hxx }{ pkg-test } {hxx ixx cxx}{ pkg-test-options } \ {hxx }{ pkg-uninstall } {hxx ixx cxx}{ pkg-uninstall-options } \ {hxx cxx}{ pkg-unpack } {hxx ixx cxx}{ pkg-unpack-options } \ {hxx }{ pkg-update } {hxx ixx cxx}{ pkg-update-options } \ @@ -79,6 +80,7 @@ if! $cli.loaded {hxx ixx cxx}{pkg-fetch-options}: cli{pkg-fetch} {hxx ixx cxx}{pkg-install-options}: cli{pkg-install} {hxx ixx cxx}{pkg-purge-options}: cli{pkg-purge} +{hxx ixx cxx}{pkg-test-options}: cli{pkg-test} {hxx ixx cxx}{pkg-status-options}: cli{pkg-status} {hxx ixx cxx}{pkg-uninstall-options}: cli{pkg-uninstall} {hxx ixx cxx}{pkg-unpack-options}: cli{pkg-unpack} diff --git a/bpkg/pkg-test b/bpkg/pkg-test new file mode 100644 index 0000000..cb42b14 --- /dev/null +++ b/bpkg/pkg-test @@ -0,0 +1,21 @@ +// file : bpkg/pkg-test -*- C++ -*- +// copyright : Copyright (c) 2014-2016 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +#ifndef BPKG_PKG_TEST +#define BPKG_PKG_TEST + +#include +#include +#include + +namespace bpkg +{ + inline int + pkg_test (const pkg_test_options& o, cli::scanner& args) + { + return pkg_command ("test", o, args); + } +} + +#endif // BPKG_PKG_TEST diff --git a/bpkg/pkg-test.cli b/bpkg/pkg-test.cli new file mode 100644 index 0000000..e04ba5f --- /dev/null +++ b/bpkg/pkg-test.cli @@ -0,0 +1,36 @@ +// file : bpkg/pkg-test.cli +// copyright : Copyright (c) 2014-2016 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +include ; + +"\section=1" +"\name=bpkg-pkg-test" +"\summary=test package" + +namespace bpkg +{ + { + " ", + + "\h|SYNOPSIS| + + \c{\b{bpkg pkg-test}|\b{test} [] [] ( [])...} + + \h|DESCRIPTION| + + The \cb{pkg-test} command tests the previously configured (via + \l{bpkg-pkg-build(1)} or \l{bpkg-pkg-configure(1)}) package. Underneath, + this command doesn't do much more than run \cb{b test}. + + Additional command line variables (, normally \cb{config.*}) can be + passed to the build system by either specifying them before the packages, + in which case they apply to all of them, or after a specific package, in + which case they apply only to this package." + } + + class pkg_test_options: configuration_options + { + "\h|PKG-TEST OPTIONS|" + }; +} diff --git a/doc/cli.sh b/doc/cli.sh index d022a47..8422e7c 100755 --- a/doc/cli.sh +++ b/doc/cli.sh @@ -51,7 +51,7 @@ compile "bpkg" $o --output-prefix "" --suppress-undocumented --class-doc bpkg::c pages="cfg-add cfg-create cfg-fetch help pkg-build pkg-clean pkg-configure \ pkg-disfigure pkg-drop pkg-fetch pkg-install pkg-purge pkg-status \ -pkg-uninstall pkg-unpack pkg-update pkg-verify rep-create rep-info" +pkg-test pkg-uninstall pkg-unpack pkg-update pkg-verify rep-create rep-info" for p in $pages; do compile $p $o -- cgit v1.1