From 8e17e84d41f1377b387201b0290dd552eaa58e28 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Mon, 24 Oct 2016 18:10:19 -0500 Subject: [PATCH] Some examples to: illustrate use of timing info use, and more complex testing options. --- example/complex-testing/compile-fail.cpp | 17 +++++++++++++++++ example/complex-testing/fail.cpp | 17 +++++++++++++++++ example/complex-testing/jamroot.jam | 10 ++++++++++ example/complex-testing/success.cpp | 17 +++++++++++++++++ example/time/jamroot.jam | 13 +++++++++++++ example/time/main_cpp.pro | 1 + 6 files changed, 75 insertions(+) create mode 100644 example/complex-testing/compile-fail.cpp create mode 100644 example/complex-testing/fail.cpp create mode 100644 example/complex-testing/jamroot.jam create mode 100644 example/complex-testing/success.cpp create mode 100644 example/time/jamroot.jam create mode 100644 example/time/main_cpp.pro diff --git a/example/complex-testing/compile-fail.cpp b/example/complex-testing/compile-fail.cpp new file mode 100644 index 000000000..a219fa5c6 --- /dev/null +++ b/example/complex-testing/compile-fail.cpp @@ -0,0 +1,17 @@ +// Copyright (c) 2014 Rene Rivera +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// http://www.boost.org +// + +#include +#include + +int main() +{ + std::cout << "Bye!\n"; + return EXIT_FAILURE +} diff --git a/example/complex-testing/fail.cpp b/example/complex-testing/fail.cpp new file mode 100644 index 000000000..965661188 --- /dev/null +++ b/example/complex-testing/fail.cpp @@ -0,0 +1,17 @@ +// Copyright (c) 2014 Rene Rivera +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// http://www.boost.org +// + +#include +#include + +int main() +{ + std::cout << "Bye!\n"; + return EXIT_FAILURE; +} diff --git a/example/complex-testing/jamroot.jam b/example/complex-testing/jamroot.jam new file mode 100644 index 000000000..be4ebddd5 --- /dev/null +++ b/example/complex-testing/jamroot.jam @@ -0,0 +1,10 @@ +# Copyright 2016 Rene Rivera +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + +using testing ; + +exe success : success.cpp ; + +run success : arg1 arg2 : : : success-a : ; +run success : arg3 arg4 : : : success-b : ; diff --git a/example/complex-testing/success.cpp b/example/complex-testing/success.cpp new file mode 100644 index 000000000..bf5588062 --- /dev/null +++ b/example/complex-testing/success.cpp @@ -0,0 +1,17 @@ +// Copyright (c) 2014 Rene Rivera +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// http://www.boost.org +// + +#include +#include + +int main() +{ + std::cout << "Hi!\n"; + return EXIT_SUCCESS; +} diff --git a/example/time/jamroot.jam b/example/time/jamroot.jam new file mode 100644 index 000000000..9419b4437 --- /dev/null +++ b/example/time/jamroot.jam @@ -0,0 +1,13 @@ +import feature ; +import toolset ; +import os ; +import testing ; + +path-constant HERE : . ; +make main.cpp : main_cpp.pro : @do-something ; +time main.time : main.cpp ; + +actions do-something +{ + sleep 2 && echo "$(<)" > "$(<)" +} diff --git a/example/time/main_cpp.pro b/example/time/main_cpp.pro new file mode 100644 index 000000000..237c8ce18 --- /dev/null +++ b/example/time/main_cpp.pro @@ -0,0 +1 @@ +int main() {}