diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2020-12-18 18:48:46 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2021-01-13 22:32:43 +0300 |
commit | 2615896faa646e5830abf2c269150e1165c66515 (patch) | |
tree | 7d95978ec0a83094c9462ed4e1f59d42f4ff8ddb /xsd-tests/schema/cardinality | |
parent | 7420f85ea19b0562ffdd8123442f32bc8bac1267 (diff) |
Switch to build2
Diffstat (limited to 'xsd-tests/schema/cardinality')
-rw-r--r-- | xsd-tests/schema/cardinality/buildfile | 19 | ||||
-rw-r--r-- | xsd-tests/schema/cardinality/driver.cxx | 9 | ||||
-rw-r--r-- | xsd-tests/schema/cardinality/test.xsd | 46 |
3 files changed, 74 insertions, 0 deletions
diff --git a/xsd-tests/schema/cardinality/buildfile b/xsd-tests/schema/cardinality/buildfile new file mode 100644 index 0000000..1be395e --- /dev/null +++ b/xsd-tests/schema/cardinality/buildfile @@ -0,0 +1,19 @@ +# file : schema/cardinality/buildfile +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +import libs = libxsd%lib{xsd} +import libs += libxerces-c%lib{xerces-c} + +exe{driver}: {hxx cxx}{* -test} {hxx cxx}{test} $libs + +cxx.poptions =+ "-I$out_base" + +<{hxx cxx}{test}>: xsd{test} $xsd +{{ + diag xsd ($<[0]) # @@ TMP + + $xsd cxx-tree $xsd_cxx_std \ + --root-element-all \ + --output-dir $out_base \ + $path($<[0]) +}} 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 @@ +<?xml version="1.0" ?> +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.w3.org/2001/XMLSchema XMLSchema.xsd" + xmlns:test="http://www.codesynthesis.com/xmlns/test" + targetNamespace="http://www.codesynthesis.com/xmlns/test"> + + <!-- + This test tries to cover various cardinality cases with + built-in and user-defined types. + --> + + <xsd:complexType name="Foo"> + <xsd:sequence> + <xsd:element name="foo" type="xsd:string"/> + </xsd:sequence> + </xsd:complexType> + + <xsd:complexType name="Bar"> + <xsd:sequence> + + <xsd:element name="one-int" type="xsd:int"/> + <xsd:element name="opt-int" type="xsd:int" minOccurs="0"/> + <xsd:element name="seq-int" type="xsd:int" maxOccurs="unbounded"/> + + <xsd:element name="one-string" type="xsd:string"/> + <xsd:element name="opt-string" type="xsd:string" minOccurs="0"/> + <xsd:element name="seq-string" type="xsd:string" maxOccurs="unbounded"/> + + <xsd:element name="one-foo" type="test:Foo"/> + <xsd:element name="opt-foo" type="test:Foo" minOccurs="0"/> + <xsd:element name="seq-foo" type="test:Foo" maxOccurs="unbounded"/> + + </xsd:sequence> + + <xsd:attribute name="one-int-a" type="xsd:int" use="required"/> + <xsd:attribute name="opt-int-a" type="xsd:int"/> + + <xsd:attribute name="one-string-a" type="xsd:string" use="required"/> + <xsd:attribute name="opt-string-a" type="xsd:string"/> + + </xsd:complexType> + + <xsd:element name="bar" type="test:Bar"/> + +</xsd:schema> |