From 0f08dcfc229402dcafeffc45c01d9713e62cb9c5 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 5 May 2017 12:47:06 +0300 Subject: Add tests --- tests/.gitignore | 1 + tests/build/.gitignore | 1 + tests/build/bootstrap.build | 5 +++++ tests/build/root.build | 14 ++++++++++++++ tests/buildfile | 1 + tests/test/buildfile | 4 ++++ tests/test/driver.cxx | 13 +++++++++++++ tests/test/test.out | 1 + 8 files changed, 40 insertions(+) create mode 100644 tests/.gitignore create mode 100644 tests/build/.gitignore create mode 100644 tests/build/bootstrap.build create mode 100644 tests/build/root.build create mode 100644 tests/buildfile create mode 100644 tests/test/buildfile create mode 100644 tests/test/driver.cxx create mode 100644 tests/test/test.out (limited to 'tests') diff --git a/tests/.gitignore b/tests/.gitignore new file mode 100644 index 0000000..e54525b --- /dev/null +++ b/tests/.gitignore @@ -0,0 +1 @@ +driver diff --git a/tests/build/.gitignore b/tests/build/.gitignore new file mode 100644 index 0000000..225c27f --- /dev/null +++ b/tests/build/.gitignore @@ -0,0 +1 @@ +config.build diff --git a/tests/build/bootstrap.build b/tests/build/bootstrap.build new file mode 100644 index 0000000..2c2de24 --- /dev/null +++ b/tests/build/bootstrap.build @@ -0,0 +1,5 @@ +project = # Unnamed subproject. + +using config +using dist +using test diff --git a/tests/build/root.build b/tests/build/root.build new file mode 100644 index 0000000..a2ee38a --- /dev/null +++ b/tests/build/root.build @@ -0,0 +1,14 @@ +cxx.std = 11 + +using cxx + +hxx{*}: extension = hxx +cxx{*}: extension = cxx + +# Every exe{} in this subproject is by default a test. +# +exe{*}: test = true + +# Specify the test target for cross-testing. +# +test.target = $cxx.target diff --git a/tests/buildfile b/tests/buildfile new file mode 100644 index 0000000..1a8bcc9 --- /dev/null +++ b/tests/buildfile @@ -0,0 +1 @@ +./: test/ diff --git a/tests/test/buildfile b/tests/test/buildfile new file mode 100644 index 0000000..92d2804 --- /dev/null +++ b/tests/test/buildfile @@ -0,0 +1,4 @@ +import libs = libformat%lib{format} + +exe{driver}: cxx{driver} $libs +exe{driver}: test.output = test.out diff --git a/tests/test/driver.cxx b/tests/test/driver.cxx new file mode 100644 index 0000000..fb2939d --- /dev/null +++ b/tests/test/driver.cxx @@ -0,0 +1,13 @@ +// file: tests/test/driver.cxx -*- C++ -*- + +#include + +#include + +int +main () +{ + using namespace std; + + cout << format ("Hello", "World") << endl; +} diff --git a/tests/test/test.out b/tests/test/test.out new file mode 100644 index 0000000..8ab686e --- /dev/null +++ b/tests/test/test.out @@ -0,0 +1 @@ +Hello, World! -- cgit v1.1