From 5e527213a2430bb3018e5eebd909aef294edf9b5 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/schema/anonymous/buildfile | 22 +++ xsd-tests/schema/anonymous/driver.cxx | 9 ++ xsd-tests/schema/anonymous/test.xsd | 143 ++++++++++++++++++++ xsd-tests/schema/any-attribute/buildfile | 12 ++ xsd-tests/schema/any-attribute/test.xsd | 22 +++ xsd-tests/schema/any-attribute/testscript | 8 ++ xsd-tests/schema/any-type/buildfile | 24 ++++ xsd-tests/schema/any-type/driver.cxx | 9 ++ xsd-tests/schema/any-type/test.xsd | 22 +++ xsd-tests/schema/any/.gitignore | 5 + xsd-tests/schema/any/buildfile | 47 +++++++ xsd-tests/schema/any/driver.cxx.in | 9 ++ xsd-tests/schema/any/fail.xsd | 19 +++ xsd-tests/schema/any/test.xsd | 19 +++ xsd-tests/schema/attribute-group/.gitignore | 1 + xsd-tests/schema/attribute-group/buildfile | 22 +++ xsd-tests/schema/attribute-group/driver.cxx | 9 ++ xsd-tests/schema/attribute-group/global.xsd | 50 +++++++ xsd-tests/schema/attribute/.gitignore | 3 + xsd-tests/schema/attribute/buildfile | 27 ++++ xsd-tests/schema/attribute/driver.cxx | 11 ++ xsd-tests/schema/attribute/global.xsd | 21 +++ xsd-tests/schema/attribute/local.xsd | 37 ++++++ xsd-tests/schema/attribute/ref.xsd | 42 ++++++ xsd-tests/schema/cardinality/buildfile | 22 +++ xsd-tests/schema/cardinality/driver.cxx | 9 ++ xsd-tests/schema/cardinality/test.xsd | 46 +++++++ xsd-tests/schema/chameleon/.gitignore | 1 + xsd-tests/schema/chameleon/buildfile | 27 ++++ xsd-tests/schema/chameleon/driver.cxx | 10 ++ xsd-tests/schema/chameleon/includer.xsd | 17 +++ xsd-tests/schema/chameleon/schemas/.gitignore | 1 + xsd-tests/schema/chameleon/schemas/includee.xsd | 12 ++ xsd-tests/schema/enumeration/buildfile | 22 +++ xsd-tests/schema/enumeration/driver.cxx | 9 ++ xsd-tests/schema/enumeration/test.xsd | 89 +++++++++++++ xsd-tests/schema/forward/buildfile | 22 +++ xsd-tests/schema/forward/driver.cxx | 9 ++ xsd-tests/schema/forward/test.xsd | 32 +++++ xsd-tests/schema/group/.gitignore | 1 + xsd-tests/schema/group/buildfile | 27 ++++ xsd-tests/schema/group/driver.cxx | 10 ++ xsd-tests/schema/group/global.xsd | 39 ++++++ xsd-tests/schema/group/test.xsd | 148 +++++++++++++++++++++ xsd-tests/schema/import/.gitignore | 1 + xsd-tests/schema/import/buildfile | 27 ++++ xsd-tests/schema/import/driver.cxx | 9 ++ xsd-tests/schema/import/importer.xsd | 20 +++ xsd-tests/schema/import/schemas/.gitignore | 1 + xsd-tests/schema/import/schemas/importee.xsd | 15 +++ xsd-tests/schema/include/.gitignore | 1 + xsd-tests/schema/include/buildfile | 27 ++++ xsd-tests/schema/include/driver.cxx | 9 ++ xsd-tests/schema/include/includer.xsd | 17 +++ xsd-tests/schema/include/schemas/.gitignore | 1 + xsd-tests/schema/include/schemas/includee.xsd | 14 ++ xsd-tests/schema/inheritance/.gitignore | 1 + xsd-tests/schema/inheritance/buildfile | 30 +++++ xsd-tests/schema/inheritance/cycle.xsd | 34 +++++ .../schema/inheritance/sourced-forward/.gitignore | 1 + .../inheritance/sourced-forward/includee.xsd | 10 ++ .../inheritance/sourced-forward/includer.xsd | 14 ++ xsd-tests/schema/inheritance/testscript | 8 ++ xsd-tests/schema/list/anonymous/test.xsd | 16 +++ xsd-tests/schema/list/any-simple-type/test.xsd | 12 ++ xsd-tests/schema/list/buildfile | 31 +++++ xsd-tests/schema/list/test.xsd | 72 ++++++++++ xsd-tests/schema/list/testscript | 8 ++ xsd-tests/schema/no-namespace/buildfile | 22 +++ xsd-tests/schema/no-namespace/driver.cxx | 9 ++ xsd-tests/schema/no-namespace/test.xsd | 15 +++ xsd-tests/schema/recursive/buildfile | 22 +++ xsd-tests/schema/recursive/driver.cxx | 9 ++ xsd-tests/schema/recursive/test.xsd | 43 ++++++ xsd-tests/schema/ref-type/invalid/buildfile | 12 ++ xsd-tests/schema/ref-type/invalid/invalid-0.xsd | 17 +++ xsd-tests/schema/ref-type/invalid/invalid-1.xsd | 11 ++ xsd-tests/schema/ref-type/invalid/testscript | 16 +++ xsd-tests/schema/ref-type/valid/.gitignore | 6 + xsd-tests/schema/ref-type/valid/buildfile | 35 +++++ xsd-tests/schema/ref-type/valid/driver.cxx.in | 9 ++ xsd-tests/schema/ref-type/valid/idref.xsd | 42 ++++++ xsd-tests/schema/ref-type/valid/idrefs.xsd | 43 ++++++ xsd-tests/schema/restriction/buildfile | 22 +++ xsd-tests/schema/restriction/driver.cxx | 9 ++ xsd-tests/schema/restriction/test.xsd | 67 ++++++++++ xsd-tests/schema/union/buildfile | 22 +++ xsd-tests/schema/union/driver.cxx | 9 ++ xsd-tests/schema/union/test.xsd | 65 +++++++++ 89 files changed, 2030 insertions(+) create mode 100644 xsd-tests/schema/anonymous/buildfile create mode 100644 xsd-tests/schema/anonymous/driver.cxx create mode 100644 xsd-tests/schema/anonymous/test.xsd create mode 100644 xsd-tests/schema/any-attribute/buildfile create mode 100644 xsd-tests/schema/any-attribute/test.xsd create mode 100644 xsd-tests/schema/any-attribute/testscript create mode 100644 xsd-tests/schema/any-type/buildfile create mode 100644 xsd-tests/schema/any-type/driver.cxx create mode 100644 xsd-tests/schema/any-type/test.xsd create mode 100644 xsd-tests/schema/any/.gitignore create mode 100644 xsd-tests/schema/any/buildfile create mode 100644 xsd-tests/schema/any/driver.cxx.in create mode 100644 xsd-tests/schema/any/fail.xsd create mode 100644 xsd-tests/schema/any/test.xsd create mode 100644 xsd-tests/schema/attribute-group/.gitignore create mode 100644 xsd-tests/schema/attribute-group/buildfile create mode 100644 xsd-tests/schema/attribute-group/driver.cxx create mode 100644 xsd-tests/schema/attribute-group/global.xsd create mode 100644 xsd-tests/schema/attribute/.gitignore create mode 100644 xsd-tests/schema/attribute/buildfile create mode 100644 xsd-tests/schema/attribute/driver.cxx create mode 100644 xsd-tests/schema/attribute/global.xsd create mode 100644 xsd-tests/schema/attribute/local.xsd create mode 100644 xsd-tests/schema/attribute/ref.xsd create mode 100644 xsd-tests/schema/cardinality/buildfile create mode 100644 xsd-tests/schema/cardinality/driver.cxx create mode 100644 xsd-tests/schema/cardinality/test.xsd create mode 100644 xsd-tests/schema/chameleon/.gitignore create mode 100644 xsd-tests/schema/chameleon/buildfile create mode 100644 xsd-tests/schema/chameleon/driver.cxx create mode 100644 xsd-tests/schema/chameleon/includer.xsd create mode 100644 xsd-tests/schema/chameleon/schemas/.gitignore create mode 100644 xsd-tests/schema/chameleon/schemas/includee.xsd create mode 100644 xsd-tests/schema/enumeration/buildfile create mode 100644 xsd-tests/schema/enumeration/driver.cxx create mode 100644 xsd-tests/schema/enumeration/test.xsd create mode 100644 xsd-tests/schema/forward/buildfile create mode 100644 xsd-tests/schema/forward/driver.cxx create mode 100644 xsd-tests/schema/forward/test.xsd create mode 100644 xsd-tests/schema/group/.gitignore create mode 100644 xsd-tests/schema/group/buildfile create mode 100644 xsd-tests/schema/group/driver.cxx create mode 100644 xsd-tests/schema/group/global.xsd create mode 100644 xsd-tests/schema/group/test.xsd create mode 100644 xsd-tests/schema/import/.gitignore create mode 100644 xsd-tests/schema/import/buildfile create mode 100644 xsd-tests/schema/import/driver.cxx create mode 100644 xsd-tests/schema/import/importer.xsd create mode 100644 xsd-tests/schema/import/schemas/.gitignore create mode 100644 xsd-tests/schema/import/schemas/importee.xsd create mode 100644 xsd-tests/schema/include/.gitignore create mode 100644 xsd-tests/schema/include/buildfile create mode 100644 xsd-tests/schema/include/driver.cxx create mode 100644 xsd-tests/schema/include/includer.xsd create mode 100644 xsd-tests/schema/include/schemas/.gitignore create mode 100644 xsd-tests/schema/include/schemas/includee.xsd create mode 100644 xsd-tests/schema/inheritance/.gitignore create mode 100644 xsd-tests/schema/inheritance/buildfile create mode 100644 xsd-tests/schema/inheritance/cycle.xsd create mode 100644 xsd-tests/schema/inheritance/sourced-forward/.gitignore create mode 100644 xsd-tests/schema/inheritance/sourced-forward/includee.xsd create mode 100644 xsd-tests/schema/inheritance/sourced-forward/includer.xsd create mode 100644 xsd-tests/schema/inheritance/testscript create mode 100644 xsd-tests/schema/list/anonymous/test.xsd create mode 100644 xsd-tests/schema/list/any-simple-type/test.xsd create mode 100644 xsd-tests/schema/list/buildfile create mode 100644 xsd-tests/schema/list/test.xsd create mode 100644 xsd-tests/schema/list/testscript create mode 100644 xsd-tests/schema/no-namespace/buildfile create mode 100644 xsd-tests/schema/no-namespace/driver.cxx create mode 100644 xsd-tests/schema/no-namespace/test.xsd create mode 100644 xsd-tests/schema/recursive/buildfile create mode 100644 xsd-tests/schema/recursive/driver.cxx create mode 100644 xsd-tests/schema/recursive/test.xsd create mode 100644 xsd-tests/schema/ref-type/invalid/buildfile create mode 100644 xsd-tests/schema/ref-type/invalid/invalid-0.xsd create mode 100644 xsd-tests/schema/ref-type/invalid/invalid-1.xsd create mode 100644 xsd-tests/schema/ref-type/invalid/testscript create mode 100644 xsd-tests/schema/ref-type/valid/.gitignore create mode 100644 xsd-tests/schema/ref-type/valid/buildfile create mode 100644 xsd-tests/schema/ref-type/valid/driver.cxx.in create mode 100644 xsd-tests/schema/ref-type/valid/idref.xsd create mode 100644 xsd-tests/schema/ref-type/valid/idrefs.xsd create mode 100644 xsd-tests/schema/restriction/buildfile create mode 100644 xsd-tests/schema/restriction/driver.cxx create mode 100644 xsd-tests/schema/restriction/test.xsd create mode 100644 xsd-tests/schema/union/buildfile create mode 100644 xsd-tests/schema/union/driver.cxx create mode 100644 xsd-tests/schema/union/test.xsd (limited to 'xsd-tests/schema') diff --git a/xsd-tests/schema/anonymous/buildfile b/xsd-tests/schema/anonymous/buildfile new file mode 100644 index 0000000..cc01697 --- /dev/null +++ b/xsd-tests/schema/anonymous/buildfile @@ -0,0 +1,22 @@ +# file : schema/anonymous/buildfile +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +# Just make sure that the schema files and the xsd-generated C++ mappings are +# compilable. +# +import libs = libxsd%lib{xsd} +import libs += libxerces-c%lib{xerces-c} + +exe{driver}: {hxx cxx}{* -test} {hxx cxx}{test} $libs + +<{hxx cxx}{test}>: xsd{test} $xsd +{{ + diag xsd ($<[0]) # @@ TMP + + $xsd cxx-tree --std c++11 \ + --root-element-all \ + --output-dir $out_base \ + $path($<[0]) +}} + +cxx.poptions =+ "-I$out_base" diff --git a/xsd-tests/schema/anonymous/driver.cxx b/xsd-tests/schema/anonymous/driver.cxx new file mode 100644 index 0000000..f902fdb --- /dev/null +++ b/xsd-tests/schema/anonymous/driver.cxx @@ -0,0 +1,9 @@ +// file : schema/anonymous/driver.cxx +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include "test.hxx" + +int +main (int, char*[]) +{ +} diff --git a/xsd-tests/schema/anonymous/test.xsd b/xsd-tests/schema/anonymous/test.xsd new file mode 100644 index 0000000..cba3300 --- /dev/null +++ b/xsd-tests/schema/anonymous/test.xsd @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xsd-tests/schema/any-attribute/buildfile b/xsd-tests/schema/any-attribute/buildfile new file mode 100644 index 0000000..e4275a4 --- /dev/null +++ b/xsd-tests/schema/any-attribute/buildfile @@ -0,0 +1,12 @@ +# file : schema/any-attribute/buildfile +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +# Test that the invalid schema files compilation expectedly fails. +# +./: testscript xsd{*} $xsd + +testscript{*}: +{ + test = $xsd + test.arguments = cxx-tree --std c++11 +} diff --git a/xsd-tests/schema/any-attribute/test.xsd b/xsd-tests/schema/any-attribute/test.xsd new file mode 100644 index 0000000..55419c4 --- /dev/null +++ b/xsd-tests/schema/any-attribute/test.xsd @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + diff --git a/xsd-tests/schema/any-attribute/testscript b/xsd-tests/schema/any-attribute/testscript new file mode 100644 index 0000000..d9da7c1 --- /dev/null +++ b/xsd-tests/schema/any-attribute/testscript @@ -0,0 +1,8 @@ +# file : schema/any-attribute/testscript +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +: decl-after-any-attribute +: +$* --output-dir $~ $src_base/test.xsd 2>>/"EOE" != 0 + $src_base/test.xsd:12:44: error: anyAttribute must not be followed by other declarations + EOE diff --git a/xsd-tests/schema/any-type/buildfile b/xsd-tests/schema/any-type/buildfile new file mode 100644 index 0000000..e575562 --- /dev/null +++ b/xsd-tests/schema/any-type/buildfile @@ -0,0 +1,24 @@ +# file : schema/any-type/buildfile +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +# Just make sure that the schema files and the xsd-generated C++ mappings are +# compilable. +# +import libs = libxsd%lib{xsd} +import libs += libxerces-c%lib{xerces-c} + +exe{driver}: {hxx cxx}{* -test} {hxx cxx}{test} $libs + +<{hxx cxx}{test}>: xsd{test} $xsd +{{ + diag xsd ($<[0]) # @@ TMP + + $xsd cxx-tree --std c++11 \ + --root-element-all \ + --output-dir $out_base \ + $path($<[0]) 2>>?~%EOE% + %.+(warning F00\d|info):.+%.+ + EOE +}} + +cxx.poptions =+ "-I$out_base" diff --git a/xsd-tests/schema/any-type/driver.cxx b/xsd-tests/schema/any-type/driver.cxx new file mode 100644 index 0000000..a94f099 --- /dev/null +++ b/xsd-tests/schema/any-type/driver.cxx @@ -0,0 +1,9 @@ +// file : schema/any-type/driver.cxx +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include "test.hxx" + +int +main (int, char*[]) +{ +} diff --git a/xsd-tests/schema/any-type/test.xsd b/xsd-tests/schema/any-type/test.xsd new file mode 100644 index 0000000..9e3ff79 --- /dev/null +++ b/xsd-tests/schema/any-type/test.xsd @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + diff --git a/xsd-tests/schema/any/.gitignore b/xsd-tests/schema/any/.gitignore new file mode 100644 index 0000000..fca6147 --- /dev/null +++ b/xsd-tests/schema/any/.gitignore @@ -0,0 +1,5 @@ +driver-test +driver-fail +driver-test.?xx +driver-fail.?xx +fail.?xx diff --git a/xsd-tests/schema/any/buildfile b/xsd-tests/schema/any/buildfile new file mode 100644 index 0000000..6b76348 --- /dev/null +++ b/xsd-tests/schema/any/buildfile @@ -0,0 +1,47 @@ +# file : schema/any/buildfile +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +# Just make sure that the schema files and the xsd-generated C++ mappings are +# compilable. +# +import libs = libxsd%lib{xsd} +import libs += libxerces-c%lib{xerces-c} + +for sc: test fail +{ + dr = "driver-$sc" + + ./: exe{$dr}: cxx{$dr} {hxx cxx}{$sc} $libs + + cxx{$dr}: in{driver} + { + # Note: we can't use $sc$ in driver.cxx.in since it will be substituted by + # the latest $sc value. + # + sch = $sc + } +} + +<{hxx cxx}{test}>: xsd{test} $xsd +{{ + diag xsd ($<[0]) # @@ TMP + + $xsd cxx-tree --std c++11 \ + --root-element-all \ + --output-dir $out_base \ + $path($<[0]) +}} + +<{hxx cxx}{fail}>: xsd{fail} $xsd +{{ + diag xsd ($<[0]) # @@ TMP + + $xsd cxx-tree --std c++11 \ + --root-element-all \ + --output-dir $out_base \ + $path($<[0]) 2>>?~%EOE% + %.+(warning T001:|info:).+%{9} + EOE +}} + +cxx.poptions =+ "-I$out_base" diff --git a/xsd-tests/schema/any/driver.cxx.in b/xsd-tests/schema/any/driver.cxx.in new file mode 100644 index 0000000..9c36761 --- /dev/null +++ b/xsd-tests/schema/any/driver.cxx.in @@ -0,0 +1,9 @@ +// file : schema/any/driver.cxx.in +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include "$sch$.hxx" + +int +main (int, char*[]) +{ +} diff --git a/xsd-tests/schema/any/fail.xsd b/xsd-tests/schema/any/fail.xsd new file mode 100644 index 0000000..2eb9513 --- /dev/null +++ b/xsd-tests/schema/any/fail.xsd @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + diff --git a/xsd-tests/schema/any/test.xsd b/xsd-tests/schema/any/test.xsd new file mode 100644 index 0000000..ff896fd --- /dev/null +++ b/xsd-tests/schema/any/test.xsd @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + diff --git a/xsd-tests/schema/attribute-group/.gitignore b/xsd-tests/schema/attribute-group/.gitignore new file mode 100644 index 0000000..a935c30 --- /dev/null +++ b/xsd-tests/schema/attribute-group/.gitignore @@ -0,0 +1 @@ +global.?xx diff --git a/xsd-tests/schema/attribute-group/buildfile b/xsd-tests/schema/attribute-group/buildfile new file mode 100644 index 0000000..b9ca83b --- /dev/null +++ b/xsd-tests/schema/attribute-group/buildfile @@ -0,0 +1,22 @@ +# file : schema/attribute-group/buildfile +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +# Just make sure that the schema files and the xsd-generated C++ mappings are +# compilable. +# +import libs = libxsd%lib{xsd} +import libs += libxerces-c%lib{xerces-c} + +exe{driver}: {hxx cxx}{* -global} {hxx cxx}{global} $libs + +<{hxx cxx}{global}>: xsd{global} $xsd +{{ + diag xsd ($<[0]) # @@ TMP + + $xsd cxx-tree --std c++11 \ + --root-element-all \ + --output-dir $out_base \ + $path($<[0]) +}} + +cxx.poptions =+ "-I$out_base" diff --git a/xsd-tests/schema/attribute-group/driver.cxx b/xsd-tests/schema/attribute-group/driver.cxx new file mode 100644 index 0000000..328cef4 --- /dev/null +++ b/xsd-tests/schema/attribute-group/driver.cxx @@ -0,0 +1,9 @@ +// file : schema/attribute-group/driver.cxx +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include "global.hxx" + +int +main (int, char*[]) +{ +} diff --git a/xsd-tests/schema/attribute-group/global.xsd b/xsd-tests/schema/attribute-group/global.xsd new file mode 100644 index 0000000..6ee0539 --- /dev/null +++ b/xsd-tests/schema/attribute-group/global.xsd @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xsd-tests/schema/attribute/.gitignore b/xsd-tests/schema/attribute/.gitignore new file mode 100644 index 0000000..88cd012 --- /dev/null +++ b/xsd-tests/schema/attribute/.gitignore @@ -0,0 +1,3 @@ +global.?xx +local.?xx +ref.?xx diff --git a/xsd-tests/schema/attribute/buildfile b/xsd-tests/schema/attribute/buildfile new file mode 100644 index 0000000..00e5410 --- /dev/null +++ b/xsd-tests/schema/attribute/buildfile @@ -0,0 +1,27 @@ +# file : schema/attribute/buildfile +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +# Just make sure that the schema files and the xsd-generated C++ mappings are +# compilable. +# +import libs = libxsd%lib{xsd} +import libs += libxerces-c%lib{xerces-c} + +fs = global local ref + +exe{driver}: {hxx cxx}{* -{$fs}} {hxx cxx}{$fs} $libs + +for f: $fs +{ + <{hxx cxx}{$f}>: xsd{$f} $xsd + {{ + diag xsd ($<[0]) # @@ TMP + + $xsd cxx-tree --std c++11 \ + --root-element-all \ + --output-dir $out_base \ + $path($<[0]) + }} +} + +cxx.poptions =+ "-I$out_base" diff --git a/xsd-tests/schema/attribute/driver.cxx b/xsd-tests/schema/attribute/driver.cxx new file mode 100644 index 0000000..3d29b36 --- /dev/null +++ b/xsd-tests/schema/attribute/driver.cxx @@ -0,0 +1,11 @@ +// file : schema/attribute/driver.cxx +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include "ref.hxx" +#include "global.hxx" +#include "local.hxx" + +int +main (int, char*[]) +{ +} diff --git a/xsd-tests/schema/attribute/global.xsd b/xsd-tests/schema/attribute/global.xsd new file mode 100644 index 0000000..e2dcc93 --- /dev/null +++ b/xsd-tests/schema/attribute/global.xsd @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + diff --git a/xsd-tests/schema/attribute/local.xsd b/xsd-tests/schema/attribute/local.xsd new file mode 100644 index 0000000..7a7a480 --- /dev/null +++ b/xsd-tests/schema/attribute/local.xsd @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xsd-tests/schema/attribute/ref.xsd b/xsd-tests/schema/attribute/ref.xsd new file mode 100644 index 0000000..d806ff3 --- /dev/null +++ b/xsd-tests/schema/attribute/ref.xsd @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xsd-tests/schema/cardinality/buildfile b/xsd-tests/schema/cardinality/buildfile new file mode 100644 index 0000000..cfbb732 --- /dev/null +++ b/xsd-tests/schema/cardinality/buildfile @@ -0,0 +1,22 @@ +# file : schema/cardinality/buildfile +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +# Just make sure that the schema files and the xsd-generated C++ mappings are +# compilable. +# +import libs = libxsd%lib{xsd} +import libs += libxerces-c%lib{xerces-c} + +exe{driver}: {hxx cxx}{* -test} {hxx cxx}{test} $libs + +<{hxx cxx}{test}>: xsd{test} $xsd +{{ + diag xsd ($<[0]) # @@ TMP + + $xsd cxx-tree --std c++11 \ + --root-element-all \ + --output-dir $out_base \ + $path($<[0]) +}} + +cxx.poptions =+ "-I$out_base" diff --git a/xsd-tests/schema/cardinality/driver.cxx b/xsd-tests/schema/cardinality/driver.cxx new file mode 100644 index 0000000..d8b218e --- /dev/null +++ b/xsd-tests/schema/cardinality/driver.cxx @@ -0,0 +1,9 @@ +// file : schema/cardinality/driver.cxx +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include "test.hxx" + +int +main (int, char*[]) +{ +} diff --git a/xsd-tests/schema/cardinality/test.xsd b/xsd-tests/schema/cardinality/test.xsd new file mode 100644 index 0000000..b27f923 --- /dev/null +++ b/xsd-tests/schema/cardinality/test.xsd @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xsd-tests/schema/chameleon/.gitignore b/xsd-tests/schema/chameleon/.gitignore new file mode 100644 index 0000000..4ec7484 --- /dev/null +++ b/xsd-tests/schema/chameleon/.gitignore @@ -0,0 +1 @@ +includer.?xx diff --git a/xsd-tests/schema/chameleon/buildfile b/xsd-tests/schema/chameleon/buildfile new file mode 100644 index 0000000..0143422 --- /dev/null +++ b/xsd-tests/schema/chameleon/buildfile @@ -0,0 +1,27 @@ +# file : schema/chameleon/buildfile +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +# Just make sure that the schema files and the xsd-generated C++ mappings are +# compilable. +# +import libs = libxsd%lib{xsd} +import libs += libxerces-c%lib{xerces-c} + +fs = includer schemas/includee + +exe{driver}: {hxx cxx}{** -{$fs}} {hxx cxx}{$fs} $libs + +for f: $fs +{ + <{hxx cxx}{$f}>: xsd{$f} $xsd + {{ + diag xsd ($<[0]) # @@ TMP + + $xsd cxx-tree --std c++11 \ + --root-element-all \ + --output-dir $directory($path($>[0])) \ + $path($<[0]) + }} +} + +cxx.poptions =+ "-I$out_base" diff --git a/xsd-tests/schema/chameleon/driver.cxx b/xsd-tests/schema/chameleon/driver.cxx new file mode 100644 index 0000000..7b408ef --- /dev/null +++ b/xsd-tests/schema/chameleon/driver.cxx @@ -0,0 +1,10 @@ +// file : schema/chameleon/driver.cxx +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include "includer.hxx" +#include "schemas/includee.hxx" + +int +main (int, char*[]) +{ +} diff --git a/xsd-tests/schema/chameleon/includer.xsd b/xsd-tests/schema/chameleon/includer.xsd new file mode 100644 index 0000000..c93ea18 --- /dev/null +++ b/xsd-tests/schema/chameleon/includer.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + diff --git a/xsd-tests/schema/chameleon/schemas/.gitignore b/xsd-tests/schema/chameleon/schemas/.gitignore new file mode 100644 index 0000000..dcf4bb9 --- /dev/null +++ b/xsd-tests/schema/chameleon/schemas/.gitignore @@ -0,0 +1 @@ +includee.?xx diff --git a/xsd-tests/schema/chameleon/schemas/includee.xsd b/xsd-tests/schema/chameleon/schemas/includee.xsd new file mode 100644 index 0000000..d89b9c4 --- /dev/null +++ b/xsd-tests/schema/chameleon/schemas/includee.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/xsd-tests/schema/enumeration/buildfile b/xsd-tests/schema/enumeration/buildfile new file mode 100644 index 0000000..efb6b9e --- /dev/null +++ b/xsd-tests/schema/enumeration/buildfile @@ -0,0 +1,22 @@ +# file : schema/enumeration/buildfile +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +# Just make sure that the schema files and the xsd-generated C++ mappings are +# compilable. +# +import libs = libxsd%lib{xsd} +import libs += libxerces-c%lib{xerces-c} + +exe{driver}: {hxx cxx}{* -test} {hxx cxx}{test} $libs + +<{hxx cxx}{test}>: xsd{test} $xsd +{{ + diag xsd ($<[0]) # @@ TMP + + $xsd cxx-tree --std c++11 \ + --root-element-all \ + --output-dir $out_base \ + $path($<[0]) +}} + +cxx.poptions =+ "-I$out_base" diff --git a/xsd-tests/schema/enumeration/driver.cxx b/xsd-tests/schema/enumeration/driver.cxx new file mode 100644 index 0000000..406c8ab --- /dev/null +++ b/xsd-tests/schema/enumeration/driver.cxx @@ -0,0 +1,9 @@ +// file : schema/enumeration/driver.cxx +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include "test.hxx" + +int +main (int, char*[]) +{ +} diff --git a/xsd-tests/schema/enumeration/test.xsd b/xsd-tests/schema/enumeration/test.xsd new file mode 100644 index 0000000..b8253d9 --- /dev/null +++ b/xsd-tests/schema/enumeration/test.xsd @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xsd-tests/schema/forward/buildfile b/xsd-tests/schema/forward/buildfile new file mode 100644 index 0000000..969f99f --- /dev/null +++ b/xsd-tests/schema/forward/buildfile @@ -0,0 +1,22 @@ +# file : schema/forward/buildfile +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +# Just make sure that the schema files and the xsd-generated C++ mappings are +# compilable. +# +import libs = libxsd%lib{xsd} +import libs += libxerces-c%lib{xerces-c} + +exe{driver}: {hxx cxx}{* -test} {hxx cxx}{test} $libs + +<{hxx cxx}{test}>: xsd{test} $xsd +{{ + diag xsd ($<[0]) # @@ TMP + + $xsd cxx-tree --std c++11 \ + --root-element-all \ + --output-dir $out_base \ + $path($<[0]) +}} + +cxx.poptions =+ "-I$out_base" diff --git a/xsd-tests/schema/forward/driver.cxx b/xsd-tests/schema/forward/driver.cxx new file mode 100644 index 0000000..ee6519e --- /dev/null +++ b/xsd-tests/schema/forward/driver.cxx @@ -0,0 +1,9 @@ +// file : schema/forward/driver.cxx +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include "test.hxx" + +int +main (int, char*[]) +{ +} diff --git a/xsd-tests/schema/forward/test.xsd b/xsd-tests/schema/forward/test.xsd new file mode 100644 index 0000000..c7cc24e --- /dev/null +++ b/xsd-tests/schema/forward/test.xsd @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xsd-tests/schema/group/.gitignore b/xsd-tests/schema/group/.gitignore new file mode 100644 index 0000000..a935c30 --- /dev/null +++ b/xsd-tests/schema/group/.gitignore @@ -0,0 +1 @@ +global.?xx diff --git a/xsd-tests/schema/group/buildfile b/xsd-tests/schema/group/buildfile new file mode 100644 index 0000000..dd926dd --- /dev/null +++ b/xsd-tests/schema/group/buildfile @@ -0,0 +1,27 @@ +# file : schema/group/buildfile +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +# Just make sure that the schema files and the xsd-generated C++ mappings are +# compilable. +# +import libs = libxsd%lib{xsd} +import libs += libxerces-c%lib{xerces-c} + +fs = test global + +exe{driver}: {hxx cxx}{* -{$fs}} {hxx cxx}{$fs} $libs + +for f: $fs +{ + <{hxx cxx}{$f}>: xsd{$f} $xsd + {{ + diag xsd ($<[0]) # @@ TMP + + $xsd cxx-tree --std c++11 \ + --root-element-all \ + --output-dir $out_base \ + $path($<[0]) + }} +} + +cxx.poptions =+ "-I$out_base" diff --git a/xsd-tests/schema/group/driver.cxx b/xsd-tests/schema/group/driver.cxx new file mode 100644 index 0000000..e754194 --- /dev/null +++ b/xsd-tests/schema/group/driver.cxx @@ -0,0 +1,10 @@ +// file : schema/group/driver.cxx +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include "test.hxx" +#include "global.hxx" + +int +main (int, char*[]) +{ +} diff --git a/xsd-tests/schema/group/global.xsd b/xsd-tests/schema/group/global.xsd new file mode 100644 index 0000000..27ccadf --- /dev/null +++ b/xsd-tests/schema/group/global.xsd @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xsd-tests/schema/group/test.xsd b/xsd-tests/schema/group/test.xsd new file mode 100644 index 0000000..7527cbb --- /dev/null +++ b/xsd-tests/schema/group/test.xsd @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xsd-tests/schema/import/.gitignore b/xsd-tests/schema/import/.gitignore new file mode 100644 index 0000000..6cdf6db --- /dev/null +++ b/xsd-tests/schema/import/.gitignore @@ -0,0 +1 @@ +importer.?xx diff --git a/xsd-tests/schema/import/buildfile b/xsd-tests/schema/import/buildfile new file mode 100644 index 0000000..9e6aec5 --- /dev/null +++ b/xsd-tests/schema/import/buildfile @@ -0,0 +1,27 @@ +# file : schema/import/buildfile +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +# Just make sure that the schema files and the xsd-generated C++ mappings are +# compilable. +# +import libs = libxsd%lib{xsd} +import libs += libxerces-c%lib{xerces-c} + +fs = importer schemas/importee + +exe{driver}: {hxx cxx}{** -{$fs}} {hxx cxx}{$fs} $libs + +for f: $fs +{ + <{hxx cxx}{$f}>: xsd{$f} $xsd + {{ + diag xsd ($<[0]) # @@ TMP + + $xsd cxx-tree --std c++11 \ + --root-element-all \ + --output-dir $directory($path($>[0])) \ + $path($<[0]) + }} +} + +cxx.poptions =+ "-I$out_base" diff --git a/xsd-tests/schema/import/driver.cxx b/xsd-tests/schema/import/driver.cxx new file mode 100644 index 0000000..a94b2f3 --- /dev/null +++ b/xsd-tests/schema/import/driver.cxx @@ -0,0 +1,9 @@ +// file : schema/import/driver.cxx +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include "importer.hxx" + +int +main (int, char*[]) +{ +} diff --git a/xsd-tests/schema/import/importer.xsd b/xsd-tests/schema/import/importer.xsd new file mode 100644 index 0000000..82fc33c --- /dev/null +++ b/xsd-tests/schema/import/importer.xsd @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + diff --git a/xsd-tests/schema/import/schemas/.gitignore b/xsd-tests/schema/import/schemas/.gitignore new file mode 100644 index 0000000..945fcfc --- /dev/null +++ b/xsd-tests/schema/import/schemas/.gitignore @@ -0,0 +1 @@ +importee.?xx diff --git a/xsd-tests/schema/import/schemas/importee.xsd b/xsd-tests/schema/import/schemas/importee.xsd new file mode 100644 index 0000000..9b03315 --- /dev/null +++ b/xsd-tests/schema/import/schemas/importee.xsd @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/xsd-tests/schema/include/.gitignore b/xsd-tests/schema/include/.gitignore new file mode 100644 index 0000000..4ec7484 --- /dev/null +++ b/xsd-tests/schema/include/.gitignore @@ -0,0 +1 @@ +includer.?xx diff --git a/xsd-tests/schema/include/buildfile b/xsd-tests/schema/include/buildfile new file mode 100644 index 0000000..904e819 --- /dev/null +++ b/xsd-tests/schema/include/buildfile @@ -0,0 +1,27 @@ +# file : schema/include/buildfile +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +# Just make sure that the schema files and the xsd-generated C++ mappings are +# compilable. +# +import libs = libxsd%lib{xsd} +import libs += libxerces-c%lib{xerces-c} + +fs = includer schemas/includee + +exe{driver}: {hxx cxx}{** -{$fs}} {hxx cxx}{$fs} $libs + +for f: $fs +{ + <{hxx cxx}{$f}>: xsd{$f} $xsd + {{ + diag xsd ($<[0]) # @@ TMP + + $xsd cxx-tree --std c++11 \ + --root-element-all \ + --output-dir $directory($path($>[0])) \ + $path($<[0]) + }} +} + +cxx.poptions =+ "-I$out_base" diff --git a/xsd-tests/schema/include/driver.cxx b/xsd-tests/schema/include/driver.cxx new file mode 100644 index 0000000..779d9d6 --- /dev/null +++ b/xsd-tests/schema/include/driver.cxx @@ -0,0 +1,9 @@ +// file : schema/include/driver.cxx +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include "includer.hxx" + +int +main (int, char*[]) +{ +} diff --git a/xsd-tests/schema/include/includer.xsd b/xsd-tests/schema/include/includer.xsd new file mode 100644 index 0000000..c93ea18 --- /dev/null +++ b/xsd-tests/schema/include/includer.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + diff --git a/xsd-tests/schema/include/schemas/.gitignore b/xsd-tests/schema/include/schemas/.gitignore new file mode 100644 index 0000000..dcf4bb9 --- /dev/null +++ b/xsd-tests/schema/include/schemas/.gitignore @@ -0,0 +1 @@ +includee.?xx diff --git a/xsd-tests/schema/include/schemas/includee.xsd b/xsd-tests/schema/include/schemas/includee.xsd new file mode 100644 index 0000000..0a928f5 --- /dev/null +++ b/xsd-tests/schema/include/schemas/includee.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/xsd-tests/schema/inheritance/.gitignore b/xsd-tests/schema/inheritance/.gitignore new file mode 100644 index 0000000..9891c35 --- /dev/null +++ b/xsd-tests/schema/inheritance/.gitignore @@ -0,0 +1 @@ +cycle.?xx diff --git a/xsd-tests/schema/inheritance/buildfile b/xsd-tests/schema/inheritance/buildfile new file mode 100644 index 0000000..48c6dde --- /dev/null +++ b/xsd-tests/schema/inheritance/buildfile @@ -0,0 +1,30 @@ +# file : schema/inheritance/buildfile +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +fs = cycle sourced-forward/includer + +./: {hxx cxx}{$fs} + +# Make sure that the schema files are compilable. +# +for f: $fs +{ + <{hxx cxx}{$f}>: xsd{$f} $xsd + {{ + diag xsd ($<[0]) # @@ TMP + + $xsd cxx-tree --std c++11 \ + --output-dir $directory($path($>[0])) \ + $path($<[0]) + }} +} + +# Test that the invalid schema files compilation expectedly fails. +# +./: testscript xsd{** -{$fs}} $xsd + +testscript{*}: +{ + test = $xsd + test.arguments = cxx-tree --std c++11 +} diff --git a/xsd-tests/schema/inheritance/cycle.xsd b/xsd-tests/schema/inheritance/cycle.xsd new file mode 100644 index 0000000..c705311 --- /dev/null +++ b/xsd-tests/schema/inheritance/cycle.xsd @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xsd-tests/schema/inheritance/sourced-forward/.gitignore b/xsd-tests/schema/inheritance/sourced-forward/.gitignore new file mode 100644 index 0000000..4ec7484 --- /dev/null +++ b/xsd-tests/schema/inheritance/sourced-forward/.gitignore @@ -0,0 +1 @@ +includer.?xx diff --git a/xsd-tests/schema/inheritance/sourced-forward/includee.xsd b/xsd-tests/schema/inheritance/sourced-forward/includee.xsd new file mode 100644 index 0000000..531027d --- /dev/null +++ b/xsd-tests/schema/inheritance/sourced-forward/includee.xsd @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/xsd-tests/schema/inheritance/sourced-forward/includer.xsd b/xsd-tests/schema/inheritance/sourced-forward/includer.xsd new file mode 100644 index 0000000..7d18efc --- /dev/null +++ b/xsd-tests/schema/inheritance/sourced-forward/includer.xsd @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/xsd-tests/schema/inheritance/testscript b/xsd-tests/schema/inheritance/testscript new file mode 100644 index 0000000..5cc649d --- /dev/null +++ b/xsd-tests/schema/inheritance/testscript @@ -0,0 +1,8 @@ +# file : schema/inheritance/testscript +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +: base-not-found +: +$* --output-dir $~ $src_base/sourced-forward/includee.xsd 2>>/"EOE" != 0 + $src_base/sourced-forward/includee.xsd:7:35: error: base type 'Base' not found in 'Derived' definition + EOE diff --git a/xsd-tests/schema/list/anonymous/test.xsd b/xsd-tests/schema/list/anonymous/test.xsd new file mode 100644 index 0000000..7db39ba --- /dev/null +++ b/xsd-tests/schema/list/anonymous/test.xsd @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/xsd-tests/schema/list/any-simple-type/test.xsd b/xsd-tests/schema/list/any-simple-type/test.xsd new file mode 100644 index 0000000..29fe95c --- /dev/null +++ b/xsd-tests/schema/list/any-simple-type/test.xsd @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/xsd-tests/schema/list/buildfile b/xsd-tests/schema/list/buildfile new file mode 100644 index 0000000..5d8f7fc --- /dev/null +++ b/xsd-tests/schema/list/buildfile @@ -0,0 +1,31 @@ +# file : schema/list/buildfile +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +fs = test anonymous/test + +./: {hxx cxx}{$fs} + +# Make sure that the schema files are compilable. +# +for f: $fs +{ + <{hxx cxx}{$f}>: xsd{$f} $xsd + {{ + diag xsd ($<[0]) # @@ TMP + + $xsd cxx-tree --std c++11 \ + --root-element-all \ + --output-dir $directory($path($>[0])) \ + $path($<[0]) + }} +} + +# Test that the invalid schema files compilation expectedly fails. +# +./: testscript xsd{** -{$fs}} $xsd + +testscript{*}: +{ + test = $xsd + test.arguments = cxx-tree --std c++11 +} diff --git a/xsd-tests/schema/list/test.xsd b/xsd-tests/schema/list/test.xsd new file mode 100644 index 0000000..e16a58d --- /dev/null +++ b/xsd-tests/schema/list/test.xsd @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xsd-tests/schema/list/testscript b/xsd-tests/schema/list/testscript new file mode 100644 index 0000000..0916be0 --- /dev/null +++ b/xsd-tests/schema/list/testscript @@ -0,0 +1,8 @@ +# file : schema/list/testscript +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +: invalid-definition +: +$* --output-dir $~ $src_base/any-simple-type/test.xsd 2>>/"EOE" != 0 + $src_base/any-simple-type/test.xsd:9:45: error: item type definition must have variety of atomic or union where all member types must be atomic + EOE diff --git a/xsd-tests/schema/no-namespace/buildfile b/xsd-tests/schema/no-namespace/buildfile new file mode 100644 index 0000000..e407218 --- /dev/null +++ b/xsd-tests/schema/no-namespace/buildfile @@ -0,0 +1,22 @@ +# file : schema/no-namespace/buildfile +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +# Just make sure that the schema files and the xsd-generated C++ mappings are +# compilable. +# +import libs = libxsd%lib{xsd} +import libs += libxerces-c%lib{xerces-c} + +exe{driver}: {hxx cxx}{* -test} {hxx cxx}{test} $libs + +<{hxx cxx}{test}>: xsd{test} $xsd +{{ + diag xsd ($<[0]) # @@ TMP + + $xsd cxx-tree --std c++11 \ + --root-element-all \ + --output-dir $out_base \ + $path($<[0]) +}} + +cxx.poptions =+ "-I$out_base" diff --git a/xsd-tests/schema/no-namespace/driver.cxx b/xsd-tests/schema/no-namespace/driver.cxx new file mode 100644 index 0000000..ef62942 --- /dev/null +++ b/xsd-tests/schema/no-namespace/driver.cxx @@ -0,0 +1,9 @@ +// file : schema/no-namespace/driver.cxx +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include "test.hxx" + +int +main (int, char*[]) +{ +} diff --git a/xsd-tests/schema/no-namespace/test.xsd b/xsd-tests/schema/no-namespace/test.xsd new file mode 100644 index 0000000..b426e8a --- /dev/null +++ b/xsd-tests/schema/no-namespace/test.xsd @@ -0,0 +1,15 @@ + + + + + + + + + + + + + diff --git a/xsd-tests/schema/recursive/buildfile b/xsd-tests/schema/recursive/buildfile new file mode 100644 index 0000000..34542c6 --- /dev/null +++ b/xsd-tests/schema/recursive/buildfile @@ -0,0 +1,22 @@ +# file : schema/recursive/buildfile +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +# Just make sure that the schema files and the xsd-generated C++ mappings are +# compilable. +# +import libs = libxsd%lib{xsd} +import libs += libxerces-c%lib{xerces-c} + +exe{driver}: {hxx cxx}{* -test} {hxx cxx}{test} $libs + +<{hxx cxx}{test}>: xsd{test} $xsd +{{ + diag xsd ($<[0]) # @@ TMP + + $xsd cxx-tree --std c++11 \ + --root-element-all \ + --output-dir $out_base \ + $path($<[0]) +}} + +cxx.poptions =+ "-I$out_base" diff --git a/xsd-tests/schema/recursive/driver.cxx b/xsd-tests/schema/recursive/driver.cxx new file mode 100644 index 0000000..55c33cd --- /dev/null +++ b/xsd-tests/schema/recursive/driver.cxx @@ -0,0 +1,9 @@ +// file : schema/recursive/driver.cxx +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include "test.hxx" + +int +main (int, char*[]) +{ +} diff --git a/xsd-tests/schema/recursive/test.xsd b/xsd-tests/schema/recursive/test.xsd new file mode 100644 index 0000000..6efc7d2 --- /dev/null +++ b/xsd-tests/schema/recursive/test.xsd @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xsd-tests/schema/ref-type/invalid/buildfile b/xsd-tests/schema/ref-type/invalid/buildfile new file mode 100644 index 0000000..42c7bfb --- /dev/null +++ b/xsd-tests/schema/ref-type/invalid/buildfile @@ -0,0 +1,12 @@ +# file : schema/ref-type/invalid/buildfile +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +# Test that the invalid schema files compilation expectedly fails. +# +./: testscript xsd{*} $xsd + +testscript{*}: +{ + test = $xsd + test.arguments = cxx-tree --std c++11 +} diff --git a/xsd-tests/schema/ref-type/invalid/invalid-0.xsd b/xsd-tests/schema/ref-type/invalid/invalid-0.xsd new file mode 100644 index 0000000..7ce82ed --- /dev/null +++ b/xsd-tests/schema/ref-type/invalid/invalid-0.xsd @@ -0,0 +1,17 @@ + + + + + + + + + + + + + diff --git a/xsd-tests/schema/ref-type/invalid/invalid-1.xsd b/xsd-tests/schema/ref-type/invalid/invalid-1.xsd new file mode 100644 index 0000000..d989065 --- /dev/null +++ b/xsd-tests/schema/ref-type/invalid/invalid-1.xsd @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/xsd-tests/schema/ref-type/invalid/testscript b/xsd-tests/schema/ref-type/invalid/testscript new file mode 100644 index 0000000..ce2e049 --- /dev/null +++ b/xsd-tests/schema/ref-type/invalid/testscript @@ -0,0 +1,16 @@ +# file : schema/ref-type/invalid/testscript +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +: unresolvable-namespace-prefix +: +$* --output-dir $~ $src_base/invalid-0.xsd 2>>~%EOE%d != 0 + %\.+invalid-0.xsd:10:75: error: unable to resolve namespace ''% + %\.+invalid-0.xsd:11:77: error: unable to resolve namespace prefix 't' in 't:author'% + %\.+invalid-0.xsd:15:81: error: unable to resolve namespace 'http://www.codesynthesis.com/xmlns/phony'% + EOE + +: unresolvable-type +: +$* --output-dir $~ $src_base/invalid-1.xsd 2>>~%EOE%d != 0 + %\.+invalid-1.xsd:9:79: error: unable to resolve type 'author' in namespace 'http://www.codesynthesis.com/xmlns/test'% + EOE diff --git a/xsd-tests/schema/ref-type/valid/.gitignore b/xsd-tests/schema/ref-type/valid/.gitignore new file mode 100644 index 0000000..fd203ec --- /dev/null +++ b/xsd-tests/schema/ref-type/valid/.gitignore @@ -0,0 +1,6 @@ +driver-idref +driver-idrefs +driver-idref.?xx +driver-idrefs.?xx +idref.?xx +idrefs.?xx diff --git a/xsd-tests/schema/ref-type/valid/buildfile b/xsd-tests/schema/ref-type/valid/buildfile new file mode 100644 index 0000000..0534fce --- /dev/null +++ b/xsd-tests/schema/ref-type/valid/buildfile @@ -0,0 +1,35 @@ +# file : schema/ref-type/valid/buildfile +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +# Just make sure that the schema files and the xsd-generated C++ mappings are +# compilable. +# +import libs = libxsd%lib{xsd} +import libs += libxerces-c%lib{xerces-c} + +for sc: idref idrefs +{ + dr = "driver-$sc" + + ./: exe{$dr}: cxx{$dr} {hxx cxx}{$sc} $libs + + cxx{$dr}: in{driver} + { + # Note: we can't use $sc$ in driver.cxx.in since it will be substituted by + # the latest $sc value. + # + sch = $sc + } + + <{hxx cxx}{$sc}>: xsd{$sc} $xsd + {{ + diag xsd ($<[0]) # @@ TMP + + $xsd cxx-tree --std c++11 \ + --root-element-all \ + --output-dir $out_base \ + $path($<[0]) + }} +} + +cxx.poptions =+ "-I$out_base" diff --git a/xsd-tests/schema/ref-type/valid/driver.cxx.in b/xsd-tests/schema/ref-type/valid/driver.cxx.in new file mode 100644 index 0000000..434aa40 --- /dev/null +++ b/xsd-tests/schema/ref-type/valid/driver.cxx.in @@ -0,0 +1,9 @@ +// file : schema/ref-type/valid/driver.cxx.in +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include "$sch$.hxx" + +int +main (int, char*[]) +{ +} diff --git a/xsd-tests/schema/ref-type/valid/idref.xsd b/xsd-tests/schema/ref-type/valid/idref.xsd new file mode 100644 index 0000000..49ebe40 --- /dev/null +++ b/xsd-tests/schema/ref-type/valid/idref.xsd @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xsd-tests/schema/ref-type/valid/idrefs.xsd b/xsd-tests/schema/ref-type/valid/idrefs.xsd new file mode 100644 index 0000000..b68ed03 --- /dev/null +++ b/xsd-tests/schema/ref-type/valid/idrefs.xsd @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xsd-tests/schema/restriction/buildfile b/xsd-tests/schema/restriction/buildfile new file mode 100644 index 0000000..c05718a --- /dev/null +++ b/xsd-tests/schema/restriction/buildfile @@ -0,0 +1,22 @@ +# file : schema/restriction/buildfile +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +# Just make sure that the schema files and the xsd-generated C++ mappings are +# compilable. +# +import libs = libxsd%lib{xsd} +import libs += libxerces-c%lib{xerces-c} + +exe{driver}: {hxx cxx}{* -test} {hxx cxx}{test} $libs + +<{hxx cxx}{test}>: xsd{test} $xsd +{{ + diag xsd ($<[0]) # @@ TMP + + $xsd cxx-tree --std c++11 \ + --root-element-all \ + --output-dir $out_base \ + $path($<[0]) +}} + +cxx.poptions =+ "-I$out_base" diff --git a/xsd-tests/schema/restriction/driver.cxx b/xsd-tests/schema/restriction/driver.cxx new file mode 100644 index 0000000..2ffeb74 --- /dev/null +++ b/xsd-tests/schema/restriction/driver.cxx @@ -0,0 +1,9 @@ +// file : schema/restriction/driver.cxx +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include "test.hxx" + +int +main (int, char*[]) +{ +} diff --git a/xsd-tests/schema/restriction/test.xsd b/xsd-tests/schema/restriction/test.xsd new file mode 100644 index 0000000..331ba78 --- /dev/null +++ b/xsd-tests/schema/restriction/test.xsd @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xsd-tests/schema/union/buildfile b/xsd-tests/schema/union/buildfile new file mode 100644 index 0000000..00d0a83 --- /dev/null +++ b/xsd-tests/schema/union/buildfile @@ -0,0 +1,22 @@ +# file : schema/union/buildfile +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +# Just make sure that the schema files and the xsd-generated C++ mappings are +# compilable. +# +import libs = libxsd%lib{xsd} +import libs += libxerces-c%lib{xerces-c} + +exe{driver}: {hxx cxx}{* -test} {hxx cxx}{test} $libs + +<{hxx cxx}{test}>: xsd{test} $xsd +{{ + diag xsd ($<[0]) # @@ TMP + + $xsd cxx-tree --std c++11 \ + --root-element-all \ + --output-dir $out_base \ + $path($<[0]) +}} + +cxx.poptions =+ "-I$out_base" diff --git a/xsd-tests/schema/union/driver.cxx b/xsd-tests/schema/union/driver.cxx new file mode 100644 index 0000000..45f290f --- /dev/null +++ b/xsd-tests/schema/union/driver.cxx @@ -0,0 +1,9 @@ +// file : schema/union/driver.cxx +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include "test.hxx" + +int +main (int, char*[]) +{ +} diff --git a/xsd-tests/schema/union/test.xsd b/xsd-tests/schema/union/test.xsd new file mode 100644 index 0000000..706f6f2 --- /dev/null +++ b/xsd-tests/schema/union/test.xsd @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.1