From bada6666c70977a058755ccf232e7d67b24adeed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 23 Jul 2014 15:21:29 +0200 Subject: New upstream release --- xsd/tests/cxx/makefile | 3 +- xsd/tests/cxx/parser/built-in/driver.cxx | 9 +- xsd/tests/cxx/parser/built-in/makefile | 12 +- xsd/tests/cxx/parser/enumeration/driver.cxx | 3 +- xsd/tests/cxx/parser/enumeration/gender.hxx | 3 +- xsd/tests/cxx/parser/enumeration/makefile | 14 +- xsd/tests/cxx/parser/generated-impl/makefile | 14 +- xsd/tests/cxx/parser/list/driver.cxx | 3 +- xsd/tests/cxx/parser/list/makefile | 12 +- xsd/tests/cxx/parser/makefile | 3 +- .../cxx/parser/name-clash/inheritance/driver.cxx | 3 +- .../cxx/parser/name-clash/inheritance/makefile | 14 +- xsd/tests/cxx/parser/polymorphism/makefile | 5 +- .../cxx/parser/polymorphism/recursive/driver.cxx | 69 ++++++++++ .../cxx/parser/polymorphism/recursive/makefile | 84 ++++++++++++ xsd/tests/cxx/parser/polymorphism/recursive/output | 22 +++ .../parser/polymorphism/recursive/test-pimpl.cxx | 148 +++++++++++++++++++++ .../parser/polymorphism/recursive/test-pimpl.hxx | 95 +++++++++++++ .../cxx/parser/polymorphism/recursive/test.xml | 15 +++ .../cxx/parser/polymorphism/recursive/test.xsd | 53 ++++++++ .../cxx/parser/polymorphism/same-type/driver.cxx | 5 +- .../cxx/parser/polymorphism/same-type/makefile | 14 +- xsd/tests/cxx/parser/recursive/driver.cxx | 3 +- xsd/tests/cxx/parser/recursive/makefile | 14 +- xsd/tests/cxx/parser/test-template/driver.cxx | 3 +- xsd/tests/cxx/parser/test-template/makefile | 12 +- xsd/tests/cxx/parser/union/driver.cxx | 3 +- xsd/tests/cxx/parser/union/makefile | 12 +- xsd/tests/cxx/parser/validation/all/driver.cxx | 3 +- xsd/tests/cxx/parser/validation/all/makefile | 14 +- xsd/tests/cxx/parser/validation/any/driver.cxx | 3 +- xsd/tests/cxx/parser/validation/any/makefile | 14 +- .../cxx/parser/validation/attribute/driver.cxx | 3 +- xsd/tests/cxx/parser/validation/attribute/makefile | 14 +- .../parser/validation/built-in/any-type/driver.cxx | 3 +- .../parser/validation/built-in/any-type/makefile | 14 +- .../parser/validation/built-in/binary/driver.cxx | 3 +- .../cxx/parser/validation/built-in/binary/makefile | 14 +- .../parser/validation/built-in/boolean/driver.cxx | 3 +- .../parser/validation/built-in/boolean/makefile | 14 +- .../cxx/parser/validation/built-in/byte/driver.cxx | 3 +- .../cxx/parser/validation/built-in/byte/makefile | 14 +- .../validation/built-in/date-time/driver.cxx | 3 +- .../parser/validation/built-in/date-time/makefile | 14 +- .../parser/validation/built-in/float/driver.cxx | 3 +- .../cxx/parser/validation/built-in/float/makefile | 14 +- .../cxx/parser/validation/built-in/int/driver.cxx | 3 +- .../cxx/parser/validation/built-in/int/makefile | 14 +- .../parser/validation/built-in/integer/driver.cxx | 3 +- .../parser/validation/built-in/integer/makefile | 14 +- .../cxx/parser/validation/built-in/long/driver.cxx | 3 +- .../cxx/parser/validation/built-in/long/makefile | 14 +- xsd/tests/cxx/parser/validation/built-in/makefile | 3 +- .../parser/validation/built-in/qname/driver.cxx | 3 +- .../cxx/parser/validation/built-in/qname/makefile | 14 +- .../parser/validation/built-in/short/driver.cxx | 3 +- .../cxx/parser/validation/built-in/short/makefile | 14 +- .../parser/validation/built-in/string/driver.cxx | 3 +- .../cxx/parser/validation/built-in/string/makefile | 14 +- .../cxx/parser/validation/built-in/uri/driver.cxx | 3 +- .../cxx/parser/validation/built-in/uri/makefile | 14 +- xsd/tests/cxx/parser/validation/choice/driver.cxx | 3 +- xsd/tests/cxx/parser/validation/choice/makefile | 14 +- xsd/tests/cxx/parser/validation/makefile | 3 +- .../cxx/parser/validation/restriction/driver.cxx | 3 +- .../cxx/parser/validation/restriction/makefile | 14 +- .../cxx/parser/validation/sequence/driver.cxx | 3 +- xsd/tests/cxx/parser/validation/sequence/makefile | 14 +- xsd/tests/cxx/tree/any-type/driver.cxx | 145 ++++++++++++++++++++ xsd/tests/cxx/tree/any-type/makefile | 87 ++++++++++++ xsd/tests/cxx/tree/any-type/output | 73 ++++++++++ xsd/tests/cxx/tree/any-type/test.xml | 26 ++++ xsd/tests/cxx/tree/any-type/test.xsd | 19 +++ xsd/tests/cxx/tree/binary/cdr/driver.cxx | 17 ++- xsd/tests/cxx/tree/binary/cdr/makefile | 16 ++- xsd/tests/cxx/tree/binary/cdr/test.xml | 4 +- xsd/tests/cxx/tree/binary/cdr/test.xsd | 3 + xsd/tests/cxx/tree/binary/makefile | 3 +- xsd/tests/cxx/tree/binary/polymorphic/driver.cxx | 24 +++- xsd/tests/cxx/tree/binary/polymorphic/makefile | 17 ++- xsd/tests/cxx/tree/binary/xdr/driver.cxx | 29 ++-- xsd/tests/cxx/tree/binary/xdr/makefile | 15 ++- xsd/tests/cxx/tree/binary/xdr/test.xml | 4 +- xsd/tests/cxx/tree/binary/xdr/test.xsd | 3 + xsd/tests/cxx/tree/built-in/driver.cxx | 22 +-- xsd/tests/cxx/tree/built-in/makefile | 17 ++- xsd/tests/cxx/tree/chameleon/driver.cxx | 7 +- xsd/tests/cxx/tree/chameleon/makefile | 14 +- xsd/tests/cxx/tree/comparison/driver.cxx | 7 +- xsd/tests/cxx/tree/comparison/makefile | 14 +- xsd/tests/cxx/tree/compilation/driver.cxx | 6 +- xsd/tests/cxx/tree/compilation/makefile | 14 +- xsd/tests/cxx/tree/complex/ctor/driver.cxx | 53 +++++--- xsd/tests/cxx/tree/complex/ctor/makefile | 15 ++- xsd/tests/cxx/tree/complex/makefile | 3 +- xsd/tests/cxx/tree/containment/driver.cxx | 48 ++++--- xsd/tests/cxx/tree/containment/makefile | 14 +- xsd/tests/cxx/tree/default/general/driver.cxx | 7 +- xsd/tests/cxx/tree/default/general/makefile | 14 +- xsd/tests/cxx/tree/default/general/output | 13 -- xsd/tests/cxx/tree/default/makefile | 3 +- xsd/tests/cxx/tree/default/omit/driver.cxx | 7 +- xsd/tests/cxx/tree/default/omit/makefile | 14 +- xsd/tests/cxx/tree/default/omit/output | 2 - xsd/tests/cxx/tree/detach/driver.cxx | 26 ++-- xsd/tests/cxx/tree/detach/makefile | 14 +- xsd/tests/cxx/tree/dom-association/dom-parse.cxx | 96 +++++++++++++ xsd/tests/cxx/tree/dom-association/dom-parse.hxx | 24 ++++ xsd/tests/cxx/tree/dom-association/driver.cxx | 72 ++++++++++ xsd/tests/cxx/tree/dom-association/makefile | 92 +++++++++++++ xsd/tests/cxx/tree/dom-association/output | 0 xsd/tests/cxx/tree/dom-association/test.xml | 7 + xsd/tests/cxx/tree/dom-association/test.xsd | 12 ++ .../cxx/tree/encoding/char/iso-8859-1/driver.cxx | 7 +- .../cxx/tree/encoding/char/iso-8859-1/makefile | 14 +- .../cxx/tree/encoding/char/iso-8859-1/test.std | 8 -- xsd/tests/cxx/tree/encoding/char/lcp/driver.cxx | 7 +- xsd/tests/cxx/tree/encoding/char/lcp/makefile | 14 +- xsd/tests/cxx/tree/encoding/char/lcp/test.std | 2 - xsd/tests/cxx/tree/encoding/char/makefile | 3 +- xsd/tests/cxx/tree/encoding/char/utf-8/driver.cxx | 9 +- xsd/tests/cxx/tree/encoding/char/utf-8/makefile | 14 +- xsd/tests/cxx/tree/encoding/char/utf-8/test.std | Bin 796 -> 230 bytes xsd/tests/cxx/tree/encoding/makefile | 3 +- xsd/tests/cxx/tree/encoding/wchar/driver.cxx | 9 +- xsd/tests/cxx/tree/encoding/wchar/makefile | 14 +- xsd/tests/cxx/tree/encoding/wchar/test.std | Bin 768 -> 261 bytes xsd/tests/cxx/tree/enumeration/ctor/driver.cxx | 3 +- xsd/tests/cxx/tree/enumeration/ctor/makefile | 14 +- .../cxx/tree/enumeration/inheritance/driver.cxx | 13 +- .../cxx/tree/enumeration/inheritance/makefile | 14 +- xsd/tests/cxx/tree/enumeration/makefile | 3 +- xsd/tests/cxx/tree/float/driver.cxx | 7 +- xsd/tests/cxx/tree/float/makefile | 14 +- xsd/tests/cxx/tree/float/test.std | 33 ----- xsd/tests/cxx/tree/list/ctor/driver.cxx | 3 +- xsd/tests/cxx/tree/list/ctor/makefile | 14 +- xsd/tests/cxx/tree/list/makefile | 3 +- xsd/tests/cxx/tree/makefile | 46 ++++--- .../cxx/tree/name-clash/inheritance/driver.cxx | 7 +- xsd/tests/cxx/tree/name-clash/inheritance/makefile | 14 +- xsd/tests/cxx/tree/name-clash/makefile | 3 +- xsd/tests/cxx/tree/naming/camel/driver.cxx | 16 ++- xsd/tests/cxx/tree/naming/camel/makefile | 14 +- xsd/tests/cxx/tree/naming/java/driver.cxx | 15 ++- xsd/tests/cxx/tree/naming/java/makefile | 14 +- xsd/tests/cxx/tree/naming/knr/driver.cxx | 16 ++- xsd/tests/cxx/tree/naming/knr/makefile | 14 +- xsd/tests/cxx/tree/naming/makefile | 3 +- xsd/tests/cxx/tree/order/driver.cxx | 65 +++++++++ xsd/tests/cxx/tree/order/makefile | 94 +++++++++++++ xsd/tests/cxx/tree/order/output | 92 +++++++++++++ xsd/tests/cxx/tree/order/test.xml | 71 ++++++++++ xsd/tests/cxx/tree/order/test.xsd | 130 ++++++++++++++++++ .../cxx/tree/polymorphism/comparison/driver.cxx | 7 +- .../cxx/tree/polymorphism/comparison/makefile | 14 +- xsd/tests/cxx/tree/polymorphism/makefile | 3 +- xsd/tests/cxx/tree/polymorphism/ostream/driver.cxx | 7 +- xsd/tests/cxx/tree/polymorphism/ostream/makefile | 16 ++- xsd/tests/cxx/tree/polymorphism/ostream/output | 5 + xsd/tests/cxx/tree/polymorphism/ostream/test.xml | 13 +- xsd/tests/cxx/tree/polymorphism/ostream/test.xsd | 18 ++- .../cxx/tree/polymorphism/same-type/driver.cxx | 7 +- xsd/tests/cxx/tree/polymorphism/same-type/makefile | 14 +- xsd/tests/cxx/tree/prefix/driver.cxx | 7 +- xsd/tests/cxx/tree/prefix/makefile | 16 ++- xsd/tests/cxx/tree/prefix/output | 4 - xsd/tests/cxx/tree/test-template/driver.cxx | 7 +- xsd/tests/cxx/tree/test-template/makefile | 14 +- xsd/tests/cxx/tree/types-only/driver.cxx | 4 +- xsd/tests/cxx/tree/types-only/makefile | 14 +- xsd/tests/cxx/tree/union/ctor/driver.cxx | 3 +- xsd/tests/cxx/tree/union/ctor/makefile | 14 +- xsd/tests/cxx/tree/union/makefile | 3 +- xsd/tests/cxx/tree/wildcard/driver.cxx | 16 ++- xsd/tests/cxx/tree/wildcard/makefile | 14 +- xsd/tests/makefile | 3 +- 177 files changed, 2505 insertions(+), 658 deletions(-) create mode 100644 xsd/tests/cxx/parser/polymorphism/recursive/driver.cxx create mode 100644 xsd/tests/cxx/parser/polymorphism/recursive/makefile create mode 100644 xsd/tests/cxx/parser/polymorphism/recursive/output create mode 100644 xsd/tests/cxx/parser/polymorphism/recursive/test-pimpl.cxx create mode 100644 xsd/tests/cxx/parser/polymorphism/recursive/test-pimpl.hxx create mode 100644 xsd/tests/cxx/parser/polymorphism/recursive/test.xml create mode 100644 xsd/tests/cxx/parser/polymorphism/recursive/test.xsd create mode 100644 xsd/tests/cxx/tree/any-type/driver.cxx create mode 100644 xsd/tests/cxx/tree/any-type/makefile create mode 100644 xsd/tests/cxx/tree/any-type/output create mode 100644 xsd/tests/cxx/tree/any-type/test.xml create mode 100644 xsd/tests/cxx/tree/any-type/test.xsd create mode 100644 xsd/tests/cxx/tree/dom-association/dom-parse.cxx create mode 100644 xsd/tests/cxx/tree/dom-association/dom-parse.hxx create mode 100644 xsd/tests/cxx/tree/dom-association/driver.cxx create mode 100644 xsd/tests/cxx/tree/dom-association/makefile create mode 100644 xsd/tests/cxx/tree/dom-association/output create mode 100644 xsd/tests/cxx/tree/dom-association/test.xml create mode 100644 xsd/tests/cxx/tree/dom-association/test.xsd create mode 100644 xsd/tests/cxx/tree/order/driver.cxx create mode 100644 xsd/tests/cxx/tree/order/makefile create mode 100644 xsd/tests/cxx/tree/order/output create mode 100644 xsd/tests/cxx/tree/order/test.xml create mode 100644 xsd/tests/cxx/tree/order/test.xsd (limited to 'xsd/tests') diff --git a/xsd/tests/cxx/makefile b/xsd/tests/cxx/makefile index 2a9f659..2e1364a 100644 --- a/xsd/tests/cxx/makefile +++ b/xsd/tests/cxx/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make diff --git a/xsd/tests/cxx/parser/built-in/driver.cxx b/xsd/tests/cxx/parser/built-in/driver.cxx index 11cae41..2791387 100644 --- a/xsd/tests/cxx/parser/built-in/driver.cxx +++ b/xsd/tests/cxx/parser/built-in/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/parser/built-in/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test built-in type parsing. @@ -24,7 +23,7 @@ struct any_type_pimpl: xml_schema::any_type_pimpl } virtual void - _start_any_element (ro_string const&, + _start_any_element (ro_string const&, ro_string const& n, ro_string const*) { @@ -278,14 +277,14 @@ struct type_pimpl: type_pskel } virtual void - base64_binary (std::auto_ptr v) + base64_binary (XSD_AUTO_PTR v) { std::string tmp (v->data (), v->size ()); cout << "'" << tmp << "'" << endl; } virtual void - hex_binary (std::auto_ptr v) + hex_binary (XSD_AUTO_PTR v) { std::string tmp (v->data (), v->size ()); cout << "'" << tmp << "'" << endl; diff --git a/xsd/tests/cxx/parser/built-in/makefile b/xsd/tests/cxx/parser/built-in/makefile index 3164219..64987d0 100644 --- a/xsd/tests/cxx/parser/built-in/makefile +++ b/xsd/tests/cxx/parser/built-in/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/built-in/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make @@ -25,7 +24,7 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=-pskel.hxx) $(xsd:.xsd=-pskel.ixx) $(xsd:.xsd=-pskel.cxx) @@ -34,7 +33,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -71,7 +70,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/parser/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/parser/enumeration/driver.cxx b/xsd/tests/cxx/parser/enumeration/driver.cxx index fdb0134..acd95a0 100644 --- a/xsd/tests/cxx/parser/enumeration/driver.cxx +++ b/xsd/tests/cxx/parser/enumeration/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/parser/enumeration/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test xsd:enumeration parsing. diff --git a/xsd/tests/cxx/parser/enumeration/gender.hxx b/xsd/tests/cxx/parser/enumeration/gender.hxx index 8e5dbfd..7540888 100644 --- a/xsd/tests/cxx/parser/enumeration/gender.hxx +++ b/xsd/tests/cxx/parser/enumeration/gender.hxx @@ -1,6 +1,5 @@ // file : tests/cxx/parser/enumeration/gender.hxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file #ifndef GENDER_HXX diff --git a/xsd/tests/cxx/parser/enumeration/makefile b/xsd/tests/cxx/parser/enumeration/makefile index 5776cbe..e991260 100644 --- a/xsd/tests/cxx/parser/enumeration/makefile +++ b/xsd/tests/cxx/parser/enumeration/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/enumeration/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make @@ -25,17 +24,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=-pskel.hxx) $(xsd:.xsd=-pskel.ixx) $(xsd:.xsd=-pskel.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --type-map $(src_base)/test.map +$(gen): xsd_options += --type-map $(src_base)/test.map $(gen): $(out_root)/xsd/xsd $(src_base)/test.map -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -72,7 +71,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/parser/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/parser/generated-impl/makefile b/xsd/tests/cxx/parser/generated-impl/makefile index 3733590..251fd41 100644 --- a/xsd/tests/cxx/parser/generated-impl/makefile +++ b/xsd/tests/cxx/parser/generated-impl/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/generated-impl/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make @@ -24,7 +23,7 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=-pskel.hxx) \ @@ -38,11 +37,11 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-print-impl --generate-test-driver \ +$(gen): xsd_options += --generate-print-impl --generate-test-driver \ --force-overwrite $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -82,7 +81,12 @@ $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) xsd_parser_impl_suffix := -pimpl + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/parser/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/parser/list/driver.cxx b/xsd/tests/cxx/parser/list/driver.cxx index d4ac4e2..0a4071a 100644 --- a/xsd/tests/cxx/parser/list/driver.cxx +++ b/xsd/tests/cxx/parser/list/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/parser/list/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test xsd:list parsing. diff --git a/xsd/tests/cxx/parser/list/makefile b/xsd/tests/cxx/parser/list/makefile index deacdb9..9fc63fd 100644 --- a/xsd/tests/cxx/parser/list/makefile +++ b/xsd/tests/cxx/parser/list/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/list/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make @@ -25,7 +24,7 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=-pskel.hxx) $(xsd:.xsd=-pskel.ixx) $(xsd:.xsd=-pskel.cxx) @@ -34,7 +33,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -71,7 +70,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/parser/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/parser/makefile b/xsd/tests/cxx/parser/makefile index 935345b..8031478 100644 --- a/xsd/tests/cxx/parser/makefile +++ b/xsd/tests/cxx/parser/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make diff --git a/xsd/tests/cxx/parser/name-clash/inheritance/driver.cxx b/xsd/tests/cxx/parser/name-clash/inheritance/driver.cxx index 81adb7f..af70f88 100644 --- a/xsd/tests/cxx/parser/name-clash/inheritance/driver.cxx +++ b/xsd/tests/cxx/parser/name-clash/inheritance/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/parser/name-clash/inheritance/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test for name clashes across inheritance hierarchy. diff --git a/xsd/tests/cxx/parser/name-clash/inheritance/makefile b/xsd/tests/cxx/parser/name-clash/inheritance/makefile index 359b7e4..273c03c 100644 --- a/xsd/tests/cxx/parser/name-clash/inheritance/makefile +++ b/xsd/tests/cxx/parser/name-clash/inheritance/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/name-clash/inheritance/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make @@ -25,17 +24,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=-pskel.hxx) $(xsd:.xsd=-pskel.ixx) $(xsd:.xsd=-pskel.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-validation +$(gen): xsd_options += --generate-validation $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -72,7 +71,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/parser/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/parser/polymorphism/makefile b/xsd/tests/cxx/parser/polymorphism/makefile index 42ac5c3..bb1ebeb 100644 --- a/xsd/tests/cxx/parser/polymorphism/makefile +++ b/xsd/tests/cxx/parser/polymorphism/makefile @@ -1,11 +1,10 @@ # file : tests/cxx/parser/polymorphism/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make -tests := same-type +tests := same-type recursive default := $(out_base)/ test := $(out_base)/.test diff --git a/xsd/tests/cxx/parser/polymorphism/recursive/driver.cxx b/xsd/tests/cxx/parser/polymorphism/recursive/driver.cxx new file mode 100644 index 0000000..2ad96cd --- /dev/null +++ b/xsd/tests/cxx/parser/polymorphism/recursive/driver.cxx @@ -0,0 +1,69 @@ +// file : tests/cxx/parser/polymorphism/recursive/driver.cxx +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +// Test polymorphic recursive parsing. +// + +#include +#include + +#include "test-pskel.hxx" +#include "test-pimpl.hxx" + +using namespace std; +using namespace test; + +int +main (int argc, char* argv[]) +{ + if (argc != 2) + { + cerr << "usage: " << argv[0] << " test.xml" << endl; + return 1; + } + + try + { + xml_schema::int_pimpl int_p; + + root_pimpl root_p; + expression_pimpl expression_p; + recursive_pimpl recursive_p; + value_a_pimpl value_a_p; + value_b_pimpl value_b_p; + + xml_schema::parser_map_impl expression_map; + + // Connect the parsers together. + // + root_p.parsers (expression_p); + expression_map.insert(value_a_p); + expression_map.insert(value_b_p); + expression_map.insert(recursive_p); + + root_p.expression_parser(expression_map); + + recursive_p.parsers(expression_p); + recursive_p.expression_parser(expression_map); + + value_a_p.parsers(int_p); + value_b_p.parsers(int_p); + + xml_schema::document doc_p (root_p, "test", "root", true); + + root_p.pre (); + doc_p.parse (argv[1]); + root_p.post_root (); + } + 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/polymorphism/recursive/makefile b/xsd/tests/cxx/parser/polymorphism/recursive/makefile new file mode 100644 index 0000000..50e4f3d --- /dev/null +++ b/xsd/tests/cxx/parser/polymorphism/recursive/makefile @@ -0,0 +1,84 @@ +# file : tests/cxx/parser/polymorphism/recursive/makefile +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make + +xsd := test.xsd +cxx := driver.cxx test-pimpl.cxx + +obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=-pskel.o)) +dep := $(obj:.o=.o.d) + +driver := $(out_base)/driver +test := $(out_base)/.test +clean := $(out_base)/.clean + +# Import. +# +$(call import,\ + $(scf_root)/import/libxerces-c/stub.make,\ + l: xerces_c.l,cpp-options: xerces_c.l.cpp-options) + +# Build. +# +$(driver): $(obj) $(xerces_c.l) + +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd +$(obj) $(dep): $(xerces_c.l.cpp-options) + +genf := $(xsd:.xsd=-pskel.hxx) $(xsd:.xsd=-pskel.ixx) $(xsd:.xsd=-pskel.cxx) +gen := $(addprefix $(out_base)/,$(genf)) + +$(gen): xsd := $(out_root)/xsd/xsd +$(gen): xsd_options += --generate-polymorphic +$(gen): $(out_root)/xsd/xsd + +$(call include-dep,$(dep),$(obj),$(gen)) + +# Convenience alias for default target. +# +$(out_base)/: $(driver) + + +# Test. +# +$(test): driver := $(driver) +$(test): $(driver) $(src_base)/test.xml $(src_base)/output + $(call message,test $$1,$$1 $(src_base)/test.xml | diff -u $(src_base)/output -,$(driver)) + +# Clean. +# +$(clean): $(driver).o.clean \ + $(addsuffix .cxx.clean,$(obj)) \ + $(addsuffix .cxx.clean,$(dep)) \ + $(addprefix $(out_base)/,$(xsd:.xsd=-pskel.cxx.xsd.clean)) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(gen): | $(out_base)/.gitignore +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver $(genf) +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# 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) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) +$(call include,$(scf_root)/xsd/parser/xsd-cxx.make) +endif + + +# Dependencies. +# +$(call import,$(src_root)/xsd/makefile) diff --git a/xsd/tests/cxx/parser/polymorphism/recursive/output b/xsd/tests/cxx/parser/polymorphism/recursive/output new file mode 100644 index 0000000..28a835f --- /dev/null +++ b/xsd/tests/cxx/parser/polymorphism/recursive/output @@ -0,0 +1,22 @@ +root start +recursive start +value_a begin +value->constant +value: post_expression override +value_a: post_value override +value_a end +recursive->expression event +recursive start +value_b begin +value->constant +value: post_expression override +value_b: post_value override +value_b end +recursive->expression event +recursive: post_expression override +recursive end +recursive->expression event +recursive: post_expression override +recursive end +root->expression +root end diff --git a/xsd/tests/cxx/parser/polymorphism/recursive/test-pimpl.cxx b/xsd/tests/cxx/parser/polymorphism/recursive/test-pimpl.cxx new file mode 100644 index 0000000..fe32626 --- /dev/null +++ b/xsd/tests/cxx/parser/polymorphism/recursive/test-pimpl.cxx @@ -0,0 +1,148 @@ +// file : tests/cxx/parser/polymorphism/recursive/test-pimpl.cxx +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include + +#include "test-pimpl.hxx" + +using namespace std; + +namespace test +{ + // root_pimpl + // + + void root_pimpl:: + pre () + { + cout << "root start" << endl; + } + + void root_pimpl:: + expression () + { + cout << "root->expression" << endl; + } + + void root_pimpl:: + post_root () + { + cout << "root end" << endl; + } + + // expression_pimpl + // + + void expression_pimpl:: + pre () + { + cout << "expression begin" << endl; + } + + void expression_pimpl:: + post_expression () + { + cout << "expression end" << endl; + } + + // recursive_pimpl + // + + void recursive_pimpl:: + pre () + { + cout << "recursive start" << endl; + } + + void recursive_pimpl:: + expression () + { + cout << "recursive->expression event" << endl; + } + + void recursive_pimpl:: + post_expression () + { + cout << "recursive: post_expression override" << endl; + post_recursive (); + } + + void recursive_pimpl:: + post_recursive () + { + cout << "recursive end" << endl; + } + + // value_pimpl + // + + void value_pimpl:: + pre () + { + cout << "value begin" << endl; + } + + void value_pimpl:: + constant (int) + { + cout << "value->constant" << endl; + } + + void value_pimpl:: + post_expression () + { + cout << "value: post_expression override" << endl; + post_value (); + } + + void value_pimpl:: + post_value () + { + cout << "value end" << endl; + } + + // value_a_pimpl + // + + void value_a_pimpl:: + pre () + { + cout << "value_a begin" << endl; + } + + void value_a_pimpl:: + post_value () + { + cout << "value_a: post_value override" << endl; + post_value_a (); + } + + void value_a_pimpl:: + post_value_a () + { + cout << "value_a end" << endl; + } + + // value_b_pimpl + // + + void value_b_pimpl:: + pre () + { + cout << "value_b begin" << endl; + } + + void value_b_pimpl:: + post_value () + { + cout << "value_b: post_value override" << endl; + post_value_b (); + } + + void value_b_pimpl:: + post_value_b () + { + cout << "value_b end" << endl; + } +} diff --git a/xsd/tests/cxx/parser/polymorphism/recursive/test-pimpl.hxx b/xsd/tests/cxx/parser/polymorphism/recursive/test-pimpl.hxx new file mode 100644 index 0000000..f345720 --- /dev/null +++ b/xsd/tests/cxx/parser/polymorphism/recursive/test-pimpl.hxx @@ -0,0 +1,95 @@ +// file : tests/cxx/parser/polymorphism/recursive/test-pimpl.hxx +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#ifndef TEST_PIMPL_HXX +#define TEST_PIMPL_HXX + +#include "test-pskel.hxx" + +namespace test +{ + class root_pimpl: public virtual root_pskel + { + public: + virtual void + pre (); + + virtual void + expression (); + + virtual void + post_root (); + }; + + class expression_pimpl: public virtual expression_pskel + { + public: + virtual void + pre (); + + virtual void + post_expression (); + }; + + class recursive_pimpl: public virtual recursive_pskel, + public expression_pimpl + { + public: + virtual void + pre (); + + virtual void + expression (); + + virtual void + post_expression (); + + virtual void + post_recursive (); + }; + + class value_pimpl: public virtual value_pskel, public expression_pimpl + { + public: + virtual void + pre (); + + virtual void + constant (int); + + virtual void + post_expression (); + + virtual void + post_value (); + }; + + class value_a_pimpl: public virtual value_a_pskel, public value_pimpl + { + public: + virtual void + pre (); + + virtual void + post_value (); + + virtual void + post_value_a (); + }; + + class value_b_pimpl: public virtual value_b_pskel, public value_pimpl + { + public: + virtual void + pre (); + + virtual void + post_value (); + + virtual void + post_value_b (); + }; +} + +#endif // TEST_PIMPL_HXX diff --git a/xsd/tests/cxx/parser/polymorphism/recursive/test.xml b/xsd/tests/cxx/parser/polymorphism/recursive/test.xml new file mode 100644 index 0000000..42035ba --- /dev/null +++ b/xsd/tests/cxx/parser/polymorphism/recursive/test.xml @@ -0,0 +1,15 @@ + + + + + 1 + + + + 2 + + + + diff --git a/xsd/tests/cxx/parser/polymorphism/recursive/test.xsd b/xsd/tests/cxx/parser/polymorphism/recursive/test.xsd new file mode 100644 index 0000000..affcc8a --- /dev/null +++ b/xsd/tests/cxx/parser/polymorphism/recursive/test.xsd @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xsd/tests/cxx/parser/polymorphism/same-type/driver.cxx b/xsd/tests/cxx/parser/polymorphism/same-type/driver.cxx index ea50776..05abc3c 100644 --- a/xsd/tests/cxx/parser/polymorphism/same-type/driver.cxx +++ b/xsd/tests/cxx/parser/polymorphism/same-type/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/parser/polymorphism/same-type/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test substitution group and xsi:type that don't change the type. @@ -45,7 +44,7 @@ main (int argc, char* argv[]) base_p.parsers (string_p); type_p.parsers (base_p); - xml_schema::document doc_p (type_p, "test", "root"); + xml_schema::document doc_p (type_p, "test", "root", true); type_p.pre (); doc_p.parse (argv[1]); diff --git a/xsd/tests/cxx/parser/polymorphism/same-type/makefile b/xsd/tests/cxx/parser/polymorphism/same-type/makefile index c357597..256b34d 100644 --- a/xsd/tests/cxx/parser/polymorphism/same-type/makefile +++ b/xsd/tests/cxx/parser/polymorphism/same-type/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/polymorphism/same-type/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make @@ -25,17 +24,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=-pskel.hxx) $(xsd:.xsd=-pskel.ixx) $(xsd:.xsd=-pskel.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-polymorphic +$(gen): xsd_options += --generate-polymorphic $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -72,7 +71,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/parser/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/parser/recursive/driver.cxx b/xsd/tests/cxx/parser/recursive/driver.cxx index 3f54f8f..41f21e7 100644 --- a/xsd/tests/cxx/parser/recursive/driver.cxx +++ b/xsd/tests/cxx/parser/recursive/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/parser/recursive/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test recursive parser invocation. diff --git a/xsd/tests/cxx/parser/recursive/makefile b/xsd/tests/cxx/parser/recursive/makefile index bd78bef..8ccf0bc 100644 --- a/xsd/tests/cxx/parser/recursive/makefile +++ b/xsd/tests/cxx/parser/recursive/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/recursive/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make @@ -25,17 +24,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=-pskel.hxx) $(xsd:.xsd=-pskel.ixx) $(xsd:.xsd=-pskel.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-validation +$(gen): xsd_options += --generate-validation $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -72,7 +71,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/parser/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/parser/test-template/driver.cxx b/xsd/tests/cxx/parser/test-template/driver.cxx index b3379ff..01ef390 100644 --- a/xsd/tests/cxx/parser/test-template/driver.cxx +++ b/xsd/tests/cxx/parser/test-template/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/parser/test-template/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Insert test description here. diff --git a/xsd/tests/cxx/parser/test-template/makefile b/xsd/tests/cxx/parser/test-template/makefile index 5f5f9bc..dd1e19f 100644 --- a/xsd/tests/cxx/parser/test-template/makefile +++ b/xsd/tests/cxx/parser/test-template/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/test-template/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make @@ -25,7 +24,7 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=-pskel.hxx) $(xsd:.xsd=-pskel.ixx) $(xsd:.xsd=-pskel.cxx) @@ -34,7 +33,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -71,7 +70,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/parser/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/parser/union/driver.cxx b/xsd/tests/cxx/parser/union/driver.cxx index 4a67f2f..5a576ba 100644 --- a/xsd/tests/cxx/parser/union/driver.cxx +++ b/xsd/tests/cxx/parser/union/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/parser/union/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test xsd:union parsing. diff --git a/xsd/tests/cxx/parser/union/makefile b/xsd/tests/cxx/parser/union/makefile index fa2b844..7de92ad 100644 --- a/xsd/tests/cxx/parser/union/makefile +++ b/xsd/tests/cxx/parser/union/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/union/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make @@ -25,7 +24,7 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=-pskel.hxx) $(xsd:.xsd=-pskel.ixx) $(xsd:.xsd=-pskel.cxx) @@ -34,7 +33,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -71,7 +70,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/parser/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/parser/validation/all/driver.cxx b/xsd/tests/cxx/parser/validation/all/driver.cxx index d4a3839..71a21a0 100644 --- a/xsd/tests/cxx/parser/validation/all/driver.cxx +++ b/xsd/tests/cxx/parser/validation/all/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/parser/validation/all/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test the all compositor validation. diff --git a/xsd/tests/cxx/parser/validation/all/makefile b/xsd/tests/cxx/parser/validation/all/makefile index 6336fdc..acc0a79 100644 --- a/xsd/tests/cxx/parser/validation/all/makefile +++ b/xsd/tests/cxx/parser/validation/all/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/validation/all/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make @@ -27,17 +26,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=-pskel.hxx) $(xsd:.xsd=-pskel.ixx) $(xsd:.xsd=-pskel.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-validation +$(gen): xsd_options += --generate-validation $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. @@ -81,7 +80,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/parser/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/parser/validation/any/driver.cxx b/xsd/tests/cxx/parser/validation/any/driver.cxx index e858285..f7773b4 100644 --- a/xsd/tests/cxx/parser/validation/any/driver.cxx +++ b/xsd/tests/cxx/parser/validation/any/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/parser/validation/any/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test the any particle validation. diff --git a/xsd/tests/cxx/parser/validation/any/makefile b/xsd/tests/cxx/parser/validation/any/makefile index 084a131..ae6735d 100644 --- a/xsd/tests/cxx/parser/validation/any/makefile +++ b/xsd/tests/cxx/parser/validation/any/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/validation/any/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make @@ -27,17 +26,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=-pskel.hxx) $(xsd:.xsd=-pskel.ixx) $(xsd:.xsd=-pskel.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-validation +$(gen): xsd_options += --generate-validation $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. @@ -81,7 +80,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/parser/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/parser/validation/attribute/driver.cxx b/xsd/tests/cxx/parser/validation/attribute/driver.cxx index e726ad8..7e4de25 100644 --- a/xsd/tests/cxx/parser/validation/attribute/driver.cxx +++ b/xsd/tests/cxx/parser/validation/attribute/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/parser/validation/attribute/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test attribute and attribute wildcard (anyAttribute) validation. diff --git a/xsd/tests/cxx/parser/validation/attribute/makefile b/xsd/tests/cxx/parser/validation/attribute/makefile index 0f7df21..94e5369 100644 --- a/xsd/tests/cxx/parser/validation/attribute/makefile +++ b/xsd/tests/cxx/parser/validation/attribute/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/validation/attribute/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make @@ -27,17 +26,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=-pskel.hxx) $(xsd:.xsd=-pskel.ixx) $(xsd:.xsd=-pskel.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-validation +$(gen): xsd_options += --generate-validation $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. @@ -81,7 +80,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/parser/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/parser/validation/built-in/any-type/driver.cxx b/xsd/tests/cxx/parser/validation/built-in/any-type/driver.cxx index 46ccc96..4b03218 100644 --- a/xsd/tests/cxx/parser/validation/built-in/any-type/driver.cxx +++ b/xsd/tests/cxx/parser/validation/built-in/any-type/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/parser/validation/built-in/any-type/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test the anyType and anySimpleType validation. diff --git a/xsd/tests/cxx/parser/validation/built-in/any-type/makefile b/xsd/tests/cxx/parser/validation/built-in/any-type/makefile index bf42aac..7ae3a96 100644 --- a/xsd/tests/cxx/parser/validation/built-in/any-type/makefile +++ b/xsd/tests/cxx/parser/validation/built-in/any-type/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/validation/built-in/any-type/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make @@ -27,17 +26,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=-pskel.hxx) $(xsd:.xsd=-pskel.ixx) $(xsd:.xsd=-pskel.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-validation +$(gen): xsd_options += --generate-validation $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. @@ -81,7 +80,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/parser/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/parser/validation/built-in/binary/driver.cxx b/xsd/tests/cxx/parser/validation/built-in/binary/driver.cxx index e75d55f..96f6d4e 100644 --- a/xsd/tests/cxx/parser/validation/built-in/binary/driver.cxx +++ b/xsd/tests/cxx/parser/validation/built-in/binary/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/parser/validation/built-in/binary/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test the built-in base64Binary and hexBinary types validation. diff --git a/xsd/tests/cxx/parser/validation/built-in/binary/makefile b/xsd/tests/cxx/parser/validation/built-in/binary/makefile index b729cd0..fe48886 100644 --- a/xsd/tests/cxx/parser/validation/built-in/binary/makefile +++ b/xsd/tests/cxx/parser/validation/built-in/binary/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/validation/built-in/binary/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make @@ -25,10 +24,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) -$(call include-dep,$(dep)) +# Define XSD_CXX11 since we include libxsd headers directly. +# +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifeq ($(cxx_standard),c++11) +$(obj) $(dep): cpp_options += -DXSD_CXX11 +endif + +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # diff --git a/xsd/tests/cxx/parser/validation/built-in/boolean/driver.cxx b/xsd/tests/cxx/parser/validation/built-in/boolean/driver.cxx index 85586a6..6ebe23c 100644 --- a/xsd/tests/cxx/parser/validation/built-in/boolean/driver.cxx +++ b/xsd/tests/cxx/parser/validation/built-in/boolean/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/parser/validation/built-in/boolean/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test the built-in boolean type validation. diff --git a/xsd/tests/cxx/parser/validation/built-in/boolean/makefile b/xsd/tests/cxx/parser/validation/built-in/boolean/makefile index 39ca5e9..f5812a5 100644 --- a/xsd/tests/cxx/parser/validation/built-in/boolean/makefile +++ b/xsd/tests/cxx/parser/validation/built-in/boolean/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/validation/built-in/boolean/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make @@ -25,10 +24,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) -$(call include-dep,$(dep)) +# Define XSD_CXX11 since we include libxsd headers directly. +# +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifeq ($(cxx_standard),c++11) +$(obj) $(dep): cpp_options += -DXSD_CXX11 +endif + +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # diff --git a/xsd/tests/cxx/parser/validation/built-in/byte/driver.cxx b/xsd/tests/cxx/parser/validation/built-in/byte/driver.cxx index 466f004..48d91df 100644 --- a/xsd/tests/cxx/parser/validation/built-in/byte/driver.cxx +++ b/xsd/tests/cxx/parser/validation/built-in/byte/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/parser/validation/built-in/byte/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test the built-in byte and unsigned byte types validation. diff --git a/xsd/tests/cxx/parser/validation/built-in/byte/makefile b/xsd/tests/cxx/parser/validation/built-in/byte/makefile index 32f4b91..cdaabfc 100644 --- a/xsd/tests/cxx/parser/validation/built-in/byte/makefile +++ b/xsd/tests/cxx/parser/validation/built-in/byte/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/validation/built-in/byte/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make @@ -25,10 +24,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) -$(call include-dep,$(dep)) +# Define XSD_CXX11 since we include libxsd headers directly. +# +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifeq ($(cxx_standard),c++11) +$(obj) $(dep): cpp_options += -DXSD_CXX11 +endif + +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # diff --git a/xsd/tests/cxx/parser/validation/built-in/date-time/driver.cxx b/xsd/tests/cxx/parser/validation/built-in/date-time/driver.cxx index 6297912..015205a 100644 --- a/xsd/tests/cxx/parser/validation/built-in/date-time/driver.cxx +++ b/xsd/tests/cxx/parser/validation/built-in/date-time/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/parser/validation/built-in/date-time/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test the built-in date and time types validation. diff --git a/xsd/tests/cxx/parser/validation/built-in/date-time/makefile b/xsd/tests/cxx/parser/validation/built-in/date-time/makefile index d5e2edc..ee16e1f 100644 --- a/xsd/tests/cxx/parser/validation/built-in/date-time/makefile +++ b/xsd/tests/cxx/parser/validation/built-in/date-time/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/validation/built-in/date-time/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make @@ -25,10 +24,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) -$(call include-dep,$(dep)) +# Define XSD_CXX11 since we include libxsd headers directly. +# +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifeq ($(cxx_standard),c++11) +$(obj) $(dep): cpp_options += -DXSD_CXX11 +endif + +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # diff --git a/xsd/tests/cxx/parser/validation/built-in/float/driver.cxx b/xsd/tests/cxx/parser/validation/built-in/float/driver.cxx index 1f6f0bd..f984498 100644 --- a/xsd/tests/cxx/parser/validation/built-in/float/driver.cxx +++ b/xsd/tests/cxx/parser/validation/built-in/float/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/parser/validation/built-in/float/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test the built-in float, double, and decimal types validation. diff --git a/xsd/tests/cxx/parser/validation/built-in/float/makefile b/xsd/tests/cxx/parser/validation/built-in/float/makefile index 8755f3a..6755693 100644 --- a/xsd/tests/cxx/parser/validation/built-in/float/makefile +++ b/xsd/tests/cxx/parser/validation/built-in/float/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/validation/built-in/float/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make @@ -25,10 +24,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) -$(call include-dep,$(dep)) +# Define XSD_CXX11 since we include libxsd headers directly. +# +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifeq ($(cxx_standard),c++11) +$(obj) $(dep): cpp_options += -DXSD_CXX11 +endif + +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # diff --git a/xsd/tests/cxx/parser/validation/built-in/int/driver.cxx b/xsd/tests/cxx/parser/validation/built-in/int/driver.cxx index 00c5947..8d4392b 100644 --- a/xsd/tests/cxx/parser/validation/built-in/int/driver.cxx +++ b/xsd/tests/cxx/parser/validation/built-in/int/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/parser/validation/built-in/int/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test the built-in int and unsigned int types validation. diff --git a/xsd/tests/cxx/parser/validation/built-in/int/makefile b/xsd/tests/cxx/parser/validation/built-in/int/makefile index 4cebe64..46f0baa 100644 --- a/xsd/tests/cxx/parser/validation/built-in/int/makefile +++ b/xsd/tests/cxx/parser/validation/built-in/int/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/validation/built-in/int/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make @@ -25,10 +24,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) -$(call include-dep,$(dep)) +# Define XSD_CXX11 since we include libxsd headers directly. +# +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifeq ($(cxx_standard),c++11) +$(obj) $(dep): cpp_options += -DXSD_CXX11 +endif + +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # diff --git a/xsd/tests/cxx/parser/validation/built-in/integer/driver.cxx b/xsd/tests/cxx/parser/validation/built-in/integer/driver.cxx index fa8e4e0..2828249 100644 --- a/xsd/tests/cxx/parser/validation/built-in/integer/driver.cxx +++ b/xsd/tests/cxx/parser/validation/built-in/integer/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/parser/validation/built-in/int/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test the built-in integer & friends types validation. diff --git a/xsd/tests/cxx/parser/validation/built-in/integer/makefile b/xsd/tests/cxx/parser/validation/built-in/integer/makefile index 6b9d816..ca6482f 100644 --- a/xsd/tests/cxx/parser/validation/built-in/integer/makefile +++ b/xsd/tests/cxx/parser/validation/built-in/integer/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/validation/built-in/integer/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make @@ -25,10 +24,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) -$(call include-dep,$(dep)) +# Define XSD_CXX11 since we include libxsd headers directly. +# +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifeq ($(cxx_standard),c++11) +$(obj) $(dep): cpp_options += -DXSD_CXX11 +endif + +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # diff --git a/xsd/tests/cxx/parser/validation/built-in/long/driver.cxx b/xsd/tests/cxx/parser/validation/built-in/long/driver.cxx index c7a66c4..2033125 100644 --- a/xsd/tests/cxx/parser/validation/built-in/long/driver.cxx +++ b/xsd/tests/cxx/parser/validation/built-in/long/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/parser/validation/built-in/long/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test the built-in long and unsigned long types validation. diff --git a/xsd/tests/cxx/parser/validation/built-in/long/makefile b/xsd/tests/cxx/parser/validation/built-in/long/makefile index 2ab6368..b3ad382 100644 --- a/xsd/tests/cxx/parser/validation/built-in/long/makefile +++ b/xsd/tests/cxx/parser/validation/built-in/long/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/validation/built-in/long/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make @@ -25,10 +24,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) -$(call include-dep,$(dep)) +# Define XSD_CXX11 since we include libxsd headers directly. +# +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifeq ($(cxx_standard),c++11) +$(obj) $(dep): cpp_options += -DXSD_CXX11 +endif + +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # diff --git a/xsd/tests/cxx/parser/validation/built-in/makefile b/xsd/tests/cxx/parser/validation/built-in/makefile index 34bea8f..e300092 100644 --- a/xsd/tests/cxx/parser/validation/built-in/makefile +++ b/xsd/tests/cxx/parser/validation/built-in/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/validation/built-in/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make diff --git a/xsd/tests/cxx/parser/validation/built-in/qname/driver.cxx b/xsd/tests/cxx/parser/validation/built-in/qname/driver.cxx index 3a4bc90..3c77eea 100644 --- a/xsd/tests/cxx/parser/validation/built-in/qname/driver.cxx +++ b/xsd/tests/cxx/parser/validation/built-in/qname/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/parser/validation/built-in/qname/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test the built-in QName type validation. diff --git a/xsd/tests/cxx/parser/validation/built-in/qname/makefile b/xsd/tests/cxx/parser/validation/built-in/qname/makefile index 5f53fea..9e06bad 100644 --- a/xsd/tests/cxx/parser/validation/built-in/qname/makefile +++ b/xsd/tests/cxx/parser/validation/built-in/qname/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/validation/built-in/qname/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make @@ -25,10 +24,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) -$(call include-dep,$(dep)) +# Define XSD_CXX11 since we include libxsd headers directly. +# +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifeq ($(cxx_standard),c++11) +$(obj) $(dep): cpp_options += -DXSD_CXX11 +endif + +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # diff --git a/xsd/tests/cxx/parser/validation/built-in/short/driver.cxx b/xsd/tests/cxx/parser/validation/built-in/short/driver.cxx index 2bb95d2..5ee950c 100644 --- a/xsd/tests/cxx/parser/validation/built-in/short/driver.cxx +++ b/xsd/tests/cxx/parser/validation/built-in/short/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/parser/validation/built-in/short/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test the built-in short and unsigned short types validation. diff --git a/xsd/tests/cxx/parser/validation/built-in/short/makefile b/xsd/tests/cxx/parser/validation/built-in/short/makefile index eee8382..50c2b80 100644 --- a/xsd/tests/cxx/parser/validation/built-in/short/makefile +++ b/xsd/tests/cxx/parser/validation/built-in/short/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/validation/built-in/short/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make @@ -25,10 +24,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) -$(call include-dep,$(dep)) +# Define XSD_CXX11 since we include libxsd headers directly. +# +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifeq ($(cxx_standard),c++11) +$(obj) $(dep): cpp_options += -DXSD_CXX11 +endif + +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # diff --git a/xsd/tests/cxx/parser/validation/built-in/string/driver.cxx b/xsd/tests/cxx/parser/validation/built-in/string/driver.cxx index 2419d59..5948542 100644 --- a/xsd/tests/cxx/parser/validation/built-in/string/driver.cxx +++ b/xsd/tests/cxx/parser/validation/built-in/string/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/parser/validation/built-in/string/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test the built-in string & friends types validation. diff --git a/xsd/tests/cxx/parser/validation/built-in/string/makefile b/xsd/tests/cxx/parser/validation/built-in/string/makefile index 5be3c4c..41c0dcd 100644 --- a/xsd/tests/cxx/parser/validation/built-in/string/makefile +++ b/xsd/tests/cxx/parser/validation/built-in/string/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/validation/built-in/string/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make @@ -25,10 +24,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) -$(call include-dep,$(dep)) +# Define XSD_CXX11 since we include libxsd headers directly. +# +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifeq ($(cxx_standard),c++11) +$(obj) $(dep): cpp_options += -DXSD_CXX11 +endif + +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # diff --git a/xsd/tests/cxx/parser/validation/built-in/uri/driver.cxx b/xsd/tests/cxx/parser/validation/built-in/uri/driver.cxx index f6de3c2..daff0c7 100644 --- a/xsd/tests/cxx/parser/validation/built-in/uri/driver.cxx +++ b/xsd/tests/cxx/parser/validation/built-in/uri/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/parser/validation/built-in/uri/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test the built-in anyURI type validation. diff --git a/xsd/tests/cxx/parser/validation/built-in/uri/makefile b/xsd/tests/cxx/parser/validation/built-in/uri/makefile index ad53e89..cfb8101 100644 --- a/xsd/tests/cxx/parser/validation/built-in/uri/makefile +++ b/xsd/tests/cxx/parser/validation/built-in/uri/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/validation/built-in/uri/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make @@ -25,10 +24,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) -$(call include-dep,$(dep)) +# Define XSD_CXX11 since we include libxsd headers directly. +# +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifeq ($(cxx_standard),c++11) +$(obj) $(dep): cpp_options += -DXSD_CXX11 +endif + +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # diff --git a/xsd/tests/cxx/parser/validation/choice/driver.cxx b/xsd/tests/cxx/parser/validation/choice/driver.cxx index 87cd0a9..fd1e651 100644 --- a/xsd/tests/cxx/parser/validation/choice/driver.cxx +++ b/xsd/tests/cxx/parser/validation/choice/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/parser/validation/choice/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test the choice compositor validation. diff --git a/xsd/tests/cxx/parser/validation/choice/makefile b/xsd/tests/cxx/parser/validation/choice/makefile index f113bd5..ec86590 100644 --- a/xsd/tests/cxx/parser/validation/choice/makefile +++ b/xsd/tests/cxx/parser/validation/choice/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/validation/choice/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make @@ -27,17 +26,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=-pskel.hxx) $(xsd:.xsd=-pskel.ixx) $(xsd:.xsd=-pskel.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-validation +$(gen): xsd_options += --generate-validation $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. @@ -81,7 +80,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/parser/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/parser/validation/makefile b/xsd/tests/cxx/parser/validation/makefile index 5b7b884..c5d43ed 100644 --- a/xsd/tests/cxx/parser/validation/makefile +++ b/xsd/tests/cxx/parser/validation/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/validation/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/xsd/tests/cxx/parser/validation/restriction/driver.cxx b/xsd/tests/cxx/parser/validation/restriction/driver.cxx index 40a2bc9..ea87af6 100644 --- a/xsd/tests/cxx/parser/validation/restriction/driver.cxx +++ b/xsd/tests/cxx/parser/validation/restriction/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/parser/validation/restriction/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test the restriction compositor validation. diff --git a/xsd/tests/cxx/parser/validation/restriction/makefile b/xsd/tests/cxx/parser/validation/restriction/makefile index 66e4d9a..5e1a9fd 100644 --- a/xsd/tests/cxx/parser/validation/restriction/makefile +++ b/xsd/tests/cxx/parser/validation/restriction/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/validation/restriction/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make @@ -27,17 +26,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=-pskel.hxx) $(xsd:.xsd=-pskel.ixx) $(xsd:.xsd=-pskel.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-validation +$(gen): xsd_options += --generate-validation $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. @@ -81,7 +80,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/parser/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/parser/validation/sequence/driver.cxx b/xsd/tests/cxx/parser/validation/sequence/driver.cxx index 2e994b2..eddf744 100644 --- a/xsd/tests/cxx/parser/validation/sequence/driver.cxx +++ b/xsd/tests/cxx/parser/validation/sequence/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/parser/validation/sequence/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test the sequence compositor validation. diff --git a/xsd/tests/cxx/parser/validation/sequence/makefile b/xsd/tests/cxx/parser/validation/sequence/makefile index 53f6c61..540f2ea 100644 --- a/xsd/tests/cxx/parser/validation/sequence/makefile +++ b/xsd/tests/cxx/parser/validation/sequence/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/parser/validation/sequence/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make @@ -27,17 +26,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=-pskel.hxx) $(xsd:.xsd=-pskel.ixx) $(xsd:.xsd=-pskel.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-validation +$(gen): xsd_options += --generate-validation $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. @@ -81,7 +80,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/parser/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/any-type/driver.cxx b/xsd/tests/cxx/tree/any-type/driver.cxx new file mode 100644 index 0000000..1ac5274 --- /dev/null +++ b/xsd/tests/cxx/tree/any-type/driver.cxx @@ -0,0 +1,145 @@ +// file : tests/cxx/tree/any-type/driver.cxx +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +// Test anyType and anySimpleType content extraction. +// + +#include // std::auto_ptr/unique_ptr +#include // std::move +#include +#include + +#include +#include + +#include "test.hxx" // Get XSD_CXX11 defined. + +#include + +using namespace std; +using namespace test; +using namespace xercesc; + +namespace xml = xsd::cxx::xml; + +int +main (int argc, char* argv[]) +{ + if (argc != 2) + { + cerr << "usage: " << argv[0] << " test.xml" << endl; + return 1; + } + + XMLPlatformUtils::Initialize (); + + try + { + // Test parsing + // + XSD_AUTO_PTR r (root (argv[1])); + + // Test API. + // + { + assert (type::a_default_value ().text_content () == "default value"); + } + + { + xml_schema::simple_type x ("fox"); + assert (x.text_content () == "fox"); + x.text_content ("foo"); + assert (x.text_content () == "foo"); + x.text_content ().clear (); + assert (x.text_content () == ""); + x.text_content () = "baz"; + r->s ().push_back (x); + } + + { + xml_schema::type x; + + DOMDocument& doc (x.dom_content_document ()); + + // Copy. + // + DOMElement* e (doc.createElement (xml::string ("dummy").c_str ())); + e->setAttribute (xml::string ("x").c_str (), + xml::string ("foo").c_str ()); + e->setTextContent (xml::string ("data").c_str ()); + x.dom_content ().set (*e); + e->release (); + + r->t ().push_back (x); + } + + { + XSD_AUTO_PTR x (new xml_schema::type); + + DOMDocument& doc (x->dom_content_document ()); + + // Assume ownership. + // + DOMElement* e (doc.createElement (xml::string ("dummy").c_str ())); + e->setAttribute (xml::string ("x").c_str (), + xml::string ("foo").c_str ()); + e->setTextContent (xml::string ("data").c_str ()); + x->dom_content ().set (e); + +#ifdef XSD_CXX11 + r->t ().push_back (std::move (x)); +#else + r->t ().push_back (x); +#endif + } + + // Test printing. + // + cout << *r << endl + << endl; + + // Test serialization. + // + xml_schema::namespace_infomap map; + + map["t"].name = "test"; + map["t"].schema = "test.xsd"; + map["o"].name = "other"; + + stringstream iostr; + root (iostr, *r, map); + + cout << iostr.str () << endl + << endl; + + { + XSD_AUTO_PTR r1 (root (iostr, argv[1])); + + // Xerces-C++ mis-indentation of mixed content messes this up. + // assert (*r == *r); + + stringstream iostr; + root (iostr, *r1, map); + + cout << iostr.str () << endl + << endl; + } + + // Test comparison. + // + assert (*r == *r); + + // Test copy c-tor. + // + type copy (*r); + assert (copy == *r); + } + catch (xml_schema::exception const& e) + { + cerr << e << endl; + return 1; + } + + XMLPlatformUtils::Terminate (); +} diff --git a/xsd/tests/cxx/tree/any-type/makefile b/xsd/tests/cxx/tree/any-type/makefile new file mode 100644 index 0000000..1d0590f --- /dev/null +++ b/xsd/tests/cxx/tree/any-type/makefile @@ -0,0 +1,87 @@ +# file : tests/cxx/tree/any-type/makefile +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make + +xsd := test.xsd +cxx := driver.cxx + +obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=.o)) +dep := $(obj:.o=.o.d) + +driver := $(out_base)/driver +test := $(out_base)/.test +clean := $(out_base)/.clean + + +# Import. +# +$(call import,\ + $(scf_root)/import/libxerces-c/stub.make,\ + l: xerces_c.l,cpp-options: xerces_c.l.cpp-options) + + +# Build. +# +$(driver): $(obj) $(xerces_c.l) + +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd +$(obj) $(dep): $(xerces_c.l.cpp-options) + +genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) +gen := $(addprefix $(out_base)/,$(genf)) + +$(gen): xsd := $(out_root)/xsd/xsd +$(gen): xsd_options += --generate-any-type --generate-serialization \ +--generate-ostream --generate-comparison +$(gen): $(out_root)/xsd/xsd + +$(call include-dep,$(dep),$(obj),$(gen)) + +# Convenience alias for default target. +# +$(out_base)/: $(driver) + + +# Test. +# +$(test): driver := $(driver) +$(test): $(driver) $(src_base)/test.xml $(src_base)/output + $(call message,test $$1,$$1 $(src_base)/test.xml | diff -u $(src_base)/output -,$(driver)) + +# Clean. +# +$(clean): $(driver).o.clean \ + $(addsuffix .cxx.clean,$(obj)) \ + $(addsuffix .cxx.clean,$(dep)) \ + $(addprefix $(out_base)/,$(xsd:.xsd=.cxx.xsd.clean)) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(gen): | $(out_base)/.gitignore +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver $(genf) +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# 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) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) +$(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif + + +# Dependencies. +# +$(call import,$(src_root)/xsd/makefile) diff --git a/xsd/tests/cxx/tree/any-type/output b/xsd/tests/cxx/tree/any-type/output new file mode 100644 index 0000000..580e7db --- /dev/null +++ b/xsd/tests/cxx/tree/any-type/output @@ -0,0 +1,73 @@ + +t: +t: +t: +t: +t: +t: +t: +t: +s: +s: simple +s: baz +l: one two three +a: any simple content + + + + + + any + any + + + nested 1 + nested 2 + + more + + mi + nested 1x + nested 2ed + content + + data + data + + simple + baz + one two three + + + + + + + + any + any + + + nested 1 + nested 2 + + more + + mi + + nested 1x + + nested 2ed + + content + + + data + data + + simple + baz + one two three + + + diff --git a/xsd/tests/cxx/tree/any-type/test.xml b/xsd/tests/cxx/tree/any-type/test.xml new file mode 100644 index 0000000..7c9035a --- /dev/null +++ b/xsd/tests/cxx/tree/any-type/test.xml @@ -0,0 +1,26 @@ + + + + + any + any + + + nested 1 + nested 2 + + more + + minested 1xnested 2edcontent + + + simple + + one two three + + diff --git a/xsd/tests/cxx/tree/any-type/test.xsd b/xsd/tests/cxx/tree/any-type/test.xsd new file mode 100644 index 0000000..37dcc8d --- /dev/null +++ b/xsd/tests/cxx/tree/any-type/test.xsd @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/xsd/tests/cxx/tree/binary/cdr/driver.cxx b/xsd/tests/cxx/tree/binary/cdr/driver.cxx index 42ca181..a2d7195 100644 --- a/xsd/tests/cxx/tree/binary/cdr/driver.cxx +++ b/xsd/tests/cxx/tree/binary/cdr/driver.cxx @@ -1,12 +1,11 @@ // file : tests/cxx/tree/binary/cdr/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test non-polymorphic binary serialization to ACE CDR. // -#include // std::auto_ptr +#include // std::auto_ptr/unique_ptr #include #include @@ -26,7 +25,7 @@ main (int argc, char* argv[]) try { - auto_ptr r (root (argv[1])); + XSD_AUTO_PTR r (root (argv[1])); // Save to a CDR stream. // @@ -38,7 +37,7 @@ main (int argc, char* argv[]) // ACE_InputCDR ace_icdr (ace_ocdr); xml_schema::istream icdr (ace_icdr); - auto_ptr c (new type (icdr)); + XSD_AUTO_PTR c (new type (icdr)); // Compare the two. // @@ -128,6 +127,14 @@ main (int argc, char* argv[]) assert (r->time () == c->time ()); assert (r->date_time () == c->date_time ()); assert (r->duration () == c->duration ()); + + // anySimpleType + // + assert (!r->any_simple_type_attr ().text_content ().empty ()); + assert (r->any_simple_type_attr () == c->any_simple_type_attr ()); + + assert (!r->any_simple_type ().text_content ().empty ()); + assert (r->any_simple_type () == c->any_simple_type ()); } catch (xml_schema::exception const& e) { diff --git a/xsd/tests/cxx/tree/binary/cdr/makefile b/xsd/tests/cxx/tree/binary/cdr/makefile index 67437dc..eb80d35 100644 --- a/xsd/tests/cxx/tree/binary/cdr/makefile +++ b/xsd/tests/cxx/tree/binary/cdr/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/binary/cdr/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make @@ -30,18 +29,18 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) $(ace.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) $(ace.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-insertion ACE_OutputCDR \ ---generate-extraction ACE_InputCDR +$(gen): xsd_options += --generate-insertion ACE_OutputCDR \ +--generate-extraction ACE_InputCDR --generate-comparison $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -78,7 +77,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/binary/cdr/test.xml b/xsd/tests/cxx/tree/binary/cdr/test.xml index 928b4cf..5cedd98 100644 --- a/xsd/tests/cxx/tree/binary/cdr/test.xml +++ b/xsd/tests/cxx/tree/binary/cdr/test.xml @@ -1,6 +1,7 @@ + xsi:schemaLocation="test test.xsd" + any_simple_type_attr="any simple content"> 1 2 3 @@ -87,5 +88,6 @@ 2001-11+02:00 + any simple content in element diff --git a/xsd/tests/cxx/tree/binary/cdr/test.xsd b/xsd/tests/cxx/tree/binary/cdr/test.xsd index e593f64..0629e94 100644 --- a/xsd/tests/cxx/tree/binary/cdr/test.xsd +++ b/xsd/tests/cxx/tree/binary/cdr/test.xsd @@ -112,7 +112,10 @@ + + + diff --git a/xsd/tests/cxx/tree/binary/makefile b/xsd/tests/cxx/tree/binary/makefile index 8a242c7..7ec2f6a 100644 --- a/xsd/tests/cxx/tree/binary/makefile +++ b/xsd/tests/cxx/tree/binary/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/binary/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/xsd/tests/cxx/tree/binary/polymorphic/driver.cxx b/xsd/tests/cxx/tree/binary/polymorphic/driver.cxx index 3c3e057..8e7256e 100644 --- a/xsd/tests/cxx/tree/binary/polymorphic/driver.cxx +++ b/xsd/tests/cxx/tree/binary/polymorphic/driver.cxx @@ -1,16 +1,17 @@ // file : tests/cxx/tree/binary/polymorphic/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test polymorphic binary serialization. // -#include // std::auto_ptr +#include // std::auto_ptr/unique_ptr #include #include #include +#include // ACE_HEX_DUMP + #include "test.hxx" using namespace std; @@ -27,7 +28,7 @@ main (int argc, char* argv[]) try { - auto_ptr r (root (argv[1])); + XSD_AUTO_PTR r (root (argv[1])); // Save to a CDR stream. // @@ -35,11 +36,24 @@ main (int argc, char* argv[]) xml_schema::ostream ocdr (ace_ocdr); ocdr << *r; + /* + // Print the binary representation. + // + cerr << "binary representation size: " << ace_ocdr.total_length () << endl; + + for (const ACE_Message_Block* mb = ace_ocdr.begin (); + mb != 0; + mb = mb->cont ()) + { + ACE_HEX_DUMP ((LM_DEBUG, mb->rd_ptr (), mb->length ())); + } + */ + // Load from a CDR stream. // ACE_InputCDR ace_icdr (ace_ocdr); xml_schema::istream icdr (ace_icdr); - auto_ptr c (new type (icdr)); + XSD_AUTO_PTR c (new type (icdr)); // Compare the two. // diff --git a/xsd/tests/cxx/tree/binary/polymorphic/makefile b/xsd/tests/cxx/tree/binary/polymorphic/makefile index 7e97e00..05c5186 100644 --- a/xsd/tests/cxx/tree/binary/polymorphic/makefile +++ b/xsd/tests/cxx/tree/binary/polymorphic/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/binary/polymorphic/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make @@ -30,18 +29,19 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) $(ace.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) $(ace.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-polymorphic --root-element-last \ ---generate-insertion ACE_OutputCDR --generate-extraction ACE_InputCDR +$(gen): xsd_options += --generate-polymorphic --root-element-last \ +--generate-insertion ACE_OutputCDR --generate-extraction ACE_InputCDR \ + --generate-comparison $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -78,7 +78,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/binary/xdr/driver.cxx b/xsd/tests/cxx/tree/binary/xdr/driver.cxx index cf2a264..623a953 100644 --- a/xsd/tests/cxx/tree/binary/xdr/driver.cxx +++ b/xsd/tests/cxx/tree/binary/xdr/driver.cxx @@ -1,12 +1,11 @@ // file : tests/cxx/tree/binary/xdr/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test non-polymorphic binary serialization to XDR. // -#include // std::auto_ptr +#include // std::auto_ptr/unique_ptr #include // std::memcpy #include #include @@ -17,15 +16,15 @@ using namespace std; using namespace test; extern "C" int -overflow (char* p, char* buf, int n) +overflow (char* p, char* buf, int in) { xml_schema::buffer* dst (reinterpret_cast (p)); - std::size_t size (dst->size ()); + size_t n (static_cast (in)), size (dst->size ()); dst->size (size + n); memcpy (dst->data () + size, buf, n); - return n; + return static_cast (n); } struct underflow_info @@ -35,17 +34,17 @@ struct underflow_info }; extern "C" int -underflow (char* p, char* buf, int n) +underflow (char* p, char* buf, int in) { underflow_info* ui (reinterpret_cast (p)); - std::size_t size (ui->buf->size () - ui->pos); + size_t n (static_cast (in)), size (ui->buf->size () - ui->pos); n = size > n ? n : size; memcpy (buf, ui->buf->data () + ui->pos, n); ui->pos += n; - return n; + return static_cast (n); } int @@ -59,7 +58,7 @@ main (int argc, char* argv[]) try { - auto_ptr r (root (argv[1])); + XSD_AUTO_PTR r (root (argv[1])); // Save to an XDR stream. // @@ -81,7 +80,7 @@ main (int argc, char* argv[]) xdr.x_op = XDR_DECODE; xdrrec_skiprecord (&xdr); xsd::cxx::tree::istream ixdr (xdr); - auto_ptr c (new type (ixdr)); + XSD_AUTO_PTR c (new type (ixdr)); xdr_destroy (&xdr); // Compare the two. @@ -172,6 +171,14 @@ main (int argc, char* argv[]) assert (r->year () == c->year ()); assert (r->year_month () == c->year_month ()); assert (r->time () == c->time ()); + + // anySimpleType + // + assert (!r->any_simple_type_attr ().text_content ().empty ()); + assert (r->any_simple_type_attr () == c->any_simple_type_attr ()); + + assert (!r->any_simple_type ().text_content ().empty ()); + assert (r->any_simple_type () == c->any_simple_type ()); } catch (xml_schema::exception const& e) { diff --git a/xsd/tests/cxx/tree/binary/xdr/makefile b/xsd/tests/cxx/tree/binary/xdr/makefile index 7b3089b..2994134 100644 --- a/xsd/tests/cxx/tree/binary/xdr/makefile +++ b/xsd/tests/cxx/tree/binary/xdr/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/binary/xdr/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make @@ -26,17 +25,18 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-insertion XDR --generate-extraction XDR +$(gen): xsd_options += --generate-insertion XDR --generate-extraction XDR \ +--generate-comparison $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -73,7 +73,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/binary/xdr/test.xml b/xsd/tests/cxx/tree/binary/xdr/test.xml index 928b4cf..5cedd98 100644 --- a/xsd/tests/cxx/tree/binary/xdr/test.xml +++ b/xsd/tests/cxx/tree/binary/xdr/test.xml @@ -1,6 +1,7 @@ + xsi:schemaLocation="test test.xsd" + any_simple_type_attr="any simple content"> 1 2 3 @@ -87,5 +88,6 @@ 2001-11+02:00 + any simple content in element diff --git a/xsd/tests/cxx/tree/binary/xdr/test.xsd b/xsd/tests/cxx/tree/binary/xdr/test.xsd index e593f64..0629e94 100644 --- a/xsd/tests/cxx/tree/binary/xdr/test.xsd +++ b/xsd/tests/cxx/tree/binary/xdr/test.xsd @@ -112,7 +112,10 @@ + + + diff --git a/xsd/tests/cxx/tree/built-in/driver.cxx b/xsd/tests/cxx/tree/built-in/driver.cxx index a41e4f3..f60ac16 100644 --- a/xsd/tests/cxx/tree/built-in/driver.cxx +++ b/xsd/tests/cxx/tree/built-in/driver.cxx @@ -1,12 +1,11 @@ // file : tests/cxx/tree/built-in/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2005-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test built-in type mapping. // -#include // std::auto_ptr +#include // std::auto_ptr/unique_ptr #include #include @@ -15,7 +14,6 @@ using std::cerr; using std::endl; -using std::auto_ptr; int main (int argc, char* argv[]) @@ -26,12 +24,13 @@ main (int argc, char* argv[]) return 1; } - auto_ptr elements (xmlns::test::elements (argv[1])); + XSD_AUTO_PTR elements ( + xmlns::test::elements (argv[1])); - auto_ptr attributes ( + XSD_AUTO_PTR attributes ( xmlns::test::attributes (argv[2])); - auto_ptr inherited ( + XSD_AUTO_PTR inherited ( xmlns::test::inherited (argv[3])); cerr << "elements: " << *elements << endl @@ -53,13 +52,14 @@ main (int argc, char* argv[]) xmlns::test::elements (ostr, *elements, map); std::istringstream istr (ostr.str ()); - auto_ptr elements1 (xmlns::test::elements (istr)); + XSD_AUTO_PTR elements1 ( + xmlns::test::elements (istr)); std::ostringstream ostr1; xmlns::test::elements (ostr1, *elements1, map); if (ostr.str () != ostr1.str ()) - return 1; + return 1; } { @@ -67,7 +67,7 @@ main (int argc, char* argv[]) xmlns::test::attributes (ostr, *attributes, map); std::istringstream istr (ostr.str ()); - auto_ptr attributes1 ( + XSD_AUTO_PTR attributes1 ( xmlns::test::attributes (istr)); std::ostringstream ostr1; @@ -82,7 +82,7 @@ main (int argc, char* argv[]) xmlns::test::inherited (ostr, *inherited, map); std::istringstream istr (ostr.str ()); - auto_ptr inherited1 ( + XSD_AUTO_PTR inherited1 ( xmlns::test::inherited (istr)); std::ostringstream ostr1; diff --git a/xsd/tests/cxx/tree/built-in/makefile b/xsd/tests/cxx/tree/built-in/makefile index bf6301b..3df37c3 100644 --- a/xsd/tests/cxx/tree/built-in/makefile +++ b/xsd/tests/cxx/tree/built-in/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/built-in/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make @@ -27,7 +26,7 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) @@ -35,7 +34,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := \ +$(gen): xsd_options += \ --char-type char \ --generate-inline \ --generate-ostream \ @@ -44,10 +43,9 @@ $(gen): xsd_options := \ --generate-from-base-ctor \ --root-element-all -$(gen): $(src_root)/xsd/xsd - -$(call include-dep,$(dep)) +$(gen): $(out_root)/xsd/xsd +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -90,7 +88,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. # diff --git a/xsd/tests/cxx/tree/chameleon/driver.cxx b/xsd/tests/cxx/tree/chameleon/driver.cxx index 6dae28e..80c67da 100644 --- a/xsd/tests/cxx/tree/chameleon/driver.cxx +++ b/xsd/tests/cxx/tree/chameleon/driver.cxx @@ -1,12 +1,11 @@ // file : tests/cxx/tree/chameleon/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test chameleon inclusion. // -#include // std::auto_ptr +#include // std::auto_ptr/unique_ptr #include #include "includer.hxx" @@ -25,7 +24,7 @@ main (int argc, char* argv[]) try { - auto_ptr r (root (argv[1])); + XSD_AUTO_PTR r (root (argv[1])); cout << *r << endl; } diff --git a/xsd/tests/cxx/tree/chameleon/makefile b/xsd/tests/cxx/tree/chameleon/makefile index 890de3f..4ae7eb7 100644 --- a/xsd/tests/cxx/tree/chameleon/makefile +++ b/xsd/tests/cxx/tree/chameleon/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/chameleon/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make @@ -27,17 +26,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --root-element root --generate-ostream +$(gen): xsd_options += --root-element root --generate-ostream $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -74,7 +73,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/comparison/driver.cxx b/xsd/tests/cxx/tree/comparison/driver.cxx index 07ed7a6..e685050 100644 --- a/xsd/tests/cxx/tree/comparison/driver.cxx +++ b/xsd/tests/cxx/tree/comparison/driver.cxx @@ -1,12 +1,11 @@ // file : tests/cxx/tree/comparison/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test generated comparison operators. // -#include // std::auto_ptr +#include // std::auto_ptr/unique_ptr #include #include "test.hxx" @@ -25,7 +24,7 @@ main (int argc, char* argv[]) try { - auto_ptr r (root (argv[1])); + XSD_AUTO_PTR r (root (argv[1])); type::complex_sequence s (r->complex ()); diff --git a/xsd/tests/cxx/tree/comparison/makefile b/xsd/tests/cxx/tree/comparison/makefile index 5d8721a..82cb7b0 100644 --- a/xsd/tests/cxx/tree/comparison/makefile +++ b/xsd/tests/cxx/tree/comparison/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/comparison/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make @@ -27,17 +26,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-comparison +$(gen): xsd_options += --generate-comparison $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -74,7 +73,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/compilation/driver.cxx b/xsd/tests/cxx/tree/compilation/driver.cxx index 8135c9b..c2e6298 100644 --- a/xsd/tests/cxx/tree/compilation/driver.cxx +++ b/xsd/tests/cxx/tree/compilation/driver.cxx @@ -1,13 +1,11 @@ // file : tests/cxx/tree/compilation/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Make sure the runtime library compiles by explicitly instantiating // all the types. // -#include // std::auto_ptr #include #include "test.hxx" @@ -15,7 +13,7 @@ using namespace std; using namespace test; -template class xsd::cxx::tree::simple_type; +template class xsd::cxx::tree::simple_type; // String types. // diff --git a/xsd/tests/cxx/tree/compilation/makefile b/xsd/tests/cxx/tree/compilation/makefile index 93b88db..16dbb91 100644 --- a/xsd/tests/cxx/tree/compilation/makefile +++ b/xsd/tests/cxx/tree/compilation/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/compilation/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make @@ -27,17 +26,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-serialization +$(gen): xsd_options += --generate-serialization $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -74,7 +73,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/complex/ctor/driver.cxx b/xsd/tests/cxx/tree/complex/ctor/driver.cxx index 55044a3..8ea8c87 100644 --- a/xsd/tests/cxx/tree/complex/ctor/driver.cxx +++ b/xsd/tests/cxx/tree/complex/ctor/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/tree/complex/ctor/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test generation of varous complex type constructors. @@ -11,6 +10,13 @@ #include "test.hxx" +#ifdef XSD_CXX11 +# include // std::move +# define XSD_MOVE(x) std::move(x) +#else +# define XSD_MOVE(x) x +#endif + using namespace std; using namespace test; @@ -64,12 +70,12 @@ main () // e_base b1 (1, "foo", e_complex_type ("bar")); - auto_ptr c2 (new e_complex_type ("bar")); - e_base b2 (1, "foo", c2); + XSD_AUTO_PTR c2 (new e_complex_type ("bar")); + e_base b2 (1, "foo", XSD_MOVE (c2)); - auto_ptr s3 (new e_simple_type ("foo")); - auto_ptr c3 (new e_complex_type ("bar")); - e_base b3 (1, s3, c3); + XSD_AUTO_PTR s3 (new e_simple_type ("foo")); + XSD_AUTO_PTR c3 (new e_complex_type ("bar")); + e_base b3 (1, XSD_MOVE (s3), XSD_MOVE (c3)); assert (b1 == b2); assert (b1 == b3); @@ -79,15 +85,20 @@ main () e_derived d1 (1, "foo", e_complex_type ("bar"), true, "baz", e_complex_type ("biz")); - auto_ptr c2a (new e_complex_type ("bar")); - auto_ptr c2b (new e_complex_type ("biz")); - e_derived d2 (1, "foo", c2a, true, "baz", c2b); - - auto_ptr s3a (new e_simple_type ("foo")); - auto_ptr s3b (new xml_schema::string ("baz")); - auto_ptr c3a (new e_complex_type ("bar")); - auto_ptr c3b (new e_complex_type ("biz")); - e_derived d3 (1, s3a, c3a, true, s3b, c3b); + XSD_AUTO_PTR c2a (new e_complex_type ("bar")); + XSD_AUTO_PTR c2b (new e_complex_type ("biz")); + e_derived d2 (1, "foo", XSD_MOVE (c2a), true, "baz", XSD_MOVE (c2b)); + + XSD_AUTO_PTR s3a (new e_simple_type ("foo")); + XSD_AUTO_PTR s3b (new xml_schema::string ("baz")); + XSD_AUTO_PTR c3a (new e_complex_type ("bar")); + XSD_AUTO_PTR c3b (new e_complex_type ("biz")); + e_derived d3 (1, + XSD_MOVE (s3a), + XSD_MOVE (c3a), + true, + XSD_MOVE (s3b), + XSD_MOVE (c3b)); assert (d1 == d2); assert (d1 == d3); @@ -99,12 +110,12 @@ main () { f_type f1 (xml_schema::type (), 1, "foo", f_complex_type ("bar")); - auto_ptr c2 (new f_complex_type ("bar")); - f_type f2 (1, "foo", c2); + XSD_AUTO_PTR c2 (new f_complex_type ("bar")); + f_type f2 (1, "foo", XSD_MOVE (c2)); - auto_ptr s3 (new f_simple_type ("foo")); - auto_ptr c3 (new f_complex_type ("bar")); - f_type f3 (1, s3, c3); + XSD_AUTO_PTR s3 (new f_simple_type ("foo")); + XSD_AUTO_PTR c3 (new f_complex_type ("bar")); + f_type f3 (1, XSD_MOVE (s3), XSD_MOVE (c3)); assert (f1 == f2); assert (f1 == f3); diff --git a/xsd/tests/cxx/tree/complex/ctor/makefile b/xsd/tests/cxx/tree/complex/ctor/makefile index 66558f5..ffc82b0 100644 --- a/xsd/tests/cxx/tree/complex/ctor/makefile +++ b/xsd/tests/cxx/tree/complex/ctor/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/complex/ctor/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make @@ -27,19 +26,19 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-default-ctor --generate-from-base-ctor \ +$(gen): xsd_options += --generate-default-ctor --generate-from-base-ctor \ --generate-doxygen --generate-polymorphic --polymorphic-type-all \ --generate-comparison $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -76,8 +75,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) -$(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) +$(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. # diff --git a/xsd/tests/cxx/tree/complex/makefile b/xsd/tests/cxx/tree/complex/makefile index a0b3294..db6e6a8 100644 --- a/xsd/tests/cxx/tree/complex/makefile +++ b/xsd/tests/cxx/tree/complex/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/complex/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/xsd/tests/cxx/tree/containment/driver.cxx b/xsd/tests/cxx/tree/containment/driver.cxx index cb6c76e..f019de8 100644 --- a/xsd/tests/cxx/tree/containment/driver.cxx +++ b/xsd/tests/cxx/tree/containment/driver.cxx @@ -1,16 +1,22 @@ // file : tests/cxx/tree/containment/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test tree node containment. // -#include // std::auto_ptr +#include // std::auto_ptr/unique_ptr #include #include "test.hxx" +#ifdef XSD_CXX11 +# include // std::move +# define XSD_MOVE(x) std::move(x) +#else +# define XSD_MOVE(x) x +#endif + using namespace std; using namespace test; @@ -20,11 +26,11 @@ main () // Change of a container in a sub-tree without ID. // { - auto_ptr i (new inner ()); + XSD_AUTO_PTR i (new inner ()); i->ref ("foo"); outer o; - o.i (i); + o.i (XSD_MOVE (i)); o.ref ("foo"); assert (o.i ()->ref ()->get () == 0); @@ -34,14 +40,14 @@ main () // Change of container in a sub-tree with ID inside. // { - auto_ptr i (new inner ()); + XSD_AUTO_PTR i (new inner ()); inner* p (i.get ()); i->id ("foo"); i->ref ("foo"); assert (i->ref ()->get () == p); outer o; - o.i (i); + o.i (XSD_MOVE (i)); o.ref ("foo"); assert (o.i ()->ref ()->get () == p); @@ -51,10 +57,10 @@ main () // Change of a container in ID. // { - auto_ptr id (new xml_schema::id ("foo")); + XSD_AUTO_PTR id (new xml_schema::id ("foo")); inner i; - i.id (id); + i.id (XSD_MOVE (id)); i.ref ("foo"); assert (i.ref ()->get () == &i); } @@ -62,12 +68,12 @@ main () // Change of a container in a type derived from ID with ID inside. // { - auto_ptr id (new id_ex ("foo")); + XSD_AUTO_PTR id (new id_ex ("foo")); id_ex* p (id.get ()); id->id ("bar"); inner i; - i.id_ex (id); + i.id_ex (XSD_MOVE (id)); i.ref ("foo"); assert (i.ref ()->get () == &i); @@ -81,28 +87,28 @@ main () { id i1 ("a"), i2 ("b"); - auto_ptr ic (new ids); + XSD_AUTO_PTR ic (new ids); ic->id ().push_back (i1); ic->id ().push_back (i2); - auto_ptr r1 (new xml_schema::idrefs); + XSD_AUTO_PTR r1 (new xml_schema::idrefs); r1->push_back (xml_schema::idref ("a")); r1->push_back (xml_schema::idref ("b")); - auto_ptr r2 (new idref_list); + XSD_AUTO_PTR r2 (new idref_list); r2->push_back (xml_schema::idref ("a")); r2->push_back (xml_schema::idref ("b")); - auto_ptr rc1 (new idrefs1); - auto_ptr rc2 (new idrefs2); + XSD_AUTO_PTR rc1 (new idrefs1); + XSD_AUTO_PTR rc2 (new idrefs2); - rc1->idrefs (r1); - rc2->idrefs (r2); + rc1->idrefs (XSD_MOVE (r1)); + rc2->idrefs (XSD_MOVE (r2)); model m; - m.ids (ic); - m.idrefs1 (rc1); - m.idrefs2 (rc2); + m.ids (XSD_MOVE (ic)); + m.idrefs1 (XSD_MOVE (rc1)); + m.idrefs2 (XSD_MOVE (rc2)); assert (m.idrefs1 ().idrefs ()[0].get () != 0); assert (m.idrefs1 ().idrefs ()[1].get () != 0); diff --git a/xsd/tests/cxx/tree/containment/makefile b/xsd/tests/cxx/tree/containment/makefile index fcdd792..d181fb5 100644 --- a/xsd/tests/cxx/tree/containment/makefile +++ b/xsd/tests/cxx/tree/containment/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/containment/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make @@ -27,17 +26,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-default-ctor +$(gen): xsd_options += --generate-default-ctor $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -74,7 +73,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/default/general/driver.cxx b/xsd/tests/cxx/tree/default/general/driver.cxx index a48650f..b0df8ba 100644 --- a/xsd/tests/cxx/tree/default/general/driver.cxx +++ b/xsd/tests/cxx/tree/default/general/driver.cxx @@ -1,12 +1,11 @@ // file : tests/cxx/tree/default/general/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test default attribute/element values. // -#include // std::auto_ptr +#include // std::auto_ptr/unique_ptr #include #include "test.hxx" @@ -25,7 +24,7 @@ main (int argc, char* argv[]) try { - auto_ptr r (root (argv[1], xml_schema::flags::dont_validate)); + XSD_AUTO_PTR r (root (argv[1], xml_schema::flags::dont_validate)); xml_schema::namespace_infomap map; map["t"].name = "test"; diff --git a/xsd/tests/cxx/tree/default/general/makefile b/xsd/tests/cxx/tree/default/general/makefile index b1b7fca..6c2dfe6 100644 --- a/xsd/tests/cxx/tree/default/general/makefile +++ b/xsd/tests/cxx/tree/default/general/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/default/general/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make @@ -27,18 +26,18 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-ostream --generate-serialization \ +$(gen): xsd_options += --generate-ostream --generate-serialization \ --generate-default-ctor --generate-from-base-ctor $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -75,7 +74,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/default/general/output b/xsd/tests/cxx/tree/default/general/output index 72a8fa4..396a698 100644 --- a/xsd/tests/cxx/tree/default/general/output +++ b/xsd/tests/cxx/tree/default/general/output @@ -1,28 +1,15 @@ - - - - - diff --git a/xsd/tests/cxx/tree/default/makefile b/xsd/tests/cxx/tree/default/makefile index 218e69c..56fa53d 100644 --- a/xsd/tests/cxx/tree/default/makefile +++ b/xsd/tests/cxx/tree/default/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/default/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/xsd/tests/cxx/tree/default/omit/driver.cxx b/xsd/tests/cxx/tree/default/omit/driver.cxx index cbf69b5..6a074c1 100644 --- a/xsd/tests/cxx/tree/default/omit/driver.cxx +++ b/xsd/tests/cxx/tree/default/omit/driver.cxx @@ -1,12 +1,11 @@ // file : tests/cxx/tree/default/omit/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test default attribute omission from the output. // -#include // std::auto_ptr +#include // std::auto_ptr/unique_ptr #include #include "test.hxx" @@ -25,7 +24,7 @@ main (int argc, char* argv[]) try { - auto_ptr r (root (argv[1], xml_schema::flags::dont_validate)); + XSD_AUTO_PTR r (root (argv[1], xml_schema::flags::dont_validate)); cout << *r << endl << "default x: " << derived::x_default_value () << endl diff --git a/xsd/tests/cxx/tree/default/omit/makefile b/xsd/tests/cxx/tree/default/omit/makefile index e0cce27..caaec12 100644 --- a/xsd/tests/cxx/tree/default/omit/makefile +++ b/xsd/tests/cxx/tree/default/omit/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/default/omit/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make @@ -27,18 +26,18 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-ostream --generate-serialization \ +$(gen): xsd_options += --generate-ostream --generate-serialization \ --generate-default-ctor --generate-from-base-ctor --omit-default-attributes $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -75,7 +74,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/default/omit/output b/xsd/tests/cxx/tree/default/omit/output index eef99a3..150ad58 100644 --- a/xsd/tests/cxx/tree/default/omit/output +++ b/xsd/tests/cxx/tree/default/omit/output @@ -13,9 +13,7 @@ fixed q1: 1 fixed q2: 2 - a - diff --git a/xsd/tests/cxx/tree/detach/driver.cxx b/xsd/tests/cxx/tree/detach/driver.cxx index afcb90d..cabd9ea 100644 --- a/xsd/tests/cxx/tree/detach/driver.cxx +++ b/xsd/tests/cxx/tree/detach/driver.cxx @@ -1,22 +1,30 @@ // file : tests/cxx/tree/detach/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test the detach functionality. // -#include // std::auto_ptr +#include // std::auto_ptr/unique_ptr #include #include "test.hxx" +#ifdef XSD_CXX11 +# include // std::move +# define XSD_MOVE(x) std::move(x) +#else +# define XSD_MOVE(x) x +#endif + using namespace std; using namespace test; int main () { + using test::ref; + // Construct the model. // object o1 ("o1"); @@ -57,22 +65,22 @@ main () // Detach one. // - auto_ptr p (m.detach_one ()); + XSD_AUTO_PTR p (m.detach_one ()); assert (p->_container () == 0); assert (p->r ()[0].get () == &p->o ()[1]); assert (m.opt ()->r ()[1].get () == 0); - m.one (p); + m.one (XSD_MOVE (p)); assert (m.opt ()->r ()[1].get () == &m.one ().o ()[0]); p = m.detach_one (); model m1; - m1.one (p); + m1.one (XSD_MOVE (p)); m1.opt (s2); assert (m1.opt ()->r ()[1].get () == &m1.one ().o ()[0]); p = m1.detach_one (); - m.seq ().push_back (p); + m.seq ().push_back (XSD_MOVE (p)); // Detach opt. // @@ -82,7 +90,7 @@ main () assert (p->r ()[0].get () == &p->o ()[1]); assert (m.seq ()[0].r ()[1].get () == 0); - m.seq ().push_back (p); + m.seq ().push_back (XSD_MOVE (p)); // Detach seq. // @@ -91,7 +99,7 @@ main () assert (p->r ()[0].get () == &p->o ()[1]); assert (m.seq ()[0].r ()[1].get () == 0); - m.seq ().push_back (p); + m.seq ().push_back (XSD_MOVE (p)); assert (m.seq ()[0].r ()[1].get () == &m.seq ()[1].o ()[0]); m.seq ().detach (m.seq ().begin (), p); diff --git a/xsd/tests/cxx/tree/detach/makefile b/xsd/tests/cxx/tree/detach/makefile index 938fba2..64def55 100644 --- a/xsd/tests/cxx/tree/detach/makefile +++ b/xsd/tests/cxx/tree/detach/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/detach/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make @@ -27,17 +26,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-detach --generate-default-ctor +$(gen): xsd_options += --generate-detach --generate-default-ctor $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -74,7 +73,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/dom-association/dom-parse.cxx b/xsd/tests/cxx/tree/dom-association/dom-parse.cxx new file mode 100644 index 0000000..c065d19 --- /dev/null +++ b/xsd/tests/cxx/tree/dom-association/dom-parse.cxx @@ -0,0 +1,96 @@ +// file : tests/cxx/tree/dom-association/dom-parse.cxx +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#include "dom-parse.hxx" + +#include + +#include +#include // chLatin_* +#include + +#include +#include + +#include +#include + +using namespace xercesc; +namespace xml = xsd::cxx::xml; +namespace tree = xsd::cxx::tree; + +XSD_DOM_AUTO_PTR +parse (std::istream& is, + const std::string& id, + bool validate) +{ + const XMLCh ls_id [] = {chLatin_L, chLatin_S, chNull}; + + // Get an implementation of the Load-Store (LS) interface. + // + DOMImplementation* impl ( + DOMImplementationRegistry::getDOMImplementation (ls_id)); + + XSD_DOM_AUTO_PTR parser ( + impl->createLSParser (DOMImplementationLS::MODE_SYNCHRONOUS, 0)); + + DOMConfiguration* conf (parser->getDomConfig ()); + + // Discard comment nodes in the document. + // + conf->setParameter (XMLUni::fgDOMComments, false); + + // Enable datatype normalization. + // + conf->setParameter (XMLUni::fgDOMDatatypeNormalization, true); + + // Do not create EntityReference nodes in the DOM tree. No + // EntityReference nodes will be created, only the nodes + // corresponding to their fully expanded substitution text + // will be created. + // + conf->setParameter (XMLUni::fgDOMEntities, false); + + // Perform namespace processing. + // + conf->setParameter (XMLUni::fgDOMNamespaces, true); + + // Do not include ignorable whitespace in the DOM tree. + // + conf->setParameter (XMLUni::fgDOMElementContentWhitespace, false); + + // Enable/Disable validation. + // + conf->setParameter (XMLUni::fgDOMValidate, validate); + conf->setParameter (XMLUni::fgXercesSchema, validate); + conf->setParameter (XMLUni::fgXercesSchemaFullChecking, false); + + // Xerces-C++ 3.1.0 is the first version with working multi import + // support. + // +#if _XERCES_VERSION >= 30100 + conf->setParameter (XMLUni::fgXercesHandleMultipleImports, true); +#endif + + // We will release the DOM document ourselves. + // + conf->setParameter (XMLUni::fgXercesUserAdoptsDOMDocument, true); + + // Set error handler. + // + tree::error_handler eh; + xml::dom::bits::error_handler_proxy ehp (eh); + conf->setParameter (XMLUni::fgDOMErrorHandler, &ehp); + + // Prepare input stream. + // + xml::sax::std_input_source isrc (is, id); + Wrapper4InputSource wrap (&isrc, false); + + XSD_DOM_AUTO_PTR doc (parser->parse (&wrap)); + + eh.throw_if_failed > (); + + return doc; +} diff --git a/xsd/tests/cxx/tree/dom-association/dom-parse.hxx b/xsd/tests/cxx/tree/dom-association/dom-parse.hxx new file mode 100644 index 0000000..2c3bd3f --- /dev/null +++ b/xsd/tests/cxx/tree/dom-association/dom-parse.hxx @@ -0,0 +1,24 @@ +// file : tests/cxx/tree/dom-association/dom-parse.hxx +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +#ifndef DOM_PARSE +#define DOM_PARSE + +#include +#include + +#include + +#include + +// Parse an XML document from the standard input stream with an +// optional resource id. Resource id is used in diagnostics as +// well as to locate schemas referenced from inside the document. +// +XSD_DOM_AUTO_PTR +parse (std::istream& is, + const std::string& id, + bool validate); + +#endif // DOM_PARSE diff --git a/xsd/tests/cxx/tree/dom-association/driver.cxx b/xsd/tests/cxx/tree/dom-association/driver.cxx new file mode 100644 index 0000000..edcda50 --- /dev/null +++ b/xsd/tests/cxx/tree/dom-association/driver.cxx @@ -0,0 +1,72 @@ +// file : tests/cxx/tree/dom-association/driver.cxx +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +// Test DOM association/ownership. +// + +#include // std::auto_ptr/unique_ptr +#include +#include + +#include + +#include "dom-parse.hxx" +#include "test.hxx" + +using namespace std; +using namespace test; +using namespace xercesc; + +int +main (int argc, char* argv[]) +{ + if (argc != 2) + { + cerr << "usage: " << argv[0] << " test.xml" << endl; + return 1; + } + + int r (0); + + XMLPlatformUtils::Initialize (); + + try + { + ifstream ifs; + ifs.exceptions (ifstream::badbit | ifstream::failbit); + ifs.open (argv[1]); + + DOMDocument* ptr; + +#ifdef XSD_CXX11 + xml_schema::dom::unique_ptr doc (parse (ifs, argv[1], true)); + ptr = doc.get (); + unique_ptr r ( + root (std::move (doc), + xml_schema::flags::keep_dom | xml_schema::flags::own_dom)); +#else + xml_schema::dom::auto_ptr doc (parse (ifs, argv[1], true)); + ptr = doc.get (); + auto_ptr r ( + root (doc, + xml_schema::flags::keep_dom | xml_schema::flags::own_dom)); +#endif + + assert (doc.get () == 0); + assert (r->_node ()->getOwnerDocument () == ptr); + } + catch (xml_schema::exception const& e) + { + cerr << e << endl; + r = 1; + } + catch (const std::ios_base::failure&) + { + cerr << argv[1] << ": unable to open or read failure" << endl; + r = 1; + } + + XMLPlatformUtils::Terminate (); + return r; +} diff --git a/xsd/tests/cxx/tree/dom-association/makefile b/xsd/tests/cxx/tree/dom-association/makefile new file mode 100644 index 0000000..4a05d45 --- /dev/null +++ b/xsd/tests/cxx/tree/dom-association/makefile @@ -0,0 +1,92 @@ +# file : tests/cxx/tree/dom-association/makefile +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make + +xsd := test.xsd +cxx := driver.cxx dom-parse.cxx + +obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=.o)) +dep := $(obj:.o=.o.d) + +driver := $(out_base)/driver +test := $(out_base)/.test +clean := $(out_base)/.clean + + +# Import. +# +$(call import,\ + $(scf_root)/import/libxerces-c/stub.make,\ + l: xerces_c.l,cpp-options: xerces_c.l.cpp-options) + + +# Build. +# +$(driver): $(obj) $(xerces_c.l) + +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd +$(obj) $(dep): $(xerces_c.l.cpp-options) + +# Define XSD_CXX11 since we include libxsd headers directly. +# +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifeq ($(cxx_standard),c++11) +$(obj) $(dep): cpp_options += -DXSD_CXX11 +endif + +genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) +gen := $(addprefix $(out_base)/,$(genf)) + +$(gen): xsd := $(out_root)/xsd/xsd +$(gen): xsd_options += --generate-ostream +$(gen): $(out_root)/xsd/xsd + +$(call include-dep,$(dep),$(obj),$(gen)) + +# Convenience alias for default target. +# +$(out_base)/: $(driver) + + +# Test. +# +$(test): driver := $(driver) +$(test): $(driver) $(src_base)/test.xml $(src_base)/output + $(call message,test $$1,$$1 $(src_base)/test.xml | diff -u $(src_base)/output -,$(driver)) + +# Clean. +# +$(clean): $(driver).o.clean \ + $(addsuffix .cxx.clean,$(obj)) \ + $(addsuffix .cxx.clean,$(dep)) \ + $(addprefix $(out_base)/,$(xsd:.xsd=.cxx.xsd.clean)) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(gen): | $(out_base)/.gitignore +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver $(genf) +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# 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) + +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) +$(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif + + +# Dependencies. +# +$(call import,$(src_root)/xsd/makefile) diff --git a/xsd/tests/cxx/tree/dom-association/output b/xsd/tests/cxx/tree/dom-association/output new file mode 100644 index 0000000..e69de29 diff --git a/xsd/tests/cxx/tree/dom-association/test.xml b/xsd/tests/cxx/tree/dom-association/test.xml new file mode 100644 index 0000000..624a80c --- /dev/null +++ b/xsd/tests/cxx/tree/dom-association/test.xml @@ -0,0 +1,7 @@ + + + a + + diff --git a/xsd/tests/cxx/tree/dom-association/test.xsd b/xsd/tests/cxx/tree/dom-association/test.xsd new file mode 100644 index 0000000..07bebc7 --- /dev/null +++ b/xsd/tests/cxx/tree/dom-association/test.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/xsd/tests/cxx/tree/encoding/char/iso-8859-1/driver.cxx b/xsd/tests/cxx/tree/encoding/char/iso-8859-1/driver.cxx index 56b2df8..6a92ae0 100644 --- a/xsd/tests/cxx/tree/encoding/char/iso-8859-1/driver.cxx +++ b/xsd/tests/cxx/tree/encoding/char/iso-8859-1/driver.cxx @@ -1,12 +1,11 @@ // file : tests/cxx/tree/encoding/char/iso-8859-1/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test ISO-8859-1 encoding. // -#include // std::auto_ptr +#include // std::auto_ptr/unique_ptr #include #include @@ -36,7 +35,7 @@ main (int argc, char* argv[]) } xsd::cxx::xml::char_transcoder::unrep_char ('?'); - auto_ptr r (root (argv[1])); + XSD_AUTO_PTR r (root (argv[1])); { type::a_sequence const& s (r->a ()); diff --git a/xsd/tests/cxx/tree/encoding/char/iso-8859-1/makefile b/xsd/tests/cxx/tree/encoding/char/iso-8859-1/makefile index 967357f..8a952f7 100644 --- a/xsd/tests/cxx/tree/encoding/char/iso-8859-1/makefile +++ b/xsd/tests/cxx/tree/encoding/char/iso-8859-1/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/encoding/char/iso-8859-1/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make @@ -27,18 +26,18 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --char-encoding iso8859-1 --generate-serialization \ +$(gen): xsd_options += --char-encoding iso8859-1 --generate-serialization \ --generate-doxygen $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -75,7 +74,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/encoding/char/iso-8859-1/test.std b/xsd/tests/cxx/tree/encoding/char/iso-8859-1/test.std index ca6297f..d26b30f 100644 --- a/xsd/tests/cxx/tree/encoding/char/iso-8859-1/test.std +++ b/xsd/tests/cxx/tree/encoding/char/iso-8859-1/test.std @@ -1,18 +1,10 @@ - abc - æ - ¢£¤¥ - ??? - abc - aâc - âòbc - diff --git a/xsd/tests/cxx/tree/encoding/char/lcp/driver.cxx b/xsd/tests/cxx/tree/encoding/char/lcp/driver.cxx index 2fb13a3..d44d0fe 100644 --- a/xsd/tests/cxx/tree/encoding/char/lcp/driver.cxx +++ b/xsd/tests/cxx/tree/encoding/char/lcp/driver.cxx @@ -1,13 +1,12 @@ // file : tests/cxx/tree/encoding/char/lcp/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test local code page encoding (--char-encoding lcp). // The test just makes sure it still compiles and works. // -#include // std::auto_ptr +#include // std::auto_ptr/unique_ptr #include #include @@ -27,7 +26,7 @@ main (int argc, char* argv[]) try { - auto_ptr r (root (argv[1])); + XSD_AUTO_PTR r (root (argv[1])); xml_schema::namespace_infomap map; map["t"].name = "test"; diff --git a/xsd/tests/cxx/tree/encoding/char/lcp/makefile b/xsd/tests/cxx/tree/encoding/char/lcp/makefile index 518c514..9dc599d 100644 --- a/xsd/tests/cxx/tree/encoding/char/lcp/makefile +++ b/xsd/tests/cxx/tree/encoding/char/lcp/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/encoding/char/lcp/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make @@ -27,17 +26,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-serialization --char-encoding lcp +$(gen): xsd_options += --generate-serialization --char-encoding lcp $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -74,7 +73,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/encoding/char/lcp/test.std b/xsd/tests/cxx/tree/encoding/char/lcp/test.std index cc20ef7..368826d 100644 --- a/xsd/tests/cxx/tree/encoding/char/lcp/test.std +++ b/xsd/tests/cxx/tree/encoding/char/lcp/test.std @@ -1,6 +1,4 @@ - abcd - diff --git a/xsd/tests/cxx/tree/encoding/char/makefile b/xsd/tests/cxx/tree/encoding/char/makefile index 3e64dd9..587eeb1 100644 --- a/xsd/tests/cxx/tree/encoding/char/makefile +++ b/xsd/tests/cxx/tree/encoding/char/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/encoding/char/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make diff --git a/xsd/tests/cxx/tree/encoding/char/utf-8/driver.cxx b/xsd/tests/cxx/tree/encoding/char/utf-8/driver.cxx index 0842203..9d12659 100644 --- a/xsd/tests/cxx/tree/encoding/char/utf-8/driver.cxx +++ b/xsd/tests/cxx/tree/encoding/char/utf-8/driver.cxx @@ -1,12 +1,11 @@ // file : tests/cxx/tree/encoding/char/utf-8/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test UTF-8 encoding. // -#include // std::auto_ptr +#include // std::auto_ptr/unique_ptr #include #include @@ -26,7 +25,7 @@ main (int argc, char* argv[]) try { - auto_ptr r (root (argv[1])); + XSD_AUTO_PTR r (root (argv[1])); { type::a_sequence const& s (r->a ()); @@ -57,7 +56,7 @@ main (int argc, char* argv[]) xml_schema::namespace_infomap map; map["t"].name = "test"; - root (std::cout, *r, map, "UCS-4LE"); + root (std::cout, *r, map, "ASCII"); } catch (xml_schema::exception const& e) { diff --git a/xsd/tests/cxx/tree/encoding/char/utf-8/makefile b/xsd/tests/cxx/tree/encoding/char/utf-8/makefile index 8c0256e..e2bbdfc 100644 --- a/xsd/tests/cxx/tree/encoding/char/utf-8/makefile +++ b/xsd/tests/cxx/tree/encoding/char/utf-8/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/encoding/char/utf-8/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make @@ -27,17 +26,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-serialization --generate-doxygen +$(gen): xsd_options += --generate-serialization --generate-doxygen $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -74,7 +73,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/encoding/char/utf-8/test.std b/xsd/tests/cxx/tree/encoding/char/utf-8/test.std index 328fe6d..ffce337 100644 Binary files a/xsd/tests/cxx/tree/encoding/char/utf-8/test.std and b/xsd/tests/cxx/tree/encoding/char/utf-8/test.std differ diff --git a/xsd/tests/cxx/tree/encoding/makefile b/xsd/tests/cxx/tree/encoding/makefile index fcadb8c..2108fa2 100644 --- a/xsd/tests/cxx/tree/encoding/makefile +++ b/xsd/tests/cxx/tree/encoding/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/encoding/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/xsd/tests/cxx/tree/encoding/wchar/driver.cxx b/xsd/tests/cxx/tree/encoding/wchar/driver.cxx index 22cbfb4..6b8d51e 100644 --- a/xsd/tests/cxx/tree/encoding/wchar/driver.cxx +++ b/xsd/tests/cxx/tree/encoding/wchar/driver.cxx @@ -1,12 +1,11 @@ // file : tests/cxx/tree/encoding/wchar/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test the wide character mapping. // -#include // std::auto_ptr +#include // std::auto_ptr/unique_ptr #include #include @@ -29,7 +28,7 @@ main (int argc, char* argv[]) // Use dont_validate because we do not have instance's system id (path). // std::ifstream ifs (argv[1]); - auto_ptr r (root (ifs, xml_schema::flags::dont_validate)); + XSD_AUTO_PTR r (root (ifs, xml_schema::flags::dont_validate)); { type::b_sequence const& s (r->b ()); @@ -47,7 +46,7 @@ main (int argc, char* argv[]) xml_schema::namespace_infomap map; map[L"t"].name = L"test"; - root (std::cout, *r, map, L"UCS-4LE"); + root (std::cout, *r, map, L"ASCII"); } catch (xml_schema::exception const& e) { diff --git a/xsd/tests/cxx/tree/encoding/wchar/makefile b/xsd/tests/cxx/tree/encoding/wchar/makefile index fb2faed..e66d3a5 100644 --- a/xsd/tests/cxx/tree/encoding/wchar/makefile +++ b/xsd/tests/cxx/tree/encoding/wchar/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/encoding/wchar/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make @@ -27,18 +26,18 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-serialization --generate-doxygen \ +$(gen): xsd_options += --generate-serialization --generate-doxygen \ --char-type wchar_t $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -75,7 +74,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/encoding/wchar/test.std b/xsd/tests/cxx/tree/encoding/wchar/test.std index 93d4561..815ba6c 100644 Binary files a/xsd/tests/cxx/tree/encoding/wchar/test.std and b/xsd/tests/cxx/tree/encoding/wchar/test.std differ diff --git a/xsd/tests/cxx/tree/enumeration/ctor/driver.cxx b/xsd/tests/cxx/tree/enumeration/ctor/driver.cxx index 114b7b7..bd2589f 100644 --- a/xsd/tests/cxx/tree/enumeration/ctor/driver.cxx +++ b/xsd/tests/cxx/tree/enumeration/ctor/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/tree/enumeration/ctor/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test enumeration constructors. diff --git a/xsd/tests/cxx/tree/enumeration/ctor/makefile b/xsd/tests/cxx/tree/enumeration/ctor/makefile index b33ab94..2fae138 100644 --- a/xsd/tests/cxx/tree/enumeration/ctor/makefile +++ b/xsd/tests/cxx/tree/enumeration/ctor/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/enumeration/ctor/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make @@ -27,18 +26,18 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-default-ctor --generate-from-base-ctor \ +$(gen): xsd_options += --generate-default-ctor --generate-from-base-ctor \ --generate-doxygen $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -75,7 +74,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/enumeration/inheritance/driver.cxx b/xsd/tests/cxx/tree/enumeration/inheritance/driver.cxx index 358f61d..0a6d5d2 100644 --- a/xsd/tests/cxx/tree/enumeration/inheritance/driver.cxx +++ b/xsd/tests/cxx/tree/enumeration/inheritance/driver.cxx @@ -1,12 +1,12 @@ // file : tests/cxx/tree/enumeration/inheritance/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Insert test description here. // -#include // std::auto_ptr +#include // std::auto_ptr/unique_ptr +#include #include #include "test.hxx" @@ -25,7 +25,7 @@ main (int argc, char* argv[]) try { - auto_ptr r (root (argv[1])); + XSD_AUTO_PTR r (root (argv[1])); switch (*r) { @@ -39,6 +39,11 @@ main (int argc, char* argv[]) cout << "bottom" << endl; break; } + default: // Suppress warning. + { + assert (false); + break; + } } } catch (xml_schema::exception const& e) diff --git a/xsd/tests/cxx/tree/enumeration/inheritance/makefile b/xsd/tests/cxx/tree/enumeration/inheritance/makefile index c29b0f8..77df855 100644 --- a/xsd/tests/cxx/tree/enumeration/inheritance/makefile +++ b/xsd/tests/cxx/tree/enumeration/inheritance/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/enumeration/inheritance/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make @@ -27,17 +26,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-ostream +$(gen): xsd_options += --generate-ostream $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -74,7 +73,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/enumeration/makefile b/xsd/tests/cxx/tree/enumeration/makefile index 5730a08..8f55b20 100644 --- a/xsd/tests/cxx/tree/enumeration/makefile +++ b/xsd/tests/cxx/tree/enumeration/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/enumeration/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/xsd/tests/cxx/tree/float/driver.cxx b/xsd/tests/cxx/tree/float/driver.cxx index d2ec1dd..a71d2f3 100644 --- a/xsd/tests/cxx/tree/float/driver.cxx +++ b/xsd/tests/cxx/tree/float/driver.cxx @@ -1,13 +1,12 @@ // file : tests/cxx/tree/float/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test floating point (xsd:{float, double, decimal}) type parsing // and serialization. // -#include // std::auto_ptr +#include // std::auto_ptr/unique_ptr #include #include "test.hxx" @@ -26,7 +25,7 @@ main (int argc, char* argv[]) try { - auto_ptr r (root (argv[1])); + XSD_AUTO_PTR r (root (argv[1])); r->simple ().push_back (12.129456); r->simple ().push_back (123.129456); diff --git a/xsd/tests/cxx/tree/float/makefile b/xsd/tests/cxx/tree/float/makefile index 21966ba..a585afb 100644 --- a/xsd/tests/cxx/tree/float/makefile +++ b/xsd/tests/cxx/tree/float/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/float/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make @@ -27,17 +26,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-serialization --root-element-all +$(gen): xsd_options += --generate-serialization --root-element-all $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -74,7 +73,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/float/test.std b/xsd/tests/cxx/tree/float/test.std index 44264c2..399e28c 100644 --- a/xsd/tests/cxx/tree/float/test.std +++ b/xsd/tests/cxx/tree/float/test.std @@ -1,68 +1,35 @@ - 0 - 1 - 1e+06 - 1e-07 - 0 1 1e+06 1e-07 - 0 - 1 - 100000000000000 - 1e-15 - 0 1 100000000000000 1e-15 - 0 - 1 - 10000 - 100000000000000 - 0.000000000000001 - 0 1 100000000000000 0.000000000000001 - 0 - 1 - 12.34 - 0.12 - 12.13 - 123.1 - 1234 - 0 - 1 - 12.34 - 0.12 - 12.13 - 123.1 - 1234 - -12.12 - -123.1 - diff --git a/xsd/tests/cxx/tree/list/ctor/driver.cxx b/xsd/tests/cxx/tree/list/ctor/driver.cxx index 81743e8..784ae01 100644 --- a/xsd/tests/cxx/tree/list/ctor/driver.cxx +++ b/xsd/tests/cxx/tree/list/ctor/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/tree/list/ctor/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test list constructors. diff --git a/xsd/tests/cxx/tree/list/ctor/makefile b/xsd/tests/cxx/tree/list/ctor/makefile index cfda43a..4115606 100644 --- a/xsd/tests/cxx/tree/list/ctor/makefile +++ b/xsd/tests/cxx/tree/list/ctor/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/list/ctor/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make @@ -27,18 +26,18 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-default-ctor --generate-from-base-ctor \ +$(gen): xsd_options += --generate-default-ctor --generate-from-base-ctor \ --generate-doxygen $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -75,7 +74,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/list/makefile b/xsd/tests/cxx/tree/list/makefile index ae6bb0a..4af3e22 100644 --- a/xsd/tests/cxx/tree/list/makefile +++ b/xsd/tests/cxx/tree/list/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/list/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/xsd/tests/cxx/tree/makefile b/xsd/tests/cxx/tree/makefile index 9b79424..7fd9f63 100644 --- a/xsd/tests/cxx/tree/makefile +++ b/xsd/tests/cxx/tree/makefile @@ -1,30 +1,32 @@ # file : tests/cxx/tree/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make -tests := \ -built-in \ -chameleon \ -comparison \ -compilation \ -complex \ -containment \ -default \ -detach \ -encoding \ -enumeration \ -float \ -list \ -name-clash \ -naming \ -polymorphism \ -prefix \ -test-template \ -types-only \ -union \ +tests := \ +any-type \ +built-in \ +chameleon \ +comparison \ +compilation \ +complex \ +containment \ +default \ +detach \ +dom-association \ +encoding \ +enumeration \ +float \ +list \ +name-clash \ +naming \ +order \ +polymorphism \ +prefix \ +test-template \ +types-only \ +union \ wildcard ifeq ($(xsd_with_ace),y) diff --git a/xsd/tests/cxx/tree/name-clash/inheritance/driver.cxx b/xsd/tests/cxx/tree/name-clash/inheritance/driver.cxx index 70e6fc6..07e0c00 100644 --- a/xsd/tests/cxx/tree/name-clash/inheritance/driver.cxx +++ b/xsd/tests/cxx/tree/name-clash/inheritance/driver.cxx @@ -1,12 +1,11 @@ // file : tests/cxx/tree/name-clash/inheritance/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test for name clashes across inheritance hierarchy. // -#include // std::auto_ptr +#include // std::auto_ptr/unique_ptr #include #include "test.hxx" @@ -25,7 +24,7 @@ main (int argc, char* argv[]) try { - auto_ptr r (root (argv[1])); + XSD_AUTO_PTR r (root (argv[1])); cout << *r << endl; } diff --git a/xsd/tests/cxx/tree/name-clash/inheritance/makefile b/xsd/tests/cxx/tree/name-clash/inheritance/makefile index b983d91..ea05693 100644 --- a/xsd/tests/cxx/tree/name-clash/inheritance/makefile +++ b/xsd/tests/cxx/tree/name-clash/inheritance/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/name-clash/inheritance/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make @@ -27,17 +26,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-ostream +$(gen): xsd_options += --generate-ostream $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -74,7 +73,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/name-clash/makefile b/xsd/tests/cxx/tree/name-clash/makefile index ef2fdf0..c9a4d0f 100644 --- a/xsd/tests/cxx/tree/name-clash/makefile +++ b/xsd/tests/cxx/tree/name-clash/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/name-clash/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/xsd/tests/cxx/tree/naming/camel/driver.cxx b/xsd/tests/cxx/tree/naming/camel/driver.cxx index 96b88d5..716a544 100644 --- a/xsd/tests/cxx/tree/naming/camel/driver.cxx +++ b/xsd/tests/cxx/tree/naming/camel/driver.cxx @@ -1,12 +1,10 @@ // file : tests/cxx/tree/naming/camel/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test camel case (upper for types, lower for functions) naming style. // -#include // std::auto_ptr #include #include @@ -29,6 +27,7 @@ main () { Gender::Value v; v = Gender::female; + XSD_UNUSED (v); } // Anonymous type. @@ -49,6 +48,8 @@ main () // { Type::FooType* p = 0; + XSD_UNUSED (p); + Type::FooOptional o; if (t.foo ().present ()) @@ -61,6 +62,7 @@ main () // { Type::BarType* p = 0; + XSD_UNUSED (p); if (t.bar () != "bar") return 1; @@ -72,9 +74,13 @@ main () // { Type::BazType* p = 0; + XSD_UNUSED (p); + Type::BazSequence s; Type::BazIterator i (s.begin ()); Type::BazConstIterator ci (s.begin ()); + XSD_UNUSED (i); + XSD_UNUSED (ci); if (t.baz () != s) return 1; @@ -88,6 +94,8 @@ main () Type::AnySequence s (t.domDocument ()); Type::AnyIterator i (s.begin ()); Type::AnyConstIterator ci (s.begin ()); + XSD_UNUSED (i); + XSD_UNUSED (ci); if (t.any () != s) return 1; @@ -112,6 +120,8 @@ main () Type::AnyAttributeSet s (t.domDocument ()); Type::AnyAttributeIterator i (s.begin ()); Type::AnyAttributeConstIterator ci (s.begin ()); + XSD_UNUSED (i); + XSD_UNUSED (ci); if (t.anyAttribute () != s) return 1; diff --git a/xsd/tests/cxx/tree/naming/camel/makefile b/xsd/tests/cxx/tree/naming/camel/makefile index e9ce149..6364196 100644 --- a/xsd/tests/cxx/tree/naming/camel/makefile +++ b/xsd/tests/cxx/tree/naming/camel/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/naming/camel/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make @@ -27,7 +26,7 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) @@ -35,7 +34,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := \ +$(gen): xsd_options += \ --type-naming ucc \ --function-naming lcc \ --generate-ostream \ @@ -45,7 +44,7 @@ $(gen): xsd_options := \ $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -82,7 +81,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/naming/java/driver.cxx b/xsd/tests/cxx/tree/naming/java/driver.cxx index 843acff..f35607a 100644 --- a/xsd/tests/cxx/tree/naming/java/driver.cxx +++ b/xsd/tests/cxx/tree/naming/java/driver.cxx @@ -1,12 +1,10 @@ // file : tests/cxx/tree/naming/java/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test Java naming style. // -#include // std::auto_ptr #include #include @@ -29,6 +27,7 @@ main () { Gender::Value v; v = Gender::female; + XSD_UNUSED (v); } // Anonymous type. @@ -49,6 +48,7 @@ main () // { Type::FooType* p = 0; + XSD_UNUSED (p); Type::FooOptional o; if (t.getFoo ().present ()) @@ -61,6 +61,7 @@ main () // { Type::BarType* p = 0; + XSD_UNUSED (p); if (t.getBar () != "bar") return 1; @@ -72,9 +73,13 @@ main () // { Type::BazType* p = 0; + XSD_UNUSED (p); + Type::BazSequence s; Type::BazIterator i (s.begin ()); Type::BazConstIterator ci (s.begin ()); + XSD_UNUSED (i); + XSD_UNUSED (ci); if (t.getBaz () != s) return 1; @@ -88,6 +93,8 @@ main () Type::AnySequence s (t.getDomDocument ()); Type::AnyIterator i (s.begin ()); Type::AnyConstIterator ci (s.begin ()); + XSD_UNUSED (i); + XSD_UNUSED (ci); if (t.getAny () != s) return 1; @@ -112,6 +119,8 @@ main () Type::AnyAttributeSet s (t.getDomDocument ()); Type::AnyAttributeIterator i (s.begin ()); Type::AnyAttributeConstIterator ci (s.begin ()); + XSD_UNUSED (i); + XSD_UNUSED (ci); if (t.getAnyAttribute () != s) return 1; diff --git a/xsd/tests/cxx/tree/naming/java/makefile b/xsd/tests/cxx/tree/naming/java/makefile index f8e7d04..83d73e1 100644 --- a/xsd/tests/cxx/tree/naming/java/makefile +++ b/xsd/tests/cxx/tree/naming/java/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/naming/java/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make @@ -27,7 +26,7 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) @@ -35,7 +34,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := \ +$(gen): xsd_options += \ --type-naming java \ --function-naming java \ --generate-ostream \ @@ -45,7 +44,7 @@ $(gen): xsd_options := \ $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -82,7 +81,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/naming/knr/driver.cxx b/xsd/tests/cxx/tree/naming/knr/driver.cxx index fff944b..5038d7b 100644 --- a/xsd/tests/cxx/tree/naming/knr/driver.cxx +++ b/xsd/tests/cxx/tree/naming/knr/driver.cxx @@ -1,12 +1,10 @@ // file : tests/cxx/tree/naming/knr/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test K&R naming style. // -#include // std::auto_ptr #include #include @@ -29,6 +27,7 @@ main () { gender::value v; v = gender::female; + XSD_UNUSED (v); } // Anonymous type. @@ -49,6 +48,8 @@ main () // { type::foo_type* p = 0; + XSD_UNUSED (p); + type::foo_optional o; if (t.foo ().present ()) @@ -61,6 +62,7 @@ main () // { type::bar_type* p = 0; + XSD_UNUSED (p); if (t.bar () != "bar") return 1; @@ -72,9 +74,13 @@ main () // { type::baz_type* p = 0; + XSD_UNUSED (p); + type::baz_sequence s; type::baz_iterator i (s.begin ()); type::baz_const_iterator ci (s.begin ()); + XSD_UNUSED (i); + XSD_UNUSED (ci); if (t.baz () != s) return 1; @@ -88,6 +94,8 @@ main () type::any_sequence s (t.dom_document ()); type::any_iterator i (s.begin ()); type::any_const_iterator ci (s.begin ()); + XSD_UNUSED (i); + XSD_UNUSED (ci); if (t.any () != s) return 1; @@ -112,6 +120,8 @@ main () type::any_attribute_set s (t.dom_document ()); type::any_attribute_iterator i (s.begin ()); type::any_attribute_const_iterator ci (s.begin ()); + XSD_UNUSED (i); + XSD_UNUSED (ci); if (t.any_attribute () != s) return 1; diff --git a/xsd/tests/cxx/tree/naming/knr/makefile b/xsd/tests/cxx/tree/naming/knr/makefile index ac9e75e..d8ecbab 100644 --- a/xsd/tests/cxx/tree/naming/knr/makefile +++ b/xsd/tests/cxx/tree/naming/knr/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/naming/knr/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make @@ -27,7 +26,7 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) @@ -35,7 +34,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := \ +$(gen): xsd_options += \ --type-naming knr \ --function-naming knr \ --generate-ostream \ @@ -45,7 +44,7 @@ $(gen): xsd_options := \ $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -82,7 +81,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/naming/makefile b/xsd/tests/cxx/tree/naming/makefile index 90bd7d3..60ac63b 100644 --- a/xsd/tests/cxx/tree/naming/makefile +++ b/xsd/tests/cxx/tree/naming/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/naming/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/xsd/tests/cxx/tree/order/driver.cxx b/xsd/tests/cxx/tree/order/driver.cxx new file mode 100644 index 0000000..01d8d9f --- /dev/null +++ b/xsd/tests/cxx/tree/order/driver.cxx @@ -0,0 +1,65 @@ +// file : tests/cxx/tree/order/driver.cxx +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC +// license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +// Test ordered type support. +// + +#include // std::auto_ptr/unique_ptr +#include +#include + +#include +#include + +#include "test.hxx" + +using namespace std; +using namespace test; +using namespace xercesc; + +int +main (int argc, char* argv[]) +{ + if (argc != 2) + { + cerr << "usage: " << argv[0] << " test.xml" << endl; + return 1; + } + + XMLPlatformUtils::Initialize (); + + try + { + XSD_AUTO_PTR r (root_ (argv[1], xml_schema::flags::dont_initialize)); + + root c (*r); + assert (c == *r); + + for (root::t1_const_iterator j (r->t1 ().begin ()); + j != r->t1 ().end (); ++j) + { + const t1_derived& d (*j); + + for (t1_derived::content_order_const_iterator i ( + d.content_order ().begin ()); i != d.content_order ().end (); ++i) + { + cout << i->id << ' ' << i->index << endl; + } + } + + xml_schema::namespace_infomap map; + + map["t"].name = "test"; + map["t1"].name = "test1"; + + root_ (cout, *r, map, "UTF-8", xml_schema::flags::dont_initialize); + } + catch (xml_schema::exception const& e) + { + cerr << e << endl; + return 1; + } + + XMLPlatformUtils::Terminate (); +} diff --git a/xsd/tests/cxx/tree/order/makefile b/xsd/tests/cxx/tree/order/makefile new file mode 100644 index 0000000..0dff0f9 --- /dev/null +++ b/xsd/tests/cxx/tree/order/makefile @@ -0,0 +1,94 @@ +# file : tests/cxx/tree/order/makefile +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make + +xsd := test.xsd +cxx := driver.cxx + +obj := $(addprefix $(out_base)/,$(cxx:.cxx=.o) $(xsd:.xsd=.o)) +dep := $(obj:.o=.o.d) + +driver := $(out_base)/driver +test := $(out_base)/.test +clean := $(out_base)/.clean + + +# Import. +# +$(call import,\ + $(scf_root)/import/libxerces-c/stub.make,\ + l: xerces_c.l,cpp-options: xerces_c.l.cpp-options) + + +# Build. +# +$(driver): $(obj) $(xerces_c.l) + +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd +$(obj) $(dep): $(xerces_c.l.cpp-options) + +genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) +gen := $(addprefix $(out_base)/,$(genf)) + +$(gen): xsd := $(out_root)/xsd/xsd +$(gen): xsd_options += --generate-serialization --generate-wildcard \ +--generate-comparison \ +--ordered-type t1_base --ordered-type t1_derived \ +--ordered-type t2_base --ordered-type t2_derived \ +--ordered-type t3_type \ +--ordered-type t4_base --ordered-type t4_derived \ +--ordered-type t5_base --ordered-type t5_derived \ +--ordered-type t6_base --ordered-type t6_derived \ +--ordered-type t7_type +$(gen): $(out_root)/xsd/xsd + +$(call include-dep,$(dep),$(obj),$(gen)) + +# Convenience alias for default target. +# +$(out_base)/: $(driver) + + +# Test. +# +$(test): driver := $(driver) +$(test): $(driver) $(src_base)/test.xml $(src_base)/output + $(call message,test $$1,$$1 $(src_base)/test.xml | diff -u $(src_base)/output -,$(driver)) + +# Clean. +# +$(clean): $(driver).o.clean \ + $(addsuffix .cxx.clean,$(obj)) \ + $(addsuffix .cxx.clean,$(dep)) \ + $(addprefix $(out_base)/,$(xsd:.xsd=.cxx.xsd.clean)) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(gen): | $(out_base)/.gitignore +$(driver): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := driver $(genf) +$(clean): $(out_base)/.gitignore.clean + +$(call include,$(bld_root)/git/gitignore.make) +endif + +# 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) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) +$(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif + + +# Dependencies. +# +$(call import,$(src_root)/xsd/makefile) diff --git a/xsd/tests/cxx/tree/order/output b/xsd/tests/cxx/tree/order/output new file mode 100644 index 0000000..73442fe --- /dev/null +++ b/xsd/tests/cxx/tree/order/output @@ -0,0 +1,92 @@ +2 0 +1 0 +1 1 +2 1 +3 0 +4 0 +3 1 +4 1 + + + + b1 + a1 + a2 + b2 + c1 + d1 + e1 + d2 + f1 + + + b1 + a1 + b2 + a2 + + + a1 + b1 + c1 + c2 + + + a1 + c1 + + + t1 + + b1 + t2 + + a1 + t3 + + b2 + t4 + + a2 + t5 + + d1 + t6 + + c1 + t7 + + + + t5a + + + t1 + + b1 + t2 + + a1 + t3 + + a2 + t4 + + b2 + t5 + + + + t6 + + + t1 + + a1 + t2 + + b1 + t3 + + + diff --git a/xsd/tests/cxx/tree/order/test.xml b/xsd/tests/cxx/tree/order/test.xml new file mode 100644 index 0000000..cd82936 --- /dev/null +++ b/xsd/tests/cxx/tree/order/test.xml @@ -0,0 +1,71 @@ + + + b1 + a1 + a2 + b2 + c1 + d1 + e1 + d2 + f1 + + + b1 + a1 + b2 + a2 + + + a1 + b1 + c1 + c2 + + + a1 + c1 + + + t1 + b1 + t2 + a1 + t3 + b2 + t4 + a2 + t5 + d1 + t6 + c1 + t7 + + + t5a + + + t1 + b1 + t2 + a1 + t3 + a2 + t4 + b2 + t5 + + + t6 + + + t1 + a1 + t2 + b1 + t3 + + diff --git a/xsd/tests/cxx/tree/order/test.xsd b/xsd/tests/cxx/tree/order/test.xsd new file mode 100644 index 0000000..c30c027 --- /dev/null +++ b/xsd/tests/cxx/tree/order/test.xsd @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xsd/tests/cxx/tree/polymorphism/comparison/driver.cxx b/xsd/tests/cxx/tree/polymorphism/comparison/driver.cxx index 5e52e70..5394991 100644 --- a/xsd/tests/cxx/tree/polymorphism/comparison/driver.cxx +++ b/xsd/tests/cxx/tree/polymorphism/comparison/driver.cxx @@ -1,12 +1,11 @@ // file : tests/cxx/tree/polymorphism/comparison/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test comparison of polymorphic object models. // -#include // std::auto_ptr +#include // std::auto_ptr/unique_ptr #include #include "test.hxx" @@ -25,7 +24,7 @@ main (int argc, char* argv[]) try { - auto_ptr r (root (argv[1])); + XSD_AUTO_PTR r (root (argv[1])); // Equals. // diff --git a/xsd/tests/cxx/tree/polymorphism/comparison/makefile b/xsd/tests/cxx/tree/polymorphism/comparison/makefile index ad2c8ec..ef3e70a 100644 --- a/xsd/tests/cxx/tree/polymorphism/comparison/makefile +++ b/xsd/tests/cxx/tree/polymorphism/comparison/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/polymorphism/comparison/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make @@ -27,18 +26,18 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-polymorphic --polymorphic-type base \ +$(gen): xsd_options += --generate-polymorphic --polymorphic-type base \ --generate-comparison $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -75,7 +74,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/polymorphism/makefile b/xsd/tests/cxx/tree/polymorphism/makefile index bca8f3f..9215e44 100644 --- a/xsd/tests/cxx/tree/polymorphism/makefile +++ b/xsd/tests/cxx/tree/polymorphism/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/polymorphism/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/xsd/tests/cxx/tree/polymorphism/ostream/driver.cxx b/xsd/tests/cxx/tree/polymorphism/ostream/driver.cxx index 216c887..bfbd2d4 100644 --- a/xsd/tests/cxx/tree/polymorphism/ostream/driver.cxx +++ b/xsd/tests/cxx/tree/polymorphism/ostream/driver.cxx @@ -1,12 +1,11 @@ // file : tests/cxx/tree/polymorphism/ostream/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test printing of polymorphic object models. // -#include // std::auto_ptr +#include // std::auto_ptr/unique_ptr #include #include "test.hxx" @@ -25,7 +24,7 @@ main (int argc, char* argv[]) try { - auto_ptr r (root (argv[1])); + XSD_AUTO_PTR r (root (argv[1])); cout << *r << endl; } catch (xml_schema::exception const& e) diff --git a/xsd/tests/cxx/tree/polymorphism/ostream/makefile b/xsd/tests/cxx/tree/polymorphism/ostream/makefile index 661ba16..76a366f 100644 --- a/xsd/tests/cxx/tree/polymorphism/ostream/makefile +++ b/xsd/tests/cxx/tree/polymorphism/ostream/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/polymorphism/ostream/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make @@ -27,18 +26,18 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-polymorphic --polymorphic-type-all \ ---generate-ostream +$(gen): xsd_options += --generate-polymorphic --polymorphic-type-all \ +--root-element root --generate-ostream $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -76,7 +75,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/polymorphism/ostream/output b/xsd/tests/cxx/tree/polymorphism/ostream/output index bf0e814..e7fbd68 100644 --- a/xsd/tests/cxx/tree/polymorphism/ostream/output +++ b/xsd/tests/cxx/tree/polymorphism/ostream/output @@ -11,3 +11,8 @@ a: a fund: 1 c: c1 c: c2 +base: +a: a +fund: 1 +d: d1 +d: d2 diff --git a/xsd/tests/cxx/tree/polymorphism/ostream/test.xml b/xsd/tests/cxx/tree/polymorphism/ostream/test.xml index 157e15c..5409d2a 100644 --- a/xsd/tests/cxx/tree/polymorphism/ostream/test.xml +++ b/xsd/tests/cxx/tree/polymorphism/ostream/test.xml @@ -1,9 +1,10 @@ - + a1 - a1b - a1c1c2 + a1b + a1c1c2 + a1d1d2 - + diff --git a/xsd/tests/cxx/tree/polymorphism/ostream/test.xsd b/xsd/tests/cxx/tree/polymorphism/ostream/test.xsd index cc1f7a8..ddeaeae 100644 --- a/xsd/tests/cxx/tree/polymorphism/ostream/test.xsd +++ b/xsd/tests/cxx/tree/polymorphism/ostream/test.xsd @@ -1,5 +1,6 @@ - + @@ -7,6 +8,7 @@ + @@ -28,9 +30,21 @@ + + + + + + + + + + + + - + diff --git a/xsd/tests/cxx/tree/polymorphism/same-type/driver.cxx b/xsd/tests/cxx/tree/polymorphism/same-type/driver.cxx index 441a742..0846b04 100644 --- a/xsd/tests/cxx/tree/polymorphism/same-type/driver.cxx +++ b/xsd/tests/cxx/tree/polymorphism/same-type/driver.cxx @@ -1,12 +1,11 @@ // file : tests/cxx/tree/polymorphism/same-type/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test substitution group and xsi:type that don't change the type. // -#include // std::auto_ptr +#include // std::auto_ptr/unique_ptr #include #include "test.hxx" @@ -25,7 +24,7 @@ main (int argc, char* argv[]) try { - auto_ptr r (root (argv[1])); + XSD_AUTO_PTR r (root (argv[1])); cout << *r << endl; } diff --git a/xsd/tests/cxx/tree/polymorphism/same-type/makefile b/xsd/tests/cxx/tree/polymorphism/same-type/makefile index c8e7bed..549f590 100644 --- a/xsd/tests/cxx/tree/polymorphism/same-type/makefile +++ b/xsd/tests/cxx/tree/polymorphism/same-type/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/polymorphism/same-type/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make @@ -27,18 +26,18 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-ostream --generate-polymorphic \ +$(gen): xsd_options += --generate-ostream --generate-polymorphic \ --root-element root $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -75,7 +74,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/prefix/driver.cxx b/xsd/tests/cxx/tree/prefix/driver.cxx index 3ce9832..244f815 100644 --- a/xsd/tests/cxx/tree/prefix/driver.cxx +++ b/xsd/tests/cxx/tree/prefix/driver.cxx @@ -1,12 +1,11 @@ // file : tests/cxx/tree/prefix/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test automatic prefix assignment. // -#include // std::auto_ptr +#include // std::auto_ptr/unique_ptr #include #include "test.hxx" @@ -25,7 +24,7 @@ main (int argc, char* argv[]) try { - auto_ptr r (root (argv[1])); + XSD_AUTO_PTR r (root (argv[1])); root (std::cout, *r); } catch (xml_schema::exception const& e) diff --git a/xsd/tests/cxx/tree/prefix/makefile b/xsd/tests/cxx/tree/prefix/makefile index 3317161..688111e 100644 --- a/xsd/tests/cxx/tree/prefix/makefile +++ b/xsd/tests/cxx/tree/prefix/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/prefix/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make @@ -27,18 +26,18 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-serialization --generate-polymorphic \ ---polymorphic-type foo\\\#base --root-element root +$(gen): xsd_options += --generate-serialization --generate-polymorphic \ +--polymorphic-type foo\#base --root-element root $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -75,7 +74,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/prefix/output b/xsd/tests/cxx/tree/prefix/output index 4f40f49..9801a23 100644 --- a/xsd/tests/cxx/tree/prefix/output +++ b/xsd/tests/cxx/tree/prefix/output @@ -1,22 +1,18 @@ - 123 - 1 2 - 1 2 - diff --git a/xsd/tests/cxx/tree/test-template/driver.cxx b/xsd/tests/cxx/tree/test-template/driver.cxx index f36cc10..f28e501 100644 --- a/xsd/tests/cxx/tree/test-template/driver.cxx +++ b/xsd/tests/cxx/tree/test-template/driver.cxx @@ -1,12 +1,11 @@ // file : tests/cxx/tree/test-template/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Insert test description here. // -#include // std::auto_ptr +#include // std::auto_ptr/unique_ptr #include #include "test.hxx" @@ -25,7 +24,7 @@ main (int argc, char* argv[]) try { - auto_ptr r (root (argv[1])); + XSD_AUTO_PTR r (root (argv[1])); cout << *r << endl; } diff --git a/xsd/tests/cxx/tree/test-template/makefile b/xsd/tests/cxx/tree/test-template/makefile index f94665a..32af96b 100644 --- a/xsd/tests/cxx/tree/test-template/makefile +++ b/xsd/tests/cxx/tree/test-template/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/test-template/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make @@ -27,17 +26,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-ostream +$(gen): xsd_options += --generate-ostream $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -74,7 +73,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/types-only/driver.cxx b/xsd/tests/cxx/tree/types-only/driver.cxx index b0caf72..8ba7500 100644 --- a/xsd/tests/cxx/tree/types-only/driver.cxx +++ b/xsd/tests/cxx/tree/types-only/driver.cxx @@ -1,13 +1,11 @@ // file : tests/cxx/tree/types-only/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test that code generated without parsing and serialization functions // still compiles. // -#include // std::auto_ptr #include #include "test.hxx" diff --git a/xsd/tests/cxx/tree/types-only/makefile b/xsd/tests/cxx/tree/types-only/makefile index 972de5a..25520a4 100644 --- a/xsd/tests/cxx/tree/types-only/makefile +++ b/xsd/tests/cxx/tree/types-only/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/types-only/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make @@ -27,17 +26,17 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --suppress-parsing +$(gen): xsd_options += --suppress-parsing $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -74,7 +73,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/union/ctor/driver.cxx b/xsd/tests/cxx/tree/union/ctor/driver.cxx index 0aa22ab..14a8565 100644 --- a/xsd/tests/cxx/tree/union/ctor/driver.cxx +++ b/xsd/tests/cxx/tree/union/ctor/driver.cxx @@ -1,6 +1,5 @@ // file : tests/cxx/tree/union/ctor/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test union constructors. diff --git a/xsd/tests/cxx/tree/union/ctor/makefile b/xsd/tests/cxx/tree/union/ctor/makefile index 234ee45..1edd762 100644 --- a/xsd/tests/cxx/tree/union/ctor/makefile +++ b/xsd/tests/cxx/tree/union/ctor/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/union/ctor/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make @@ -27,18 +26,18 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-default-ctor --generate-from-base-ctor \ +$(gen): xsd_options += --generate-default-ctor --generate-from-base-ctor \ --generate-doxygen $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -75,7 +74,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/cxx/tree/union/makefile b/xsd/tests/cxx/tree/union/makefile index 5d61aa7..59abec6 100644 --- a/xsd/tests/cxx/tree/union/makefile +++ b/xsd/tests/cxx/tree/union/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/union/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make diff --git a/xsd/tests/cxx/tree/wildcard/driver.cxx b/xsd/tests/cxx/tree/wildcard/driver.cxx index 5bd8229..e2db827 100644 --- a/xsd/tests/cxx/tree/wildcard/driver.cxx +++ b/xsd/tests/cxx/tree/wildcard/driver.cxx @@ -1,18 +1,20 @@ // file : tests/cxx/tree/wildcard/driver.cxx -// author : Boris Kolpackov -// copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +// copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC // license : GNU GPL v2 + exceptions; see accompanying LICENSE file // Test wildcard (any & anyAttribute) mapping. // -#include // std::auto_ptr +#include // std::auto_ptr/unique_ptr #include #include -#include +#include +#include + +#include "test.hxx" // Get XSD_CXX11 defined. -#include "test.hxx" +#include using namespace std; using namespace test; @@ -170,7 +172,7 @@ main (int argc, char* argv[]) // Test parsing // - auto_ptr r (root (argv[1])); + XSD_AUTO_PTR r (root (argv[1])); print (*r); // Test serialization. @@ -187,7 +189,7 @@ main (int argc, char* argv[]) // cout << iostr.str () << endl // << endl; - auto_ptr copy (root (iostr, argv[1])); + XSD_AUTO_PTR copy (root (iostr, argv[1])); assert (*copy == *r); print (*copy); diff --git a/xsd/tests/cxx/tree/wildcard/makefile b/xsd/tests/cxx/tree/wildcard/makefile index b7b114f..b86c34a 100644 --- a/xsd/tests/cxx/tree/wildcard/makefile +++ b/xsd/tests/cxx/tree/wildcard/makefile @@ -1,6 +1,5 @@ # file : tests/cxx/tree/wildcard/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2006-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2006-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make @@ -27,18 +26,18 @@ $(call import,\ # $(driver): $(obj) $(xerces_c.l) -$(obj) $(dep): cpp_options := -I$(src_root)/libxsd +$(obj) $(dep): cpp_options := -I$(out_base) -I$(src_base) -I$(src_root)/libxsd $(obj) $(dep): $(xerces_c.l.cpp-options) genf := $(xsd:.xsd=.hxx) $(xsd:.xsd=.ixx) $(xsd:.xsd=.cxx) gen := $(addprefix $(out_base)/,$(genf)) $(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options := --generate-wildcard --generate-default-ctor \ +$(gen): xsd_options += --generate-wildcard --generate-default-ctor \ --generate-from-base-ctor --generate-serialization --generate-comparison $(gen): $(out_root)/xsd/xsd -$(call include-dep,$(dep)) +$(call include-dep,$(dep),$(obj),$(gen)) # Convenience alias for default target. # @@ -75,7 +74,12 @@ endif $(call include,$(bld_root)/cxx/o-e.make) $(call include,$(bld_root)/cxx/cxx-o.make) $(call include,$(bld_root)/cxx/cxx-d.make) + +$(call include,$(bld_root)/cxx/standard.make) # cxx_standard +ifdef cxx_standard +$(gen): xsd_options += --std $(cxx_standard) $(call include,$(scf_root)/xsd/tree/xsd-cxx.make) +endif # Dependencies. diff --git a/xsd/tests/makefile b/xsd/tests/makefile index 435bb3a..661571b 100644 --- a/xsd/tests/makefile +++ b/xsd/tests/makefile @@ -1,6 +1,5 @@ # file : tests/makefile -# author : Boris Kolpackov -# copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +# copyright : Copyright (c) 2005-2014 Code Synthesis Tools CC # license : GNU GPL v2 + exceptions; see accompanying LICENSE file include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make -- cgit v1.2.3