From 2615896faa646e5830abf2c269150e1165c66515 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 18 Dec 2020 18:48:46 +0300 Subject: Switch to build2 --- xsd-tests/cxx/parser/test-template/buildfile | 22 +++++++++ xsd-tests/cxx/parser/test-template/driver.cxx | 66 +++++++++++++++++++++++++++ xsd-tests/cxx/parser/test-template/output | 1 + xsd-tests/cxx/parser/test-template/test.xml | 7 +++ xsd-tests/cxx/parser/test-template/test.xsd | 12 +++++ 5 files changed, 108 insertions(+) create mode 100644 xsd-tests/cxx/parser/test-template/buildfile create mode 100644 xsd-tests/cxx/parser/test-template/driver.cxx create mode 100644 xsd-tests/cxx/parser/test-template/output create mode 100644 xsd-tests/cxx/parser/test-template/test.xml create mode 100644 xsd-tests/cxx/parser/test-template/test.xsd (limited to 'xsd-tests/cxx/parser/test-template') diff --git a/xsd-tests/cxx/parser/test-template/buildfile b/xsd-tests/cxx/parser/test-template/buildfile new file mode 100644 index 0000000..e0e68e4 --- /dev/null +++ b/xsd-tests/cxx/parser/test-template/buildfile @@ -0,0 +1,22 @@ +# file : cxx/parser/test-template/buildfile +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +import libs = libxsd%lib{xsd} + +exe{driver}: {hxx cxx}{* -test-pskel} {hxx ixx cxx}{test-pskel} $libs + +exe{driver}: xml{test}: test.input = true +exe{driver}: file{output}: test.stdout = true + +cxx.poptions =+ "-I$out_base" + +<{hxx ixx cxx}{test-pskel}>: xsd{test} $xsd +{{ + diag xsd ($<[0]) # @@ TMP + + $xsd cxx-parser $xsd_cxx_std \ + --generate-inline \ + --skel-file-suffix -pskel \ + --output-dir $out_base \ + $path($<[0]) +}} diff --git a/xsd-tests/cxx/parser/test-template/driver.cxx b/xsd-tests/cxx/parser/test-template/driver.cxx new file mode 100644 index 0000000..333c6fd --- /dev/null +++ b/xsd-tests/cxx/parser/test-template/driver.cxx @@ -0,0 +1,66 @@ +// file : cxx/parser/test-template/driver.cxx +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +// Insert test description here. +// + +#include +#include + +#include "test-pskel.hxx" + +using namespace std; +using namespace test; + +struct type_pimpl: type_pskel +{ + virtual void + pre () + { + } + + virtual void + a (string const& v) + { + cout << v << endl; + } + + virtual void + post_type () + { + } +}; + +int +main (int argc, char* argv[]) +{ + if (argc != 2) + { + cerr << "usage: " << argv[0] << " test.xml" << endl; + return 1; + } + + try + { + xml_schema::string_pimpl string_p; + type_pimpl type_p; + + type_p.parsers (string_p); + + xml_schema::document doc_p (type_p, "test", "root"); + + type_p.pre (); + doc_p.parse (argv[1]); + type_p.post_type (); + } + catch (xml_schema::exception const& e) + { + cerr << e << endl; + return 1; + } + catch (std::ios_base::failure const&) + { + cerr << "io failure" << endl; + return 1; + } +} diff --git a/xsd-tests/cxx/parser/test-template/output b/xsd-tests/cxx/parser/test-template/output new file mode 100644 index 0000000..7898192 --- /dev/null +++ b/xsd-tests/cxx/parser/test-template/output @@ -0,0 +1 @@ +a diff --git a/xsd-tests/cxx/parser/test-template/test.xml b/xsd-tests/cxx/parser/test-template/test.xml new file mode 100644 index 0000000..624a80c --- /dev/null +++ b/xsd-tests/cxx/parser/test-template/test.xml @@ -0,0 +1,7 @@ + + + a + + diff --git a/xsd-tests/cxx/parser/test-template/test.xsd b/xsd-tests/cxx/parser/test-template/test.xsd new file mode 100644 index 0000000..07bebc7 --- /dev/null +++ b/xsd-tests/cxx/parser/test-template/test.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + + + -- cgit v1.1