From 4429bd6724a4668464e8a7920e3c77860b127678 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 4 May 2018 16:16:41 +0200 Subject: Regenerate libhello using bdep-new --- libhello/tests/.gitignore | 7 +++++++ libhello/tests/basics/buildfile | 3 +++ libhello/tests/basics/driver.cxx | 33 +++++++++++++++++++++++++++++++++ libhello/tests/build/.gitignore | 2 ++ libhello/tests/build/bootstrap.build | 4 ++-- libhello/tests/build/root.build | 6 ++++-- libhello/tests/buildfile | 2 +- libhello/tests/test/buildfile | 4 ---- libhello/tests/test/driver.cxx | 14 -------------- libhello/tests/test/test.out | 3 --- 10 files changed, 52 insertions(+), 26 deletions(-) create mode 100644 libhello/tests/basics/buildfile create mode 100644 libhello/tests/basics/driver.cxx delete mode 100644 libhello/tests/test/buildfile delete mode 100644 libhello/tests/test/driver.cxx delete mode 100644 libhello/tests/test/test.out (limited to 'libhello/tests') diff --git a/libhello/tests/.gitignore b/libhello/tests/.gitignore index e54525b..662178d 100644 --- a/libhello/tests/.gitignore +++ b/libhello/tests/.gitignore @@ -1 +1,8 @@ +# Test executables. +# driver + +# Testscript output directories (can be symlinks). +# +test +test-* diff --git a/libhello/tests/basics/buildfile b/libhello/tests/basics/buildfile new file mode 100644 index 0000000..a436a8c --- /dev/null +++ b/libhello/tests/basics/buildfile @@ -0,0 +1,3 @@ +import libs = libhello%lib{hello} + +exe{driver}: {hxx ixx txx cxx}{*} $libs diff --git a/libhello/tests/basics/driver.cxx b/libhello/tests/basics/driver.cxx new file mode 100644 index 0000000..2cef70b --- /dev/null +++ b/libhello/tests/basics/driver.cxx @@ -0,0 +1,33 @@ +#include +#include + +#include +#include + +using namespace std; +using namespace hello; + +int main () +{ + // Basics. + // + { + ostringstream o; + say_hello_formatted (o, "Hi, World!"); + assert (o.str () == "Hi, World!\n"); + } + + { + ostringstream o; + say_hello (o, "World"); + assert (o.str () == "Hello, World!\n"); + } + + // Volume. + // + { + ostringstream o; + say_hello (o, "World", format::volume::loud); + assert (o.str () == "HELLO, World!\n"); + } +} diff --git a/libhello/tests/build/.gitignore b/libhello/tests/build/.gitignore index 225c27f..4a730a3 100644 --- a/libhello/tests/build/.gitignore +++ b/libhello/tests/build/.gitignore @@ -1 +1,3 @@ config.build +root/ +bootstrap/ diff --git a/libhello/tests/build/bootstrap.build b/libhello/tests/build/bootstrap.build index 2c2de24..a07b5ea 100644 --- a/libhello/tests/build/bootstrap.build +++ b/libhello/tests/build/bootstrap.build @@ -1,5 +1,5 @@ -project = # Unnamed subproject. +project = # Unnamed tests subproject. using config -using dist using test +using dist diff --git a/libhello/tests/build/root.build b/libhello/tests/build/root.build index a2ee38a..a67b2fe 100644 --- a/libhello/tests/build/root.build +++ b/libhello/tests/build/root.build @@ -1,14 +1,16 @@ -cxx.std = 11 +cxx.std = latest using cxx hxx{*}: extension = hxx +ixx{*}: extension = ixx +txx{*}: extension = txx cxx{*}: extension = cxx # Every exe{} in this subproject is by default a test. # exe{*}: test = true -# Specify the test target for cross-testing. +# The test target for cross-testing (running tests under Wine, etc). # test.target = $cxx.target diff --git a/libhello/tests/buildfile b/libhello/tests/buildfile index 1a8bcc9..aeeab15 100644 --- a/libhello/tests/buildfile +++ b/libhello/tests/buildfile @@ -1 +1 @@ -./: test/ +./: {*/ -build/} diff --git a/libhello/tests/test/buildfile b/libhello/tests/test/buildfile deleted file mode 100644 index 2ff528a..0000000 --- a/libhello/tests/test/buildfile +++ /dev/null @@ -1,4 +0,0 @@ -import libs = libhello%lib{hello} - -exe{driver}: cxx{driver} $libs -exe{driver}: file{test.out}: test.stdout = true diff --git a/libhello/tests/test/driver.cxx b/libhello/tests/test/driver.cxx deleted file mode 100644 index 1c08bca..0000000 --- a/libhello/tests/test/driver.cxx +++ /dev/null @@ -1,14 +0,0 @@ -// file: tests/test/driver.cxx -*- C++ -*- - -#include -#include // volume - -int -main () -{ - using namespace hello; - - say ("World"); - say ("World", format::volume::loud); - say_formatted ("Hi, World!"); -} diff --git a/libhello/tests/test/test.out b/libhello/tests/test/test.out deleted file mode 100644 index a9ec19f..0000000 --- a/libhello/tests/test/test.out +++ /dev/null @@ -1,3 +0,0 @@ -Hello, World! -HELLO, World! -Hi, World! -- cgit v1.1