aboutsummaryrefslogtreecommitdiff
path: root/tests/cxx/serializer/generated-impl
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-02-24 15:16:26 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-02-24 15:16:26 +0200
commit707cc94fe52463870a9c6c8e2e66eaaa389e601d (patch)
tree13e10ff28bf4455d915f9d59b401bdbb62a393cb /tests/cxx/serializer/generated-impl
Start tracking XSD/e with git after version 3.0.03.0.0
Diffstat (limited to 'tests/cxx/serializer/generated-impl')
-rw-r--r--tests/cxx/serializer/generated-impl/makefile84
-rw-r--r--tests/cxx/serializer/generated-impl/test.xsd193
2 files changed, 277 insertions, 0 deletions
diff --git a/tests/cxx/serializer/generated-impl/makefile b/tests/cxx/serializer/generated-impl/makefile
new file mode 100644
index 0000000..fc6c6b9
--- /dev/null
+++ b/tests/cxx/serializer/generated-impl/makefile
@@ -0,0 +1,84 @@
+# file : tests/cxx/serializer/generated-impl/makefile
+# author : Boris Kolpackov <boris@codesynthesis.com>
+# copyright : Copyright (c) 2006-2009 Code Synthesis Tools CC
+# license : GNU GPL v2 + exceptions; see accompanying LICENSE file
+
+include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make
+
+# Note that this test only checks compilation of the generated empty
+# implementation and test driver. It may not work with some compilers
+# (missing return statements).
+#
+
+xsd := test.xsd
+
+obj := $(addprefix $(out_base)/,$(xsd:.xsd=-sskel.o) $(xsd:.xsd=-simpl.o) $(xsd:.xsd=-sdriver.o))
+dep := $(obj:.o=.o.d)
+
+xsde.l := $(out_root)/libxsde/xsde/xsde.l
+xsde.l.cpp-options := $(out_root)/libxsde/xsde/xsde.l.cpp-options
+
+driver := $(out_base)/$(xsd:.xsd=-sdriver)
+test := $(out_base)/.test
+clean := $(out_base)/.clean
+
+
+# Build.
+#
+$(driver): $(obj) $(xsde.l)
+
+$(obj) $(dep): $(xsde.l.cpp-options)
+
+gen := $(out_base)/$(xsd:.xsd=-sskel.hxx) \
+ $(out_base)/$(xsd:.xsd=-sskel.ixx) \
+ $(out_base)/$(xsd:.xsd=-sskel.cxx) \
+ $(out_base)/$(xsd:.xsd=-simpl.hxx) \
+ $(out_base)/$(xsd:.xsd=-simpl.cxx) \
+ $(out_base)/$(xsd:.xsd=-sdriver.cxx)
+
+$(gen): xsde := $(out_root)/xsde/xsde
+$(gen): xsde_options += --generate-empty-impl --generate-test-driver \
+--force-overwrite
+$(gen): $(out_root)/xsde/xsde
+
+$(call include-dep,$(dep))
+
+# Convenience alias for default target.
+#
+.PHONY: $(out_base)/
+$(out_base)/: $(driver)
+
+
+# Test.
+#
+.PHONY: $(test)
+
+$(test): driver := $(driver)
+$(test): $(driver)
+ $(call message,test $$1,:,$(driver))
+
+# Clean.
+#
+.PHONY: $(clean)
+
+$(clean): $(driver).o.clean \
+ $(addsuffix .cxx.clean,$(obj)) \
+ $(addsuffix .cxx.clean,$(dep)) \
+ $(addprefix $(out_base)/,$(xsd:.xsd=-sskel.cxx.xsd.clean)) \
+ $(addprefix $(out_base)/,$(xsd:.xsd=-simpl.cxx.xsd.clean))
+
+
+# How to.
+#
+$(call include,$(bld_root)/cxx/o-e.make)
+$(call include,$(bld_root)/cxx/cxx-o.make)
+$(call include,$(bld_root)/cxx/cxx-d.make)
+
+xsd_simpl_suffix := -simpl
+$(call include,$(scf_root)/xsde/serializer/xsd-cxx.make)
+
+
+# Dependencies.
+#
+$(call import,$(src_root)/xsde/makefile)
+$(call import,$(src_root)/libxsde/xsde/makefile)
diff --git a/tests/cxx/serializer/generated-impl/test.xsd b/tests/cxx/serializer/generated-impl/test.xsd
new file mode 100644
index 0000000..f38c005
--- /dev/null
+++ b/tests/cxx/serializer/generated-impl/test.xsd
@@ -0,0 +1,193 @@
+<?xml version="1.0"?>
+<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:t="test" targetNamespace="test">
+
+ <!-- enum -->
+
+ <simpleType name="gender">
+ <restriction base="string">
+ <enumeration value="male"/>
+ <enumeration value="female"/>
+ </restriction>
+ </simpleType>
+
+ <complexType name="gender-extension">
+ <simpleContent>
+ <extension base="t:gender">
+ <attribute name="foo" type="string"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+
+ <!-- list -->
+
+ <simpleType name="list">
+ <list itemType="int"/>
+ </simpleType>
+
+ <complexType name="list-extension">
+ <simpleContent>
+ <extension base="t:list">
+ <attribute name="foo" type="string"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+
+ <!-- union -->
+
+ <simpleType name="union">
+ <union memberTypes="int string"/>
+ </simpleType>
+
+ <complexType name="union-extension">
+ <simpleContent>
+ <extension base="t:union">
+ <attribute name="foo" type="string"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+
+ <!-- complex -->
+
+ <complexType name="complex">
+ <sequence>
+ <element name="a" type="string"/>
+ </sequence>
+ <attribute name="x" type="string" use="required"/>
+ </complexType>
+
+ <complexType name="complex-extension">
+ <complexContent>
+ <extension base="t:complex">
+ <sequence>
+ <element name="b" type="string" minOccurs="0"/>
+ <element name="c" type="string" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="y" type="string"/>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="complex-opt-all">
+ <all minOccurs="0">
+ <element name="a" type="string"/>
+ <element name="b" type="string"/>
+ </all>
+ </complexType>
+
+ <complexType name="complex-opt-seq">
+ <sequence minOccurs="0">
+ <element name="a" type="string"/>
+ <element name="b" type="string"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="complex-seq-seq">
+ <sequence maxOccurs="unbounded">
+ <element name="a" type="string"/>
+ <element name="b" type="string"/>
+ </sequence>
+ </complexType>
+
+ <complexType name="complex-opt-choice">
+ <choice minOccurs="0">
+ <element name="a" type="string"/>
+ <element name="b" type="string"/>
+ </choice>
+ </complexType>
+
+ <complexType name="complex-seq-choice">
+ <choice maxOccurs="unbounded">
+ <element name="a" type="string"/>
+ <element name="b" type="string"/>
+ </choice>
+ </complexType>
+
+ <complexType name="complex-any">
+ <sequence>
+ <any namespace="foo" processContents="skip" minOccurs="0"/>
+ <any namespace="bar" processContents="skip" maxOccurs="unbounded"/>
+ </sequence>
+ <anyAttribute namespace="foo" processContents="skip"/>
+ </complexType>
+
+ <complexType name="type">
+ <sequence>
+ <element name="gender" type="t:gender"/>
+ <element name="gender-extension" type="t:gender-extension"/>
+
+ <element name="list" type="t:list"/>
+ <element name="list-extension" type="t:list-extension"/>
+
+ <element name="union" type="t:union"/>
+ <element name="union-extension" type="t:union-extension"/>
+
+ <element name="complex" type="t:complex"/>
+ <element name="complex-extension" type="t:complex-extension"/>
+
+ <element name="complex-opt-all" type="t:complex-opt-all"/>
+ <element name="complex-opt-seq" type="t:complex-opt-seq"/>
+ <element name="complex-seq-seq" type="t:complex-seq-seq"/>
+ <element name="complex-opt-choice" type="t:complex-opt-choice"/>
+ <element name="complex-seq-choice" type="t:complex-seq-choice"/>
+ <element name="complex-any" type="t:complex-any"/>
+
+ <!-- Built-in types. -->
+
+ <element name="any-type" type="anyType" maxOccurs="unbounded"/>
+ <element name="any-simple-type" type="anySimpleType" maxOccurs="unbounded"/>
+
+ <element name="boolean" type="boolean" maxOccurs="unbounded"/>
+
+ <element name="byte" type="byte" maxOccurs="unbounded"/>
+ <element name="unsigned-byte" type="unsignedByte" maxOccurs="unbounded"/>
+ <element name="short" type="short" maxOccurs="unbounded"/>
+ <element name="unsigned-short" type="unsignedShort" maxOccurs="unbounded"/>
+ <element name="int" type="int" maxOccurs="unbounded"/>
+ <element name="unsigned-int" type="unsignedInt" maxOccurs="unbounded"/>
+ <element name="long" type="long" maxOccurs="unbounded"/>
+ <element name="unsigned-long" type="unsignedLong" maxOccurs="unbounded"/>
+
+ <element name="integer" type="integer" maxOccurs="unbounded"/>
+ <element name="negative-integer" type="negativeInteger" maxOccurs="unbounded"/>
+ <element name="non-positive-integer" type="nonPositiveInteger" maxOccurs="unbounded"/>
+ <element name="positive-integer" type="positiveInteger" maxOccurs="unbounded"/>
+ <element name="non-negative-integer" type="nonNegativeInteger" maxOccurs="unbounded"/>
+
+ <element name="float" type="float" maxOccurs="unbounded"/>
+ <element name="double" type="double" maxOccurs="unbounded"/>
+ <element name="decimal" type="decimal" maxOccurs="unbounded"/>
+
+ <element name="string" type="string" maxOccurs="unbounded"/>
+ <element name="normalized-string" type="normalizedString" maxOccurs="unbounded"/>
+ <element name="token" type="token" maxOccurs="unbounded"/>
+ <element name="name" type="Name" maxOccurs="unbounded"/>
+ <element name="nmtoken" type="NMTOKEN" maxOccurs="unbounded"/>
+ <element name="nmtokens" type="NMTOKENS" maxOccurs="unbounded"/>
+ <element name="ncname" type="NCName" maxOccurs="unbounded"/>
+ <element name="id" type="ID" maxOccurs="unbounded"/>
+ <element name="idref" type="IDREF" maxOccurs="unbounded"/>
+ <element name="idrefs" type="IDREFS" maxOccurs="unbounded"/>
+
+ <element name="language" type="language" maxOccurs="unbounded"/>
+ <element name="uri" type="anyURI" maxOccurs="unbounded"/>
+ <element name="qname" type="QName" maxOccurs="unbounded"/>
+
+ <element name="base64_binary" type="base64Binary" maxOccurs="unbounded"/>
+ <element name="hex_binary" type="hexBinary" maxOccurs="unbounded"/>
+
+ <element name="gday" type="gDay" maxOccurs="unbounded"/>
+ <element name="gmonth" type="gMonth" maxOccurs="unbounded"/>
+ <element name="gyear" type="gYear" maxOccurs="unbounded"/>
+ <element name="gmonth_day" type="gMonthDay" maxOccurs="unbounded"/>
+ <element name="gyear_month" type="gYearMonth" maxOccurs="unbounded"/>
+ <element name="date" type="date" maxOccurs="unbounded"/>
+ <element name="time" type="time" maxOccurs="unbounded"/>
+ <element name="date_time" type="dateTime" maxOccurs="unbounded"/>
+ <element name="duration" type="duration" maxOccurs="unbounded"/>
+
+ </sequence>
+ </complexType>
+
+ <element name="root" type="t:type"/>
+
+</schema>