diff options
Diffstat (limited to 'xsd/tests')
177 files changed, 2505 insertions, 658 deletions
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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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<xml_schema::buffer> v) + base64_binary (XSD_AUTO_PTR<xml_schema::buffer> v) { std::string tmp (v->data (), v->size ()); cout << "'" << tmp << "'" << endl; } virtual void - hex_binary (std::auto_ptr<xml_schema::buffer> v) + hex_binary (XSD_AUTO_PTR<xml_schema::buffer> 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -# 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 <string> +#include <iostream> + +#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 <iostream> + +#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 @@ +<?xml version="1.0" encoding="utf-8"?> +<root xmlns="test" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="test test.xsd"> + <recursive> + <value-a> + <constant>1</constant> + </value-a> + <recursive> + <value-b> + <constant>2</constant> + </value-b> + </recursive> + </recursive> +</root> 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 @@ +<?xml version="1.0"?> +<schema xmlns="http://www.w3.org/2001/XMLSchema" + xmlns:t="test" + targetNamespace="test" + elementFormDefault="qualified"> + + <element name="root" type="t:root"/> + <complexType name="root"> + <sequence> + <element ref="t:expression" minOccurs="0" maxOccurs="unbounded"/> + </sequence> + </complexType> + + <element name="expression" type="t:expression" abstract="true"/> + <complexType name="expression" abstract="true"/> + + <element name="recursive" type="t:recursive" substitutionGroup="t:expression"/> + <complexType name="recursive"> + <complexContent> + <extension base="t:expression"> + <sequence minOccurs="0" maxOccurs="unbounded"> + <element ref="t:expression"/> + </sequence> + </extension> + </complexContent> + </complexType> + + <element name="value" type="t:value" abstract="true" substitutionGroup="t:expression"/> + <complexType name="value" abstract="true"> + <complexContent> + <extension base="t:expression"> + <sequence> + <element name="constant" type="int"/> + </sequence> + </extension> + </complexContent> + </complexType> + + <element name="value-a" type="t:value-a" substitutionGroup="t:expression"/> + <complexType name="value-a"> + <complexContent> + <extension base="t:value"/> + </complexContent> + </complexType> + + <element name="value-b" type="t:value-b" substitutionGroup="t:expression"/> + <complexType name="value-b"> + <complexContent> + <extension base="t:value"/> + </complexContent> + </complexType> + +</schema> 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <memory> // std::auto_ptr/unique_ptr +#include <utility> // std::move +#include <sstream> +#include <iostream> + +#include <xercesc/dom/DOM.hpp> +#include <xercesc/util/PlatformUtils.hpp> + +#include "test.hxx" // Get XSD_CXX11 defined. + +#include <xsd/cxx/xml/string.hxx> + +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<type> 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<xml_schema::type> 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<type> 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 + +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<t:root xmlns:t="test" a="any simple content" xmlns:o="other" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="test test.xsd"> + <t/> + <t x="x"/> + <t>any</t> + <t x="x">any</t> + <t o:y="y" x="x"> + <n1> + <n2>nested 1</n2> + <n2>nested 2</n2> + </n1> + <o:n2 o:x="x">more</o:n2> + </t><t x="x"> + <n1>mi + <n2>nested 1</n2>x + <n2>nested 2</n2>ed + </n1>content + </t> + <t x="foo">data</t> + <t x="foo">data</t> + <s/> + <s>simple</s> + <s>baz</s> + <l>one two three</l> +</t:root> + + +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<t:root xmlns:t="test" a="any simple content" xmlns:o="other" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="test test.xsd"> + <t/> + <t x="x"/> + <t>any</t> + <t x="x">any</t> + <t o:y="y" x="x"> + <n1> + <n2>nested 1</n2> + <n2>nested 2</n2> + </n1> + <o:n2 o:x="x">more</o:n2> + </t><t x="x"> + <n1>mi + + <n2>nested 1</n2>x + + <n2>nested 2</n2>ed + + </n1>content + + </t> + <t x="foo">data</t> + <t x="foo">data</t> + <s/> + <s>simple</s> + <s>baz</s> + <l>one two three</l> +</t:root> + + 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 @@ +<t:root xmlns:t="test" + xmlns:o="other" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="test test.xsd" + + a="any simple content"> + + <t/> + <t x="x"/> + <t>any</t> + <t x="x">any</t> + <t x="x" o:y="y"> + <n1> + <n2>nested 1</n2> + <n2>nested 2</n2> + </n1> + <o:n2 o:x="x">more</o:n2> + </t> + <t x="x"><n1>mi<n2>nested 1</n2>x<n2>nested 2</n2>ed</n1>content</t> + + <s/> + <s>simple</s> + + <l>one two three</l> + +</t:root> 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 @@ +<?xml version="1.0"?> +<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:t="test" targetNamespace="test"> + + <simpleType name="any-list"> + <!--Not allowed? list itemType="anySimpleType"/--> + <list itemType="string"/> + </simpleType> + + <complexType name="type"> + <sequence> + <element name="t" type="anyType" maxOccurs="unbounded"/> + <element name="s" type="anySimpleType" maxOccurs="unbounded"/> + <element name="l" type="t:any-list" maxOccurs="unbounded"/> + </sequence> + <attribute name="a" type="anySimpleType" default="default value"/> + </complexType> + + <element name="root" type="t:type"/> +</schema> 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 <boris@codesynthesis.com> -// 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 <memory> // std::auto_ptr +#include <memory> // std::auto_ptr/unique_ptr #include <cassert> #include <iostream> @@ -26,7 +25,7 @@ main (int argc, char* argv[]) try { - auto_ptr<type> r (root (argv[1])); + XSD_AUTO_PTR<type> 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<ACE_InputCDR> icdr (ace_icdr); - auto_ptr<type> c (new type (icdr)); + XSD_AUTO_PTR<type> 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 <boris@codesynthesis.com> -# 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 @@ <t:root xmlns:t="test" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="test test.xsd"> + xsi:schemaLocation="test test.xsd" + any_simple_type_attr="any simple content"> <list>1 2 3</list> @@ -87,5 +88,6 @@ <year_month>2001-11+02:00</year_month> <time>21:32:52+02:00</time> + <any_simple_type>any simple content in element</any_simple_type> </t:root> 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 @@ <element name="year" type="gYear"/> <element name="year_month" type="gYearMonth"/> <element name="time" type="time"/> + + <element name="any_simple_type" type="anySimpleType"/> </sequence> + <attribute name="any_simple_type_attr" type="anySimpleType" use="required"/> </complexType> <element name="root" type="t:type"/> 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <memory> // std::auto_ptr +#include <memory> // std::auto_ptr/unique_ptr #include <cassert> #include <iostream> #include <typeinfo> +#include <ace/Log_Msg.h> // ACE_HEX_DUMP + #include "test.hxx" using namespace std; @@ -27,7 +28,7 @@ main (int argc, char* argv[]) try { - auto_ptr<type> r (root (argv[1])); + XSD_AUTO_PTR<type> r (root (argv[1])); // Save to a CDR stream. // @@ -35,11 +36,24 @@ main (int argc, char* argv[]) xml_schema::ostream<ACE_OutputCDR> 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<ACE_InputCDR> icdr (ace_icdr); - auto_ptr<type> c (new type (icdr)); + XSD_AUTO_PTR<type> 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <memory> // std::auto_ptr +#include <memory> // std::auto_ptr/unique_ptr #include <cstring> // std::memcpy #include <cassert> #include <iostream> @@ -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<xml_schema::buffer*> (p)); - std::size_t size (dst->size ()); + size_t n (static_cast<size_t> (in)), size (dst->size ()); dst->size (size + n); memcpy (dst->data () + size, buf, n); - return n; + return static_cast<int> (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<underflow_info*> (p)); - std::size_t size (ui->buf->size () - ui->pos); + size_t n (static_cast<size_t> (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<int> (n); } int @@ -59,7 +58,7 @@ main (int argc, char* argv[]) try { - auto_ptr<type> r (root (argv[1])); + XSD_AUTO_PTR<type> 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<XDR> ixdr (xdr); - auto_ptr<type> c (new type (ixdr)); + XSD_AUTO_PTR<type> 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 <boris@codesynthesis.com> -# 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 @@ <t:root xmlns:t="test" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="test test.xsd"> + xsi:schemaLocation="test test.xsd" + any_simple_type_attr="any simple content"> <list>1 2 3</list> @@ -87,5 +88,6 @@ <year_month>2001-11+02:00</year_month> <time>21:32:52+02:00</time> + <any_simple_type>any simple content in element</any_simple_type> </t:root> 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 @@ <element name="year" type="gYear"/> <element name="year_month" type="gYearMonth"/> <element name="time" type="time"/> + + <element name="any_simple_type" type="anySimpleType"/> </sequence> + <attribute name="any_simple_type_attr" type="anySimpleType" use="required"/> </complexType> <element name="root" type="t:type"/> 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 <boris@codesynthesis.com> -// 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 <memory> // std::auto_ptr +#include <memory> // std::auto_ptr/unique_ptr #include <sstream> #include <iostream> @@ -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<xmlns::test::Elements> elements (xmlns::test::elements (argv[1])); + XSD_AUTO_PTR<xmlns::test::Elements> elements ( + xmlns::test::elements (argv[1])); - auto_ptr<xmlns::test::Attributes> attributes ( + XSD_AUTO_PTR<xmlns::test::Attributes> attributes ( xmlns::test::attributes (argv[2])); - auto_ptr<xmlns::test::Inherited> inherited ( + XSD_AUTO_PTR<xmlns::test::Inherited> 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<xmlns::test::Elements> elements1 (xmlns::test::elements (istr)); + XSD_AUTO_PTR<xmlns::test::Elements> 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<xmlns::test::Attributes> attributes1 ( + XSD_AUTO_PTR<xmlns::test::Attributes> 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<xmlns::test::Inherited> inherited1 ( + XSD_AUTO_PTR<xmlns::test::Inherited> 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <memory> // std::auto_ptr +#include <memory> // std::auto_ptr/unique_ptr #include <iostream> #include "includer.hxx" @@ -25,7 +24,7 @@ main (int argc, char* argv[]) try { - auto_ptr<root_t> r (root (argv[1])); + XSD_AUTO_PTR<root_t> 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <memory> // std::auto_ptr +#include <memory> // std::auto_ptr/unique_ptr #include <iostream> #include "test.hxx" @@ -25,7 +24,7 @@ main (int argc, char* argv[]) try { - auto_ptr<type> r (root (argv[1])); + XSD_AUTO_PTR<type> 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <memory> // std::auto_ptr #include <iostream> #include "test.hxx" @@ -15,7 +13,7 @@ using namespace std; using namespace test; -template class xsd::cxx::tree::simple_type<xml_schema::type>; +template class xsd::cxx::tree::simple_type<char, xml_schema::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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <utility> // 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<e_complex_type> c2 (new e_complex_type ("bar")); - e_base b2 (1, "foo", c2); + XSD_AUTO_PTR<e_complex_type> c2 (new e_complex_type ("bar")); + e_base b2 (1, "foo", XSD_MOVE (c2)); - auto_ptr<e_simple_type> s3 (new e_simple_type ("foo")); - auto_ptr<e_complex_type> c3 (new e_complex_type ("bar")); - e_base b3 (1, s3, c3); + XSD_AUTO_PTR<e_simple_type> s3 (new e_simple_type ("foo")); + XSD_AUTO_PTR<e_complex_type> 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<e_complex_type> c2a (new e_complex_type ("bar")); - auto_ptr<e_complex_type> c2b (new e_complex_type ("biz")); - e_derived d2 (1, "foo", c2a, true, "baz", c2b); - - auto_ptr<e_simple_type> s3a (new e_simple_type ("foo")); - auto_ptr<xml_schema::string> s3b (new xml_schema::string ("baz")); - auto_ptr<e_complex_type> c3a (new e_complex_type ("bar")); - auto_ptr<e_complex_type> c3b (new e_complex_type ("biz")); - e_derived d3 (1, s3a, c3a, true, s3b, c3b); + XSD_AUTO_PTR<e_complex_type> c2a (new e_complex_type ("bar")); + XSD_AUTO_PTR<e_complex_type> c2b (new e_complex_type ("biz")); + e_derived d2 (1, "foo", XSD_MOVE (c2a), true, "baz", XSD_MOVE (c2b)); + + XSD_AUTO_PTR<e_simple_type> s3a (new e_simple_type ("foo")); + XSD_AUTO_PTR<xml_schema::string> s3b (new xml_schema::string ("baz")); + XSD_AUTO_PTR<e_complex_type> c3a (new e_complex_type ("bar")); + XSD_AUTO_PTR<e_complex_type> 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<f_complex_type> c2 (new f_complex_type ("bar")); - f_type f2 (1, "foo", c2); + XSD_AUTO_PTR<f_complex_type> c2 (new f_complex_type ("bar")); + f_type f2 (1, "foo", XSD_MOVE (c2)); - auto_ptr<f_simple_type> s3 (new f_simple_type ("foo")); - auto_ptr<f_complex_type> c3 (new f_complex_type ("bar")); - f_type f3 (1, s3, c3); + XSD_AUTO_PTR<f_simple_type> s3 (new f_simple_type ("foo")); + XSD_AUTO_PTR<f_complex_type> 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <memory> // std::auto_ptr +#include <memory> // std::auto_ptr/unique_ptr #include <cassert> #include "test.hxx" +#ifdef XSD_CXX11 +# include <utility> // 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<inner> i (new inner ()); + XSD_AUTO_PTR<inner> 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<inner> i (new inner ()); + XSD_AUTO_PTR<inner> 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<xml_schema::id> id (new xml_schema::id ("foo")); + XSD_AUTO_PTR<xml_schema::id> 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_ex> id (new id_ex ("foo")); + XSD_AUTO_PTR<id_ex> 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<ids> ic (new ids); + XSD_AUTO_PTR<ids> ic (new ids); ic->id ().push_back (i1); ic->id ().push_back (i2); - auto_ptr<xml_schema::idrefs> r1 (new xml_schema::idrefs); + XSD_AUTO_PTR<xml_schema::idrefs> r1 (new xml_schema::idrefs); r1->push_back (xml_schema::idref ("a")); r1->push_back (xml_schema::idref ("b")); - auto_ptr<idref_list> r2 (new idref_list); + XSD_AUTO_PTR<idref_list> r2 (new idref_list); r2->push_back (xml_schema::idref ("a")); r2->push_back (xml_schema::idref ("b")); - auto_ptr<idrefs1> rc1 (new idrefs1); - auto_ptr<idrefs2> rc2 (new idrefs2); + XSD_AUTO_PTR<idrefs1> rc1 (new idrefs1); + XSD_AUTO_PTR<idrefs2> 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <memory> // std::auto_ptr +#include <memory> // std::auto_ptr/unique_ptr #include <iostream> #include "test.hxx" @@ -25,7 +24,7 @@ main (int argc, char* argv[]) try { - auto_ptr<type> r (root (argv[1], xml_schema::flags::dont_validate)); + XSD_AUTO_PTR<type> 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 <boris@codesynthesis.com> -# 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 @@ <?xml version="1.0" encoding="UTF-8" standalone="no" ?> <t:root xmlns:t="test" base64_bin1="" base64_bin2="YmFzZTY0IGJpbmFyeQ==
" bool1="true" bool2="true" bool3="false" bool4="false" byte="-99" decimal1="1.12345" decimal2="-0.456" double1="1.12345" double2="1123.45" double3="-0.00012345" double4="NaN" double5="-INF" fix1="123" fix2="123" fix3="abc" fix4="abc" fix5="aaa bbb ccc" fix6="aaa bbb ccc" float1="1.123" float2="1123" float3="-0.000123" float4="NaN" float5="-INF" hex_bin1="" hex_bin2="6865782052696E617279" id="this" idref="this" idrefs="this" int="-99999" integer="-99999" language="en-us" long="-99999" ncname="abcd" ninteger="-99999" nmtoken="ab:cd" nmtokens1="a:b efg aaa" nmtokens2="abc" nninteger="99999" npinteger="-99999" nstring=" a b " pinteger="99999" qname1="foo" qname2="t:bar" short="-999" string1="" string2=" a b " token="a b" ubyte="99" uint="99999" ulong="99999" uri="http://example.com" ushort="999"> - <union a="abc"/> - <list a="123 345 678" b="ab cd ef" c="abc" d="abc def"/> - <simple a="123" b="abc" c="123" d="abc" e="abc" f="abc 123"/> - <date a="2009-03-31" b="2009-03-31Z" c="2009-03-31Z" d="2009-03-31Z" e="2009-03-31+12:30" f="2009-03-31-12:30" g="2002009-03-31-12:30"/> - <time a="12:03:45" b="12:03:45.123Z" c="12:03:05.123Z" d="12:03:45.123Z" e="12:03:45.123+12:30" f="12:03:45-12:30"/> - <date-time a="2009-03-31T12:03:45" b="2009-03-31T12:03:45.123Z" c="2002009-03-31T12:03:05.123-12:30"/> - <duration a="P100Y" b="P100M" c="P100D" d="PT12H" e="PT12M" f="PT12.123S" g="-P100Y10M20DT12H12M1.123S"/> - <day a="---02" b="---22Z" c="---22-12:30"/> - <month a="--02" b="--12Z" c="--12+12:30"/> - <year a="2009" b="-2002009Z" c="2009-12:30"/> - <month-day a="--02-02" b="--12-22Z" c="--12-22+12:30"/> - <year-month a="2009-02" b="-2002009-12Z" c="2009-12-12:30"/> - </t:root> 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <memory> // std::auto_ptr +#include <memory> // std::auto_ptr/unique_ptr #include <iostream> #include "test.hxx" @@ -25,7 +24,7 @@ main (int argc, char* argv[]) try { - auto_ptr<type> r (root (argv[1], xml_schema::flags::dont_validate)); + XSD_AUTO_PTR<type> 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 <boris@codesynthesis.com> -# 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 <?xml version="1.0" encoding="UTF-8" standalone="no" ?> <t:root xmlns:t="test"> - <derived q1="1" q2="2"> <a>a</a> </derived> - </t:root> 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 <boris@codesynthesis.com> -// 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 <memory> // std::auto_ptr +#include <memory> // std::auto_ptr/unique_ptr #include <cassert> #include "test.hxx" +#ifdef XSD_CXX11 +# include <utility> // 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<subtree> p (m.detach_one ()); + XSD_AUTO_PTR<subtree> 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 <boris@codesynthesis.com> -# 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 <istream> + +#include <xercesc/dom/DOM.hpp> +#include <xercesc/util/XMLUniDefs.hpp> // chLatin_* +#include <xercesc/framework/Wrapper4InputSource.hpp> + +#include <xsd/cxx/xml/sax/std-input-source.hxx> +#include <xsd/cxx/xml/dom/bits/error-handler-proxy.hxx> + +#include <xsd/cxx/tree/exceptions.hxx> +#include <xsd/cxx/tree/error-handler.hxx> + +using namespace xercesc; +namespace xml = xsd::cxx::xml; +namespace tree = xsd::cxx::tree; + +XSD_DOM_AUTO_PTR<DOMDocument> +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<DOMLSParser> 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<char> eh; + xml::dom::bits::error_handler_proxy<char> 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<DOMDocument> doc (parser->parse (&wrap)); + + eh.throw_if_failed<tree::parsing<char> > (); + + 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 <string> +#include <iosfwd> + +#include <xercesc/dom/DOMDocument.hpp> + +#include <xsd/cxx/xml/dom/auto-ptr.hxx> + +// 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<xercesc::DOMDocument> +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 <memory> // std::auto_ptr/unique_ptr +#include <fstream> +#include <iostream> + +#include <xercesc/dom/DOM.hpp> + +#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<DOMDocument> doc (parse (ifs, argv[1], true)); + ptr = doc.get (); + unique_ptr<type> r ( + root (std::move (doc), + xml_schema::flags::keep_dom | xml_schema::flags::own_dom)); +#else + xml_schema::dom::auto_ptr<DOMDocument> doc (parse (ifs, argv[1], true)); + ptr = doc.get (); + auto_ptr<type> 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 --- /dev/null +++ b/xsd/tests/cxx/tree/dom-association/output 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 @@ +<t:root xmlns:t="test" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="test test.xsd"> + + <a>a</a> + +</t:root> 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 @@ +<?xml version="1.0"?> +<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:t="test" targetNamespace="test"> + + <complexType name="type"> + <sequence> + <element name="a" type="string"/> + </sequence> + </complexType> + + <element name="root" type="t:type"/> + +</schema> 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 <boris@codesynthesis.com> -// 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 <memory> // std::auto_ptr +#include <memory> // std::auto_ptr/unique_ptr #include <fstream> #include <iostream> @@ -36,7 +35,7 @@ main (int argc, char* argv[]) } xsd::cxx::xml::char_transcoder::unrep_char ('?'); - auto_ptr<type> r (root (argv[1])); + XSD_AUTO_PTR<type> 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 <boris@codesynthesis.com> -# 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 @@ <?xml version="1.0" encoding="ISO-8859-1" standalone="no" ?> <t:root xmlns:t="test"> - <a>abc</a> - <a>æ</a> - <a>¢£¤¥</a> - <a>???</a> - <b>abc</b> - <b>aâc</b> - <b>âòbc</b> - </t:root> 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 <boris@codesynthesis.com> -// 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 <memory> // std::auto_ptr +#include <memory> // std::auto_ptr/unique_ptr #include <fstream> #include <iostream> @@ -27,7 +26,7 @@ main (int argc, char* argv[]) try { - auto_ptr<type> r (root (argv[1])); + XSD_AUTO_PTR<type> 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 <boris@codesynthesis.com> -# 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 @@ <?xml version="1.0" encoding="UTF-8" standalone="no" ?> <t:root xmlns:t="test"> - <a>abcd</a> - </t:root> 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <memory> // std::auto_ptr +#include <memory> // std::auto_ptr/unique_ptr #include <fstream> #include <iostream> @@ -26,7 +25,7 @@ main (int argc, char* argv[]) try { - auto_ptr<type> r (root (argv[1])); + XSD_AUTO_PTR<type> 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 <boris@codesynthesis.com> -# 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 Binary files differindex 328fe6d..ffce337 100644 --- a/xsd/tests/cxx/tree/encoding/char/utf-8/test.std +++ b/xsd/tests/cxx/tree/encoding/char/utf-8/test.std 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <memory> // std::auto_ptr +#include <memory> // std::auto_ptr/unique_ptr #include <fstream> #include <iostream> @@ -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<type> r (root (ifs, xml_schema::flags::dont_validate)); + XSD_AUTO_PTR<type> 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 <boris@codesynthesis.com> -# 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 Binary files differindex 93d4561..815ba6c 100644 --- a/xsd/tests/cxx/tree/encoding/wchar/test.std +++ b/xsd/tests/cxx/tree/encoding/wchar/test.std 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <memory> // std::auto_ptr +#include <memory> // std::auto_ptr/unique_ptr +#include <cassert> #include <iostream> #include "test.hxx" @@ -25,7 +25,7 @@ main (int argc, char* argv[]) try { - auto_ptr<top_bottom> r (root (argv[1])); + XSD_AUTO_PTR<top_bottom> 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <memory> // std::auto_ptr +#include <memory> // std::auto_ptr/unique_ptr #include <iostream> #include "test.hxx" @@ -26,7 +25,7 @@ main (int argc, char* argv[]) try { - auto_ptr<type> r (root (argv[1])); + XSD_AUTO_PTR<type> 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 <boris@codesynthesis.com> -# 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 @@ <?xml version="1.0" encoding="UTF-8" standalone="no" ?> <t:root xmlns:t="test" de="0" do="0" f="0" s="12.13"> - <float>0</float> - <float>1</float> - <float>1e+06</float> - <float>1e-07</float> - <float-list>0 1 1e+06 1e-07</float-list> - <double>0</double> - <double>1</double> - <double>100000000000000</double> - <double>1e-15</double> - <double-list>0 1 100000000000000 1e-15</double-list> - <decimal>0</decimal> - <decimal>1</decimal> - <decimal>10000</decimal> - <decimal>100000000000000</decimal> - <decimal>0.000000000000001</decimal> - <decimal-list>0 1 100000000000000 0.000000000000001</decimal-list> - <simple>0</simple> - <simple>1</simple> - <simple>12.34</simple> - <simple>0.12</simple> - <simple>12.13</simple> - <simple>123.1</simple> - <simple>1234</simple> - <complex>0</complex> - <complex>1</complex> - <complex>12.34</complex> - <complex>0.12</complex> - <complex>12.13</complex> - <complex>123.1</complex> - <complex>1234</complex> - <complex>-12.12</complex> - <complex>-123.1</complex> - </t:root> 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <memory> // std::auto_ptr +#include <memory> // std::auto_ptr/unique_ptr #include <iostream> #include "test.hxx" @@ -25,7 +24,7 @@ main (int argc, char* argv[]) try { - auto_ptr<derived> r (root (argv[1])); + XSD_AUTO_PTR<derived> 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <memory> // std::auto_ptr #include <sstream> #include <iostream> @@ -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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <memory> // std::auto_ptr #include <sstream> #include <iostream> @@ -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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <memory> // std::auto_ptr #include <sstream> #include <iostream> @@ -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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -# 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 <memory> // std::auto_ptr/unique_ptr +#include <cassert> +#include <iostream> + +#include <xercesc/dom/DOM.hpp> +#include <xercesc/util/PlatformUtils.hpp> + +#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<root> 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 +<?xml version="1.0" encoding="UTF-8" standalone="no" ?> +<t:root xmlns:t="test" xmlns:t1="test1"> + <t1> + <b>b1</b> + <a>a1</a> + <a>a2</a> + <b>b2</b> + <c>c1</c> + <d>d1</d> + <t1:e>e1</t1:e> + <d>d2</d> + <t1:f>f1</t1:f> + </t1> + <t2> + <b>b1</b> + <a>a1</a> + <b>b2</b> + <a>a2</a> + </t2> + <t3> + <a>a1</a> + <b>b1</b> + <c>c1</c> + <c>c2</c> + </t3> + <t3> + <a>a1</a> + <c>c1</c> + </t3> + <t4> + t1 + + <b>b1</b> + t2 + + <a>a1</a> + t3 + + <b>b2</b> + t4 + + <a>a2</a> + t5 + + <t1:d>d1</t1:d> + t6 + + <c>c1</c> + t7 + + </t4> + <t5a> + t5a + </t5a> + <t5b> + t1 + + <b>b1</b> + t2 + + <a>a1</a> + t3 + + <a>a2</a> + t4 + + <b>b2</b> + t5 + + </t5b> + <t6> + t6 + </t6> + <t7> + t1 + + <t1:a>a1</t1:a> + t2 + + <t1:b>b1</t1:b> + t3 + + </t7> +</t:root> 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 @@ +<t:root xmlns:t="test" + xmlns:t1="test1" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="test test.xsd"> + <t1> + <b>b1</b> + <a>a1</a> + <a>a2</a> + <b>b2</b> + <c>c1</c> + <d>d1</d> + <t1:e>e1</t1:e> + <d>d2</d> + <t1:f>f1</t1:f> + </t1> + <t2> + <b>b1</b> + <a>a1</a> + <b>b2</b> + <a>a2</a> + </t2> + <t3> + <a>a1</a> + <b>b1</b> + <c>c1</c> + <c>c2</c> + </t3> + <t3> + <a>a1</a> + <c>c1</c> + </t3> + <t4> + t1 + <b>b1</b> + t2 + <a>a1</a> + t3 + <b>b2</b> + t4 + <a>a2</a> + t5 + <t1:d>d1</t1:d> + t6 + <c>c1</c> + t7 + </t4> + <t5a> + t5a + </t5a> + <t5b> + t1 + <b>b1</b> + t2 + <a>a1</a> + t3 + <a>a2</a> + t4 + <b>b2</b> + t5 + </t5b> + <t6> + t6 + </t6> + <t7> + t1 + <t1:a>a1</t1:a> + t2 + <t1:b>b1</t1:b> + t3 + </t7> +</t:root> 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 @@ +<?xml version="1.0"?> +<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:t="test" targetNamespace="test"> + + <!-- Test 1: general, with non-ordered intermediate. --> + + <complexType name="t1_base"> + <choice minOccurs="0" maxOccurs="unbounded"> + <element name="a" type="string"/> + <element name="b" type="string"/> + </choice> + </complexType> + + <complexType name="t1_interm"> + <complexContent> + <extension base="t:t1_base"> + <sequence> + <element name="c" type="string" minOccurs="0" maxOccurs="unbounded"/> + </sequence> + </extension> + </complexContent> + </complexType> + + <complexType name="t1_derived"> + <complexContent> + <extension base="t:t1_interm"> + <choice minOccurs="0" maxOccurs="unbounded"> + <element name="d" type="string"/> + <any namespace="##other" processContents="lax"/> + </choice> + </extension> + </complexContent> + </complexType> + + <!-- Test 2: empty base. --> + + <complexType name="t2_base"/> + + <complexType name="t2_derived"> + <complexContent> + <extension base="t:t2_base"> + <choice minOccurs="0" maxOccurs="unbounded"> + <element name="a" type="string"/> + <element name="b" type="string"/> + </choice> + </extension> + </complexContent> + </complexType> + + <!-- Test 3: element cardinalities. --> + + <complexType name="t3_type"> + <sequence> + <element name="a" type="string"/> + <element name="b" type="string" minOccurs="0"/> + <element name="c" type="string" maxOccurs="unbounded"/> + </sequence> + </complexType> + + + <!-- Test 4: mixed content, general. --> + + <complexType name="t4_base" mixed="true"> + <choice minOccurs="0" maxOccurs="unbounded"> + <element name="a" type="string"/> + <element name="b" type="string"/> + </choice> + </complexType> + + <complexType name="t4_derived"> + <complexContent mixed="true"> + <extension base="t:t4_base"> + <choice minOccurs="0" maxOccurs="unbounded"> + <element name="c" type="string"/> + <any namespace="##other" processContents="lax"/> + </choice> + </extension> + </complexContent> + </complexType> + + <!-- Test 5: mixed content, empty base. --> + + <complexType name="t5_base" mixed="true"/> + + <complexType name="t5_derived"> + <complexContent mixed="true"> + <extension base="t:t5_base"> + <choice minOccurs="0" maxOccurs="unbounded"> + <element name="a" type="string"/> + <element name="b" type="string"/> + </choice> + </extension> + </complexContent> + </complexType> + + <!-- Test 6: mixed content, empty base and derived. --> + + <complexType name="t6_base" mixed="true"/> + + <complexType name="t6_derived"> + <complexContent mixed="true"> + <extension base="t:t6_base"/> + </complexContent> + </complexType> + + <!-- Test 7: mixed content wildcard only. --> + + <complexType name="t7_type" mixed="true"> + <sequence> + <any namespace="##other" processContents="lax" maxOccurs="unbounded"/> + </sequence> + </complexType> + + <!-- Root --> + + <complexType name="root"> + <sequence> + <element name="t1" type="t:t1_derived" maxOccurs="unbounded"/> + <element name="t2" type="t:t2_derived" maxOccurs="unbounded"/> + <element name="t3" type="t:t3_type" maxOccurs="unbounded"/> + <element name="t4" type="t:t4_derived" maxOccurs="unbounded"/> + <element name="t5a" type="t:t5_base" maxOccurs="unbounded"/> + <element name="t5b" type="t:t5_derived" maxOccurs="unbounded"/> + <element name="t6" type="t:t6_derived" maxOccurs="unbounded"/> + <element name="t7" type="t:t7_type" maxOccurs="unbounded"/> + </sequence> + </complexType> + + <element name="root" type="t:root"/> + +</schema> 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 <boris@codesynthesis.com> -// 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 <memory> // std::auto_ptr +#include <memory> // std::auto_ptr/unique_ptr #include <iostream> #include "test.hxx" @@ -25,7 +24,7 @@ main (int argc, char* argv[]) try { - auto_ptr<type> r (root (argv[1])); + XSD_AUTO_PTR<type> 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <memory> // std::auto_ptr +#include <memory> // std::auto_ptr/unique_ptr #include <iostream> #include "test.hxx" @@ -25,7 +24,7 @@ main (int argc, char* argv[]) try { - auto_ptr<type> r (root (argv[1])); + XSD_AUTO_PTR<type> 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 <boris@codesynthesis.com> -# 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 @@ -<t:root xmlns:t="test" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="test test.xsd"> +<root xmlns="test" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="test test.xsd"> <base><a>a</a><fund>1</fund></base> - <base xsi:type="t:derived1"><a>a</a><fund>1</fund><b>b</b></base> - <base xsi:type="t:derived2"><a>a</a><fund>1</fund><c>c1</c><c>c2</c></base> + <base xsi:type="derived1"><a>a</a><fund>1</fund><b>b</b></base> + <base xsi:type="derived2"><a>a</a><fund>1</fund><c>c1</c><c>c2</c></base> + <derived3><a>a</a><fund>1</fund><d>d1</d><d>d2</d></derived3> -</t:root> +</root> 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 @@ <?xml version="1.0"?> -<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:t="test" targetNamespace="test"> +<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:t="test" + targetNamespace="test" elementFormDefault="qualified"> <complexType name="base"> <sequence> @@ -7,6 +8,7 @@ <element name="fund" type="int"/> </sequence> </complexType> + <element name="base" type="t:base"/> <complexType name="derived1"> <complexContent> @@ -28,9 +30,21 @@ </complexContent> </complexType> + <element name="derived3" substitutionGroup="t:base"> + <complexType> + <complexContent> + <extension base="t:base"> + <sequence> + <element name="d" type="string" maxOccurs="unbounded"/> + </sequence> + </extension> + </complexContent> + </complexType> + </element> + <complexType name="type"> <sequence> - <element name="base" type="t:base" maxOccurs="unbounded"/> + <element ref="t:base" maxOccurs="unbounded"/> </sequence> </complexType> 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 <boris@codesynthesis.com> -// 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 <memory> // std::auto_ptr +#include <memory> // std::auto_ptr/unique_ptr #include <iostream> #include "test.hxx" @@ -25,7 +24,7 @@ main (int argc, char* argv[]) try { - auto_ptr<type> r (root (argv[1])); + XSD_AUTO_PTR<type> 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <memory> // std::auto_ptr +#include <memory> // std::auto_ptr/unique_ptr #include <iostream> #include "test.hxx" @@ -25,7 +24,7 @@ main (int argc, char* argv[]) try { - auto_ptr<type> r (root (argv[1])); + XSD_AUTO_PTR<type> 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 <boris@codesynthesis.com> -# 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 @@ <?xml version="1.0" encoding="UTF-8" standalone="no" ?> <p1:root xmlns:p1="test"> - <a xmlns:p3="bar" p3:abar="456" xmlns:p2="foo"> <p2:efoo>123</p2:efoo> </a> - <b xmlns:p2="bar"> <p2:derived> <x>1</x> <y>2</y> </p2:derived> </b> - <c xmlns:p2="foo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <p2:base xmlns:p3="bar" xsi:type="p3:derived2"> <x>1</x> <z>2</z> </p2:base> </c> - </p1:root> 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 <boris@codesynthesis.com> -// 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 <memory> // std::auto_ptr +#include <memory> // std::auto_ptr/unique_ptr #include <iostream> #include "test.hxx" @@ -25,7 +24,7 @@ main (int argc, char* argv[]) try { - auto_ptr<type> r (root (argv[1])); + XSD_AUTO_PTR<type> 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <memory> // std::auto_ptr #include <iostream> #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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -// 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 <memory> // std::auto_ptr +#include <memory> // std::auto_ptr/unique_ptr #include <sstream> #include <iostream> -#include <xsd/cxx/xml/string.hxx> +#include <xercesc/dom/DOM.hpp> +#include <xercesc/util/PlatformUtils.hpp> + +#include "test.hxx" // Get XSD_CXX11 defined. -#include "test.hxx" +#include <xsd/cxx/xml/string.hxx> using namespace std; using namespace test; @@ -170,7 +172,7 @@ main (int argc, char* argv[]) // Test parsing // - auto_ptr<type> r (root (argv[1])); + XSD_AUTO_PTR<type> r (root (argv[1])); print (*r); // Test serialization. @@ -187,7 +189,7 @@ main (int argc, char* argv[]) // cout << iostr.str () << endl // << endl; - auto_ptr<type> copy (root (iostr, argv[1])); + XSD_AUTO_PTR<type> 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 <boris@codesynthesis.com> -# 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 <boris@codesynthesis.com> -# 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 |