From a8ce5c380c69539fe0c7c62c397634d9d0c9fde2 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 18 Dec 2020 18:48:46 +0300 Subject: Switch to build2 --- tests/cxx/parser/built-in/driver.cxx | 529 ------- tests/cxx/parser/built-in/makefile | 82 -- tests/cxx/parser/built-in/output | 164 --- tests/cxx/parser/built-in/test.xml | 199 --- tests/cxx/parser/built-in/test.xsd | 63 - tests/cxx/parser/enumeration/driver.cxx | 81 -- tests/cxx/parser/enumeration/gender.hxx | 13 - tests/cxx/parser/enumeration/makefile | 83 -- tests/cxx/parser/enumeration/output | 3 - tests/cxx/parser/enumeration/test.map | 7 - tests/cxx/parser/enumeration/test.xml | 10 - tests/cxx/parser/enumeration/test.xsd | 35 - tests/cxx/parser/generated-impl/makefile | 93 -- tests/cxx/parser/generated-impl/output | 122 -- tests/cxx/parser/generated-impl/test.xml | 168 --- tests/cxx/parser/generated-impl/test.xsd | 142 -- tests/cxx/parser/list/driver.cxx | 105 -- tests/cxx/parser/list/makefile | 82 -- tests/cxx/parser/list/output | 26 - tests/cxx/parser/list/test.xml | 25 - tests/cxx/parser/list/test.xsd | 25 - tests/cxx/parser/makefile | 18 - tests/cxx/parser/name-clash/inheritance/driver.cxx | 62 - tests/cxx/parser/name-clash/inheritance/makefile | 83 -- tests/cxx/parser/name-clash/inheritance/output | 2 - tests/cxx/parser/name-clash/inheritance/test.xml | 8 - tests/cxx/parser/name-clash/inheritance/test.xsd | 22 - tests/cxx/parser/polymorphism/makefile | 16 - tests/cxx/parser/polymorphism/recursive/driver.cxx | 68 - tests/cxx/parser/polymorphism/recursive/makefile | 83 -- tests/cxx/parser/polymorphism/recursive/output | 22 - .../parser/polymorphism/recursive/test-pimpl.cxx | 147 -- .../parser/polymorphism/recursive/test-pimpl.hxx | 94 -- tests/cxx/parser/polymorphism/recursive/test.xml | 15 - tests/cxx/parser/polymorphism/recursive/test.xsd | 53 - tests/cxx/parser/polymorphism/same-type/driver.cxx | 62 - tests/cxx/parser/polymorphism/same-type/makefile | 83 -- tests/cxx/parser/polymorphism/same-type/output | 4 - tests/cxx/parser/polymorphism/same-type/test.xml | 10 - tests/cxx/parser/polymorphism/same-type/test.xsd | 21 - tests/cxx/parser/recursive/driver.cxx | 139 -- tests/cxx/parser/recursive/makefile | 83 -- tests/cxx/parser/recursive/output | 22 - tests/cxx/parser/recursive/test.xml | 11 - tests/cxx/parser/recursive/test.xsd | 27 - tests/cxx/parser/test-template/driver.cxx | 66 - tests/cxx/parser/test-template/makefile | 82 -- tests/cxx/parser/test-template/output | 1 - tests/cxx/parser/test-template/test.xml | 7 - tests/cxx/parser/test-template/test.xsd | 12 - tests/cxx/parser/union/driver.cxx | 60 - tests/cxx/parser/union/makefile | 82 -- tests/cxx/parser/union/output | 2 - tests/cxx/parser/union/test.xml | 10 - tests/cxx/parser/union/test.xsd | 16 - tests/cxx/parser/validation/all/driver.cxx | 98 -- tests/cxx/parser/validation/all/makefile | 92 -- tests/cxx/parser/validation/all/test-000.std | 46 - tests/cxx/parser/validation/all/test-000.xml | 53 - tests/cxx/parser/validation/all/test-001.std | 6 - tests/cxx/parser/validation/all/test-001.xml | 11 - tests/cxx/parser/validation/all/test-002.std | 4 - tests/cxx/parser/validation/all/test-002.xml | 9 - tests/cxx/parser/validation/all/test-003.std | 6 - tests/cxx/parser/validation/all/test-003.xml | 12 - tests/cxx/parser/validation/all/test.xsd | 20 - tests/cxx/parser/validation/any/driver.cxx | 121 -- tests/cxx/parser/validation/any/makefile | 92 -- tests/cxx/parser/validation/any/test-000.std | 29 - tests/cxx/parser/validation/any/test-000.xml | 21 - tests/cxx/parser/validation/any/test.xsd | 20 - tests/cxx/parser/validation/attribute/driver.cxx | 197 --- tests/cxx/parser/validation/attribute/makefile | 92 -- tests/cxx/parser/validation/attribute/test-000.std | 24 - tests/cxx/parser/validation/attribute/test-000.xml | 10 - tests/cxx/parser/validation/attribute/test.xsd | 71 - .../parser/validation/built-in/any-type/driver.cxx | 154 -- .../parser/validation/built-in/any-type/makefile | 92 -- .../validation/built-in/any-type/test-000.std | 99 -- .../validation/built-in/any-type/test-000.xml | 41 - .../parser/validation/built-in/any-type/test.xsd | 31 - .../parser/validation/built-in/binary/driver.cxx | 153 -- .../cxx/parser/validation/built-in/binary/makefile | 70 - .../parser/validation/built-in/boolean/driver.cxx | 145 -- .../parser/validation/built-in/boolean/makefile | 70 - .../cxx/parser/validation/built-in/byte/driver.cxx | 256 ---- tests/cxx/parser/validation/built-in/byte/makefile | 70 - .../validation/built-in/date-time/driver.cxx | 1533 -------------------- .../parser/validation/built-in/date-time/makefile | 70 - .../parser/validation/built-in/float/driver.cxx | 285 ---- .../cxx/parser/validation/built-in/float/makefile | 70 - .../cxx/parser/validation/built-in/int/driver.cxx | 116 -- tests/cxx/parser/validation/built-in/int/makefile | 70 - .../parser/validation/built-in/integer/driver.cxx | 303 ---- .../parser/validation/built-in/integer/makefile | 70 - .../cxx/parser/validation/built-in/long/driver.cxx | 116 -- tests/cxx/parser/validation/built-in/long/makefile | 70 - tests/cxx/parser/validation/built-in/makefile | 17 - .../parser/validation/built-in/qname/driver.cxx | 105 -- .../cxx/parser/validation/built-in/qname/makefile | 70 - .../parser/validation/built-in/short/driver.cxx | 116 -- .../cxx/parser/validation/built-in/short/makefile | 70 - .../parser/validation/built-in/string/driver.cxx | 512 ------- .../cxx/parser/validation/built-in/string/makefile | 70 - .../cxx/parser/validation/built-in/uri/driver.cxx | 53 - tests/cxx/parser/validation/built-in/uri/makefile | 70 - tests/cxx/parser/validation/choice/driver.cxx | 126 -- tests/cxx/parser/validation/choice/makefile | 92 -- tests/cxx/parser/validation/choice/test-000.std | 22 - tests/cxx/parser/validation/choice/test-000.xml | 30 - tests/cxx/parser/validation/choice/test-001.std | 4 - tests/cxx/parser/validation/choice/test-001.xml | 10 - tests/cxx/parser/validation/choice/test-002.std | 11 - tests/cxx/parser/validation/choice/test-002.xml | 17 - tests/cxx/parser/validation/choice/test-003.std | 5 - tests/cxx/parser/validation/choice/test-003.xml | 11 - tests/cxx/parser/validation/choice/test-004.std | 4 - tests/cxx/parser/validation/choice/test-004.xml | 11 - tests/cxx/parser/validation/choice/test.xsd | 24 - tests/cxx/parser/validation/makefile | 16 - tests/cxx/parser/validation/restriction/driver.cxx | 107 -- tests/cxx/parser/validation/restriction/makefile | 92 -- .../cxx/parser/validation/restriction/test-000.std | 0 .../cxx/parser/validation/restriction/test-000.xml | 31 - .../cxx/parser/validation/restriction/test-001.std | 1 - .../cxx/parser/validation/restriction/test-001.xml | 11 - .../cxx/parser/validation/restriction/test-002.std | 1 - .../cxx/parser/validation/restriction/test-002.xml | 12 - .../cxx/parser/validation/restriction/test-003.std | 1 - .../cxx/parser/validation/restriction/test-003.xml | 16 - .../cxx/parser/validation/restriction/test-004.std | 1 - .../cxx/parser/validation/restriction/test-004.xml | 10 - .../cxx/parser/validation/restriction/test-005.std | 1 - .../cxx/parser/validation/restriction/test-005.xml | 11 - tests/cxx/parser/validation/restriction/test.xsd | 82 -- tests/cxx/parser/validation/sequence/driver.cxx | 139 -- tests/cxx/parser/validation/sequence/makefile | 92 -- tests/cxx/parser/validation/sequence/test-000.std | 56 - tests/cxx/parser/validation/sequence/test-000.xml | 46 - tests/cxx/parser/validation/sequence/test-001.std | 4 - tests/cxx/parser/validation/sequence/test-001.xml | 10 - tests/cxx/parser/validation/sequence/test-002.std | 20 - tests/cxx/parser/validation/sequence/test-002.xml | 27 - tests/cxx/parser/validation/sequence/test-003.std | 5 - tests/cxx/parser/validation/sequence/test-003.xml | 17 - tests/cxx/parser/validation/sequence/test-004.std | 4 - tests/cxx/parser/validation/sequence/test-004.xml | 14 - tests/cxx/parser/validation/sequence/test-005.std | 6 - tests/cxx/parser/validation/sequence/test-005.xml | 15 - tests/cxx/parser/validation/sequence/test-006.std | 13 - tests/cxx/parser/validation/sequence/test-006.xml | 17 - tests/cxx/parser/validation/sequence/test.xsd | 28 - 152 files changed, 10824 deletions(-) delete mode 100644 tests/cxx/parser/built-in/driver.cxx delete mode 100644 tests/cxx/parser/built-in/makefile delete mode 100644 tests/cxx/parser/built-in/output delete mode 100644 tests/cxx/parser/built-in/test.xml delete mode 100644 tests/cxx/parser/built-in/test.xsd delete mode 100644 tests/cxx/parser/enumeration/driver.cxx delete mode 100644 tests/cxx/parser/enumeration/gender.hxx delete mode 100644 tests/cxx/parser/enumeration/makefile delete mode 100644 tests/cxx/parser/enumeration/output delete mode 100644 tests/cxx/parser/enumeration/test.map delete mode 100644 tests/cxx/parser/enumeration/test.xml delete mode 100644 tests/cxx/parser/enumeration/test.xsd delete mode 100644 tests/cxx/parser/generated-impl/makefile delete mode 100644 tests/cxx/parser/generated-impl/output delete mode 100644 tests/cxx/parser/generated-impl/test.xml delete mode 100644 tests/cxx/parser/generated-impl/test.xsd delete mode 100644 tests/cxx/parser/list/driver.cxx delete mode 100644 tests/cxx/parser/list/makefile delete mode 100644 tests/cxx/parser/list/output delete mode 100644 tests/cxx/parser/list/test.xml delete mode 100644 tests/cxx/parser/list/test.xsd delete mode 100644 tests/cxx/parser/makefile delete mode 100644 tests/cxx/parser/name-clash/inheritance/driver.cxx delete mode 100644 tests/cxx/parser/name-clash/inheritance/makefile delete mode 100644 tests/cxx/parser/name-clash/inheritance/output delete mode 100644 tests/cxx/parser/name-clash/inheritance/test.xml delete mode 100644 tests/cxx/parser/name-clash/inheritance/test.xsd delete mode 100644 tests/cxx/parser/polymorphism/makefile delete mode 100644 tests/cxx/parser/polymorphism/recursive/driver.cxx delete mode 100644 tests/cxx/parser/polymorphism/recursive/makefile delete mode 100644 tests/cxx/parser/polymorphism/recursive/output delete mode 100644 tests/cxx/parser/polymorphism/recursive/test-pimpl.cxx delete mode 100644 tests/cxx/parser/polymorphism/recursive/test-pimpl.hxx delete mode 100644 tests/cxx/parser/polymorphism/recursive/test.xml delete mode 100644 tests/cxx/parser/polymorphism/recursive/test.xsd delete mode 100644 tests/cxx/parser/polymorphism/same-type/driver.cxx delete mode 100644 tests/cxx/parser/polymorphism/same-type/makefile delete mode 100644 tests/cxx/parser/polymorphism/same-type/output delete mode 100644 tests/cxx/parser/polymorphism/same-type/test.xml delete mode 100644 tests/cxx/parser/polymorphism/same-type/test.xsd delete mode 100644 tests/cxx/parser/recursive/driver.cxx delete mode 100644 tests/cxx/parser/recursive/makefile delete mode 100644 tests/cxx/parser/recursive/output delete mode 100644 tests/cxx/parser/recursive/test.xml delete mode 100644 tests/cxx/parser/recursive/test.xsd delete mode 100644 tests/cxx/parser/test-template/driver.cxx delete mode 100644 tests/cxx/parser/test-template/makefile delete mode 100644 tests/cxx/parser/test-template/output delete mode 100644 tests/cxx/parser/test-template/test.xml delete mode 100644 tests/cxx/parser/test-template/test.xsd delete mode 100644 tests/cxx/parser/union/driver.cxx delete mode 100644 tests/cxx/parser/union/makefile delete mode 100644 tests/cxx/parser/union/output delete mode 100644 tests/cxx/parser/union/test.xml delete mode 100644 tests/cxx/parser/union/test.xsd delete mode 100644 tests/cxx/parser/validation/all/driver.cxx delete mode 100644 tests/cxx/parser/validation/all/makefile delete mode 100644 tests/cxx/parser/validation/all/test-000.std delete mode 100644 tests/cxx/parser/validation/all/test-000.xml delete mode 100644 tests/cxx/parser/validation/all/test-001.std delete mode 100644 tests/cxx/parser/validation/all/test-001.xml delete mode 100644 tests/cxx/parser/validation/all/test-002.std delete mode 100644 tests/cxx/parser/validation/all/test-002.xml delete mode 100644 tests/cxx/parser/validation/all/test-003.std delete mode 100644 tests/cxx/parser/validation/all/test-003.xml delete mode 100644 tests/cxx/parser/validation/all/test.xsd delete mode 100644 tests/cxx/parser/validation/any/driver.cxx delete mode 100644 tests/cxx/parser/validation/any/makefile delete mode 100644 tests/cxx/parser/validation/any/test-000.std delete mode 100644 tests/cxx/parser/validation/any/test-000.xml delete mode 100644 tests/cxx/parser/validation/any/test.xsd delete mode 100644 tests/cxx/parser/validation/attribute/driver.cxx delete mode 100644 tests/cxx/parser/validation/attribute/makefile delete mode 100644 tests/cxx/parser/validation/attribute/test-000.std delete mode 100644 tests/cxx/parser/validation/attribute/test-000.xml delete mode 100644 tests/cxx/parser/validation/attribute/test.xsd delete mode 100644 tests/cxx/parser/validation/built-in/any-type/driver.cxx delete mode 100644 tests/cxx/parser/validation/built-in/any-type/makefile delete mode 100644 tests/cxx/parser/validation/built-in/any-type/test-000.std delete mode 100644 tests/cxx/parser/validation/built-in/any-type/test-000.xml delete mode 100644 tests/cxx/parser/validation/built-in/any-type/test.xsd delete mode 100644 tests/cxx/parser/validation/built-in/binary/driver.cxx delete mode 100644 tests/cxx/parser/validation/built-in/binary/makefile delete mode 100644 tests/cxx/parser/validation/built-in/boolean/driver.cxx delete mode 100644 tests/cxx/parser/validation/built-in/boolean/makefile delete mode 100644 tests/cxx/parser/validation/built-in/byte/driver.cxx delete mode 100644 tests/cxx/parser/validation/built-in/byte/makefile delete mode 100644 tests/cxx/parser/validation/built-in/date-time/driver.cxx delete mode 100644 tests/cxx/parser/validation/built-in/date-time/makefile delete mode 100644 tests/cxx/parser/validation/built-in/float/driver.cxx delete mode 100644 tests/cxx/parser/validation/built-in/float/makefile delete mode 100644 tests/cxx/parser/validation/built-in/int/driver.cxx delete mode 100644 tests/cxx/parser/validation/built-in/int/makefile delete mode 100644 tests/cxx/parser/validation/built-in/integer/driver.cxx delete mode 100644 tests/cxx/parser/validation/built-in/integer/makefile delete mode 100644 tests/cxx/parser/validation/built-in/long/driver.cxx delete mode 100644 tests/cxx/parser/validation/built-in/long/makefile delete mode 100644 tests/cxx/parser/validation/built-in/makefile delete mode 100644 tests/cxx/parser/validation/built-in/qname/driver.cxx delete mode 100644 tests/cxx/parser/validation/built-in/qname/makefile delete mode 100644 tests/cxx/parser/validation/built-in/short/driver.cxx delete mode 100644 tests/cxx/parser/validation/built-in/short/makefile delete mode 100644 tests/cxx/parser/validation/built-in/string/driver.cxx delete mode 100644 tests/cxx/parser/validation/built-in/string/makefile delete mode 100644 tests/cxx/parser/validation/built-in/uri/driver.cxx delete mode 100644 tests/cxx/parser/validation/built-in/uri/makefile delete mode 100644 tests/cxx/parser/validation/choice/driver.cxx delete mode 100644 tests/cxx/parser/validation/choice/makefile delete mode 100644 tests/cxx/parser/validation/choice/test-000.std delete mode 100644 tests/cxx/parser/validation/choice/test-000.xml delete mode 100644 tests/cxx/parser/validation/choice/test-001.std delete mode 100644 tests/cxx/parser/validation/choice/test-001.xml delete mode 100644 tests/cxx/parser/validation/choice/test-002.std delete mode 100644 tests/cxx/parser/validation/choice/test-002.xml delete mode 100644 tests/cxx/parser/validation/choice/test-003.std delete mode 100644 tests/cxx/parser/validation/choice/test-003.xml delete mode 100644 tests/cxx/parser/validation/choice/test-004.std delete mode 100644 tests/cxx/parser/validation/choice/test-004.xml delete mode 100644 tests/cxx/parser/validation/choice/test.xsd delete mode 100644 tests/cxx/parser/validation/makefile delete mode 100644 tests/cxx/parser/validation/restriction/driver.cxx delete mode 100644 tests/cxx/parser/validation/restriction/makefile delete mode 100644 tests/cxx/parser/validation/restriction/test-000.std delete mode 100644 tests/cxx/parser/validation/restriction/test-000.xml delete mode 100644 tests/cxx/parser/validation/restriction/test-001.std delete mode 100644 tests/cxx/parser/validation/restriction/test-001.xml delete mode 100644 tests/cxx/parser/validation/restriction/test-002.std delete mode 100644 tests/cxx/parser/validation/restriction/test-002.xml delete mode 100644 tests/cxx/parser/validation/restriction/test-003.std delete mode 100644 tests/cxx/parser/validation/restriction/test-003.xml delete mode 100644 tests/cxx/parser/validation/restriction/test-004.std delete mode 100644 tests/cxx/parser/validation/restriction/test-004.xml delete mode 100644 tests/cxx/parser/validation/restriction/test-005.std delete mode 100644 tests/cxx/parser/validation/restriction/test-005.xml delete mode 100644 tests/cxx/parser/validation/restriction/test.xsd delete mode 100644 tests/cxx/parser/validation/sequence/driver.cxx delete mode 100644 tests/cxx/parser/validation/sequence/makefile delete mode 100644 tests/cxx/parser/validation/sequence/test-000.std delete mode 100644 tests/cxx/parser/validation/sequence/test-000.xml delete mode 100644 tests/cxx/parser/validation/sequence/test-001.std delete mode 100644 tests/cxx/parser/validation/sequence/test-001.xml delete mode 100644 tests/cxx/parser/validation/sequence/test-002.std delete mode 100644 tests/cxx/parser/validation/sequence/test-002.xml delete mode 100644 tests/cxx/parser/validation/sequence/test-003.std delete mode 100644 tests/cxx/parser/validation/sequence/test-003.xml delete mode 100644 tests/cxx/parser/validation/sequence/test-004.std delete mode 100644 tests/cxx/parser/validation/sequence/test-004.xml delete mode 100644 tests/cxx/parser/validation/sequence/test-005.std delete mode 100644 tests/cxx/parser/validation/sequence/test-005.xml delete mode 100644 tests/cxx/parser/validation/sequence/test-006.std delete mode 100644 tests/cxx/parser/validation/sequence/test-006.xml delete mode 100644 tests/cxx/parser/validation/sequence/test.xsd (limited to 'tests/cxx/parser') diff --git a/tests/cxx/parser/built-in/driver.cxx b/tests/cxx/parser/built-in/driver.cxx deleted file mode 100644 index 6cfd8fc..0000000 --- a/tests/cxx/parser/built-in/driver.cxx +++ /dev/null @@ -1,529 +0,0 @@ -// file : tests/cxx/parser/built-in/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test built-in type parsing. -// - -#include -#include - -#include "test-pskel.hxx" - -using namespace std; -using namespace test; -using xml_schema::ro_string; - -struct any_type_pimpl: xml_schema::any_type_pimpl -{ - virtual void - pre () - { - cout << "{" << endl; - } - - virtual void - _start_any_element (ro_string const&, - ro_string const& n, - ro_string const*) - { - cout << " start any element '" << n << "'" << endl; - } - - virtual void - _end_any_element (ro_string const&, ro_string const& n) - { - cout << " end any element '" << n << "'" << endl; - } - - virtual void - _any_attribute (ro_string const&, - ro_string const& n, - ro_string const& v) - { - cout << " any attribute " << n << " = '" << v << "'" << endl; - } - - virtual void - _any_characters (ro_string const& s) - { - cout << " any text: '" << s << "'" << endl; - } - - virtual void - post_any_type () - { - cout << "}" << endl - << endl; - } -}; - -struct any_simple_type_pimpl: xml_schema::any_simple_type_pimpl -{ - virtual void - pre () - { - cout << "{" << endl; - } - - virtual void - _any_characters (ro_string const& s) - { - cout << " any text: '" << s << "'" << endl; - } - - virtual void - post_any_simple_type () - { - cout << "}" << endl - << endl; - } -}; - -struct type_pimpl: type_pskel -{ - virtual void - boolean (bool v) - { - cout << v << endl; - } - - virtual void - byte (signed char v) - { - cout << short (v) << endl; - } - - virtual void - unsigned_byte (unsigned char v) - { - cout << (unsigned short) (v) << endl; - } - - virtual void - short_ (short v) - { - cout << v << endl; - } - - virtual void - unsigned_short (unsigned short v) - { - cout << v << endl; - } - - virtual void - int_ (int v) - { - cout << v << endl; - } - - virtual void - unsigned_int (unsigned int v) - { - cout << v << endl; - } - - virtual void - long_ (long long v) - { - cout << v << endl; - } - - virtual void - unsigned_long (unsigned long long v) - { - cout << v << endl; - } - - virtual void - integer (long long v) - { - cout << v << endl; - } - - virtual void - negative_integer (long long v) - { - cout << v << endl; - } - - - virtual void - non_positive_integer (long long v) - { - cout << v << endl; - } - - - virtual void - positive_integer (unsigned long long v) - { - cout << v << endl; - } - - virtual void - non_negative_integer (unsigned long long v) - { - cout << v << endl; - } - - virtual void - float_ (float v) - { - cout << v << endl; - } - - virtual void - double_ (double v) - { - cout << v << endl; - } - - virtual void - decimal (double v) - { - cout << v << endl; - } - - virtual void - string (std::string const& v) - { - cout << "'" << v << "'" << endl; - } - - virtual void - normalized_string (std::string const& v) - { - cout << "'" << v << "'" << endl; - } - - virtual void - token (std::string const& v) - { - cout << "'" << v << "'" << endl; - } - - virtual void - name (std::string const& v) - { - cout << "'" << v << "'" << endl; - } - - virtual void - nmtoken (std::string const& v) - { - cout << "'" << v << "'" << endl; - } - - virtual void - nmtokens (xml_schema::string_sequence const& s) - { - cout << "'"; - - for (xml_schema::string_sequence::const_iterator i (s.begin ()); - i != s.end (); ++i) - cout << *i << " "; - - cout << "'" << endl; - } - - virtual void - ncname (std::string const& v) - { - cout << "'" << v << "'" << endl; - } - - virtual void - id (std::string const& v) - { - cout << "'" << v << "'" << endl; - } - - virtual void - idref (std::string const& v) - { - cout << "'" << v << "'" << endl; - } - - virtual void - idrefs (xml_schema::string_sequence const& s) - { - cout << "'"; - - for (xml_schema::string_sequence::const_iterator i (s.begin ()); - i != s.end (); ++i) - cout << *i << " "; - - cout << "'" << endl; - } - - virtual void - language (std::string const& v) - { - cout << "'" << v << "'" << endl; - } - - virtual void - uri (std::string const& v) - { - cout << "'" << v << "'" << endl; - } - - virtual void - qname (xml_schema::qname const& v) - { - cout << "'" << v.prefix () << ":" << v.name () << "'" << endl; - } - - virtual void - base64_binary (XSD_AUTO_PTR v) - { - std::string tmp (v->data (), v->size ()); - cout << "'" << tmp << "'" << endl; - } - - virtual void - hex_binary (XSD_AUTO_PTR v) - { - std::string tmp (v->data (), v->size ()); - cout << "'" << tmp << "'" << endl; - } - - virtual void - gday (xml_schema::gday const& v) - { - cout << v.day (); - - if (v.zone_present ()) - cout << (v.zone_hours () < 0 ? "" : "+") << v.zone_hours () - << ':' << v.zone_minutes (); - - cout << endl; - } - - virtual void - gmonth (xml_schema::gmonth const& v) - { - cout << v.month (); - - if (v.zone_present ()) - cout << (v.zone_hours () < 0 ? "" : "+") << v.zone_hours () - << ':' << v.zone_minutes (); - - cout << endl; - } - - virtual void - gyear (xml_schema::gyear const& v) - { - cout << v.year (); - - if (v.zone_present ()) - cout << (v.zone_hours () < 0 ? "" : "+") << v.zone_hours () - << ':' << v.zone_minutes (); - - cout << endl; - } - - virtual void - gmonth_day (xml_schema::gmonth_day const& v) - { - cout << v.month () << '-' << v.day (); - - if (v.zone_present ()) - cout << (v.zone_hours () < 0 ? "" : "+") << v.zone_hours () - << ':' << v.zone_minutes (); - - cout << endl; - } - - virtual void - gyear_month (xml_schema::gyear_month const& v) - { - cout << v.year () << '-' << v.month (); - - if (v.zone_present ()) - cout << (v.zone_hours () < 0 ? "" : "+") << v.zone_hours () - << ':' << v.zone_minutes (); - - cout << endl; - } - - virtual void - date (xml_schema::date const& v) - { - cout << v.year () << '-' << v.month () << '-' << v.day (); - - if (v.zone_present ()) - cout << (v.zone_hours () < 0 ? "" : "+") << v.zone_hours () - << ':' << v.zone_minutes (); - - cout << endl; - } - - virtual void - time (xml_schema::time const& v) - { - cout << v.hours () << ':' << v.minutes () << ':' << v.seconds (); - - if (v.zone_present ()) - cout << (v.zone_hours () < 0 ? "" : "+") << v.zone_hours () - << ':' << v.zone_minutes (); - - cout << endl; - } - - virtual void - date_time (xml_schema::date_time const& v) - { - cout << v.year () << '-' << v.month () << '-' << v.day () << 'T' - << v.hours () << ':' << v.minutes () << ':' << v.seconds (); - - if (v.zone_present ()) - cout << (v.zone_hours () < 0 ? "" : "+") << v.zone_hours () - << ':' << v.zone_minutes (); - - cout << endl; - } - - virtual void - duration (xml_schema::duration const& v) - { - cout << (v.negative () ? "-" : "") << 'P' - << v.years () << 'Y' - << v.months () << 'M' - << v.days () << 'D' - << 'T' - << v.hours () << 'H' - << v.minutes () << 'M' - << v.seconds () << 'S' - << endl; - } -}; - -int -main (int argc, char* argv[]) -{ - if (argc != 2) - { - cerr << "usage: " << argv[0] << " test.xml" << endl; - return 1; - } - - try - { - any_type_pimpl any_type_p; - any_simple_type_pimpl any_simple_type_p; - - xml_schema::boolean_pimpl boolean_p; - - xml_schema::byte_pimpl byte_p; - xml_schema::unsigned_byte_pimpl unsigned_byte_p; - xml_schema::short_pimpl short_p; - xml_schema::unsigned_short_pimpl unsigned_short_p; - xml_schema::int_pimpl int_p; - xml_schema::unsigned_int_pimpl unsigned_int_p; - xml_schema::long_pimpl long_p; - xml_schema::unsigned_long_pimpl unsigned_long_p; - - xml_schema::integer_pimpl integer_p; - xml_schema::negative_integer_pimpl negative_integer_p; - xml_schema::non_positive_integer_pimpl non_positive_integer_p; - xml_schema::positive_integer_pimpl positive_integer_p; - xml_schema::non_negative_integer_pimpl non_negative_integer_p; - - xml_schema::float_pimpl float_p; - xml_schema::double_pimpl double_p; - xml_schema::decimal_pimpl decimal_p; - - xml_schema::string_pimpl string_p; - xml_schema::normalized_string_pimpl normalized_string_p; - xml_schema::token_pimpl token_p; - xml_schema::name_pimpl name_p; - xml_schema::nmtoken_pimpl nmtoken_p; - xml_schema::nmtokens_pimpl nmtokens_p; - xml_schema::ncname_pimpl ncname_p; - xml_schema::id_pimpl id_p; - xml_schema::idref_pimpl idref_p; - xml_schema::idrefs_pimpl idrefs_p; - - xml_schema::language_pimpl language_p; - xml_schema::uri_pimpl uri_p; - xml_schema::qname_pimpl qname_p; - - xml_schema::base64_binary_pimpl base64_binary_p; - xml_schema::hex_binary_pimpl hex_binary_p; - - xml_schema::gday_pimpl gday_p; - xml_schema::gmonth_pimpl gmonth_p; - xml_schema::gyear_pimpl gyear_p; - xml_schema::gmonth_day_pimpl gmonth_day_p; - xml_schema::gyear_month_pimpl gyear_month_p; - xml_schema::date_pimpl date_p; - xml_schema::time_pimpl time_p; - xml_schema::date_time_pimpl date_time_p; - xml_schema::duration_pimpl duration_p; - - type_pimpl type_p; - - type_p.parsers (any_type_p, - any_simple_type_p, - boolean_p, - byte_p, - unsigned_byte_p, - short_p, - unsigned_short_p, - int_p, - unsigned_int_p, - long_p, - unsigned_long_p, - integer_p, - negative_integer_p, - non_positive_integer_p, - positive_integer_p, - non_negative_integer_p, - float_p, - double_p, - decimal_p, - string_p, - normalized_string_p, - token_p, - name_p, - nmtoken_p, - nmtokens_p, - ncname_p, - id_p, - idref_p, - idrefs_p, - language_p, - uri_p, - qname_p, - base64_binary_p, - hex_binary_p, - gday_p, - gmonth_p, - gyear_p, - gmonth_day_p, - gyear_month_p, - date_p, - time_p, - date_time_p, - duration_p); - - xml_schema::document doc_p (type_p, "test", "root"); - - type_p.pre (); - doc_p.parse (argv[1]); - type_p.post_type (); - } - 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/tests/cxx/parser/built-in/makefile b/tests/cxx/parser/built-in/makefile deleted file mode 100644 index 5602b6a..0000000 --- a/tests/cxx/parser/built-in/makefile +++ /dev/null @@ -1,82 +0,0 @@ -# file : tests/cxx/parser/built-in/makefile -# 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=-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): $(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/tests/cxx/parser/built-in/output b/tests/cxx/parser/built-in/output deleted file mode 100644 index 756abcd..0000000 --- a/tests/cxx/parser/built-in/output +++ /dev/null @@ -1,164 +0,0 @@ -{ - any attribute x = 'x' - any text: ' - ' - start any element 'a' - any text: 'a' - end any element 'a' - any text: ' - ' - start any element 'any-type' - any attribute x = 'xxx' - any text: 'aaa' - start any element 'a' - any text: 'bbb' - end any element 'a' - any text: 'ccc' - end any element 'any-type' - any text: ' - ' -} - -{ - any text: '123abc' -} - -1 -0 -1 -0 -0 -127 --128 -123 -0 -255 -123 -0 -32767 --32768 --12345 -0 -65535 -12345 -0 -2147483647 --2147483648 --1234567890 -0 -4294967295 -1234567890 -0 -9223372036854775807 --9223372036854775808 --1234567890123456789 -0 -18446744073709551615 -12345678901234567890 -0 -2147483647 --2147483648 --1234567890 --2147483648 --1234567890 -0 --2147483648 --1234567890 -4294967295 -1234567890 -0 -4294967295 -1234567890 -0 -0 --0 -inf --inf -nan -123.567 -123.567 --1.23567e+07 --4.5e-06 -0 -0 --0 -inf --inf -nan -123.567 -123.567 --1.23567e+07 --4.5e-06 -0 -0 --0 -123.567 -123.567 --123.567 -'string space -newline - ' -' string space newline ' -'string space newline' -'as123:345-.abs' -'1as123:345-.abs' -'abc 123 ' -'as123_345-.abs' -'as123_345-.abs' -'abc' -'a123' -'as123_345-.abs' -'abc a123 ' -'x' -'en' -'en-us' -'one-two-three-four44-seven77-eight888' -'' -'relative' -'#id' -'http://www.example.com/foo#bar' -':schemaLocation' -'xsi:schemaLocation' -'12345abcjk' -'a' -'ab' -'abc' -'' -'12345abcjk' -12+12:0 -1 -31 -15+0:0 -15-14:0 -10+12:0 -1 -12+0:0 -2007+12:0 -1 --20000+0:0 -10-28+12:0 -12-31 -1-1+0:0 -2007-12+12:0 --2007-10 -20007-10+0:0 --20007-1 -2007-12-26+12:0 --2007-10-15 -20007-12-31+0:0 --20007-1-1 -12:46:23.456+12:0 -12:13:14 -12:13:14+0:0 -2007-12-26T12:13:14.123+12:0 --2007-10-15T12:13:14 -20007-12-31T12:13:14+0:0 --20007-1-1T12:13:14 --P2007Y13M32DT25H61M61.123S -P1Y0M0DT0H0M0S -P0Y1M0DT0H0M0S -P0Y0M1DT0H0M0S -P0Y0M0DT1H0M0S -P0Y0M0DT0H1M0S -P0Y0M0DT0H0M1.1S -P1Y0M0DT0H0M1S diff --git a/tests/cxx/parser/built-in/test.xml b/tests/cxx/parser/built-in/test.xml deleted file mode 100644 index 8d9332a..0000000 --- a/tests/cxx/parser/built-in/test.xml +++ /dev/null @@ -1,199 +0,0 @@ - - - - a - aaabbbccc - - - 123abc - - 1 - 0 - true - false - - 0 - +127 - -128 - 123 - - 0 - 255 - 123 - - 0 - +32767 - -32768 - -12345 - - 0 - 65535 - 12345 - - 0 - +2147483647 - -2147483648 - -1234567890 - - 0 - 4294967295 - 1234567890 - - 0 - +9223372036854775807 - -9223372036854775808 - -1234567890123456789 - - 0 - 18446744073709551615 - 12345678901234567890 - - 0 - +2147483647 - -02147483648 - -1234567890 - - -02147483648 - -1234567890 - - 0 - -02147483648 - -1234567890 - - 4294967295 - +01234567890 - - 0 - 4294967295 - +01234567890 - - 0 - +0 - -0 - INF - -INF - NaN - 123.567 - +123.567 - -123.567e5 - -.45E-5 - - 0 - +0 - -0 - INF - -INF - NaN - 123.567 - +123.567 - -123.567e5 - -.45E-5 - - 0 - +0 - -0 - 123.567 - +123.567 - -123.567 - - string space -newline - - - string space -newline - - - - string space -newline - - - - as123:345-.abs - - 1as123:345-.abs - - abc 123 - - as123_345-.abs - - as123_345-.abs - abc - a123 - - as123_345-.abs - - abc a123 - - x - en - en-us - one-two-three-four44-seven77-eight888 - - - relative - #id - http://www.example.com/foo#bar - - schemaLocation - xsi:schemaLocation - - MTIzND - VhYmNqaw = = - YQ== - YWI= - YWJj - - - 31323334356162636a6b - - ---12+12:00 - ---01 - ---31 - ---15Z - ---15-14:00 - - --10+12:00 - --01 - --12Z - - 2007+12:00 - 0001 - -20000Z - - --10-28+12:00 - --12-31 - --01-01Z - - 2007-12+12:00 - -2007-10 - 20007-10Z - -20007-01 - - 2007-12-26+12:00 - -2007-10-15 - 20007-12-31Z - -20007-01-01 - - - - - - 2007-12-26T12:13:14.123+12:00 - -2007-10-15T12:13:14 - 20007-12-31T12:13:14Z - -20007-01-01T12:13:14 - - -P2007Y13M32DT25H61M61.123S - P1Y - P1M - P1D - PT1H - PT1M - PT1.1S - P1YT1S - - diff --git a/tests/cxx/parser/built-in/test.xsd b/tests/cxx/parser/built-in/test.xsd deleted file mode 100644 index 9c00eb4..0000000 --- a/tests/cxx/parser/built-in/test.xsd +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/cxx/parser/enumeration/driver.cxx b/tests/cxx/parser/enumeration/driver.cxx deleted file mode 100644 index e90f58b..0000000 --- a/tests/cxx/parser/enumeration/driver.cxx +++ /dev/null @@ -1,81 +0,0 @@ -// file : tests/cxx/parser/enumeration/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test xsd:enumeration parsing. -// - -#include -#include - -#include "test-pskel.hxx" - -using namespace std; -using namespace xml_schema; - -struct digit_pimpl: test::digit_pskel, int_pimpl -{ -}; - -struct gender_pimpl: test::gender_pskel, string_pimpl -{ - virtual ::gender - post_gender () - { - std::string str (post_string ()); - - if (str == "male") - return male; - else - return female; - } -}; - -struct type_pimpl: test::type_pskel -{ - virtual void - digit (int i) - { - cout << i << endl; - } - - virtual void - gender (::gender g) - { - cout << g << endl; - } -}; - -int -main (int argc, char* argv[]) -{ - if (argc != 2) - { - cerr << "usage: " << argv[0] << " test.xml" << endl; - return 1; - } - - try - { - digit_pimpl digit_p; - gender_pimpl gender_p; - type_pimpl type_p; - - type_p.parsers (digit_p, gender_p); - - document doc_p (type_p, "test", "root"); - - type_p.pre (); - doc_p.parse (argv[1]); - type_p.post_type (); - } - 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/tests/cxx/parser/enumeration/gender.hxx b/tests/cxx/parser/enumeration/gender.hxx deleted file mode 100644 index a2e5cd8..0000000 --- a/tests/cxx/parser/enumeration/gender.hxx +++ /dev/null @@ -1,13 +0,0 @@ -// file : tests/cxx/parser/enumeration/gender.hxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#ifndef GENDER_HXX -#define GENDER_HXX - -enum gender -{ - male, - female -}; - -#endif // GENDER_HXX diff --git a/tests/cxx/parser/enumeration/makefile b/tests/cxx/parser/enumeration/makefile deleted file mode 100644 index f2ae834..0000000 --- a/tests/cxx/parser/enumeration/makefile +++ /dev/null @@ -1,83 +0,0 @@ -# file : tests/cxx/parser/enumeration/makefile -# 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=-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 += --type-map $(src_base)/test.map -$(gen): $(out_root)/xsd/xsd $(src_base)/test.map - -$(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/tests/cxx/parser/enumeration/output b/tests/cxx/parser/enumeration/output deleted file mode 100644 index 16db301..0000000 --- a/tests/cxx/parser/enumeration/output +++ /dev/null @@ -1,3 +0,0 @@ -1 -0 -1 diff --git a/tests/cxx/parser/enumeration/test.map b/tests/cxx/parser/enumeration/test.map deleted file mode 100644 index f8868d6..0000000 --- a/tests/cxx/parser/enumeration/test.map +++ /dev/null @@ -1,7 +0,0 @@ -namespace test -{ - include "gender.hxx"; - - digit int int; - gender ::gender ::gender; -} diff --git a/tests/cxx/parser/enumeration/test.xml b/tests/cxx/parser/enumeration/test.xml deleted file mode 100644 index a6fa893..0000000 --- a/tests/cxx/parser/enumeration/test.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - 1 - - male - female - - diff --git a/tests/cxx/parser/enumeration/test.xsd b/tests/cxx/parser/enumeration/test.xsd deleted file mode 100644 index ded3a18..0000000 --- a/tests/cxx/parser/enumeration/test.xsd +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/cxx/parser/generated-impl/makefile b/tests/cxx/parser/generated-impl/makefile deleted file mode 100644 index ba26c37..0000000 --- a/tests/cxx/parser/generated-impl/makefile +++ /dev/null @@ -1,93 +0,0 @@ -# file : tests/cxx/parser/generated-impl/makefile -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make - -xsd := test.xsd - -obj := $(addprefix $(out_base)/,$(xsd:.xsd=-pskel.o) $(xsd:.xsd=-pimpl.o) $(xsd:.xsd=-driver.o)) -dep := $(obj:.o=.o.d) - -driver := $(out_base)/$(xsd:.xsd=-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) \ - $(xsd:.xsd=-pimpl.hxx) \ - $(xsd:.xsd=-pimpl.cxx) \ - $(xsd:.xsd=-driver.cxx) - -gen := $(addprefix $(out_base)/,$(genf)) - - -$(gen): xsd := $(out_root)/xsd/xsd -$(gen): xsd_options += --generate-print-impl --generate-test-driver \ ---force-overwrite -$(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)) \ - $(addprefix $(out_base)/,$(xsd:.xsd=-pimpl.cxx.xsd.clean)) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(gen): | $(out_base)/.gitignore -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := $(xsd:.xsd=-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) - -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. -# -$(call import,$(src_root)/xsd/makefile) diff --git a/tests/cxx/parser/generated-impl/output b/tests/cxx/parser/generated-impl/output deleted file mode 100644 index 7c58647..0000000 --- a/tests/cxx/parser/generated-impl/output +++ /dev/null @@ -1,122 +0,0 @@ -gender: male -foo: foo -gender: male -int: 0 -int: 1 -int: 2 -int: 3 -foo: foo -int: 3 -int: 2 -int: 1 -int: 0 -union: 9 -foo: foo -union: string -x: x -a: aaa -x: x -y: y -a: aaa -b: bbb -boolean: 1 -boolean: 0 -boolean: 1 -boolean: 0 -byte: 0 -byte: 123 -byte: -123 -unsigned-byte: 0 -unsigned-byte: 123 -short: 0 -short: -1234 -short: 1234 -unsigned-short: 0 -unsigned-short: 1234 -int: 0 -int: -12345 -int: 12345 -unsigned-int: 0 -unsigned-int: 12345 -long: 0 -long: -123456 -long: 123456 -unsigned-long: 0 -unsigned-long: 123456 -integer: 0 -integer: -123456 -integer: 123456 -negative-integer: -123456 -non-positive-integer: 0 -non-positive-integer: -123456 -positive-integer: 123456 -non-negative-integer: 0 -non-negative-integer: 123456 -float: 0 -float: 1.123 -float: -1.123 -double: 0 -double: 1.1234 -double: -1.1234 -decimal: 0 -decimal: 1.1234 -decimal: -1.1234 -string: string space newline -normalized-string: string space newline -token: string space newline -name: as123:345-.abs -nmtoken: 1as123:345-.abs -nmtokens: abc 123 -ncname: as123_345-.abs -id: abc -id: a123 -idref: abc -idrefs: abc a123 -language: en -language: en-us -uri: http://www.example.com/foo#bar -qname: schemaLocation -qname: xsi:schemaLocation -base64_binary: 10 bytes -base64_binary: 1 bytes -base64_binary: 2 bytes -base64_binary: 3 bytes -hex_binary: 0 bytes -hex_binary: 10 bytes -gday: ---12+12:0 -gday: ---1 -gday: ---31 -gday: ---15+0:0 -gday: ---15-14:0 -gmonth: --10+12:0 -gmonth: --1 -gmonth: --12+0:0 -gyear: 2007+12:0 -gyear: 1 -gyear: -20000+0:0 -gmonth_day: --10-28+12:0 -gmonth_day: --12-31 -gmonth_day: --1-1+0:0 -gyear_month: 2007-12+12:0 -gyear_month: -2007-10 -gyear_month: 20007-10+0:0 -gyear_month: -20007-1 -date: 2007-12-26+12:0 -date: -2007-10-15 -date: 20007-12-31+0:0 -date: -20007-1-1 -time: 12:46:23.456+12:0 -time: 12:13:14 -time: 12:13:14+0:0 -date_time: 2007-12-26T12:13:14.123+12:0 -date_time: -2007-10-15T12:13:14 -date_time: 20007-12-31T12:13:14+0:0 -date_time: -20007-1-1T12:13:14 -duration: -P2007Y13M32DT25H61M61.123S -duration: P1Y0M0DT0H0M0S -duration: P0Y1M0DT0H0M0S -duration: P0Y0M1DT0H0M0S -duration: P0Y0M0DT1H0M0S -duration: P0Y0M0DT0H1M0S -duration: P0Y0M0DT0H0M1.1S -duration: P1Y0M0DT0H0M1S diff --git a/tests/cxx/parser/generated-impl/test.xml b/tests/cxx/parser/generated-impl/test.xml deleted file mode 100644 index 2f29a39..0000000 --- a/tests/cxx/parser/generated-impl/test.xml +++ /dev/null @@ -1,168 +0,0 @@ - - - male - male - - 0 1 2 3 - 3 2 1 0 - - 9 - string - - - aaa - - - - aaa - bbb - - - aaabbbccc - abc123 - - 1 - 0 - true - false - - 0 - 123 - -123 - - 0 - 123 - - 0 - -1234 - 1234 - - 0 - 1234 - - 0 - -12345 - 12345 - - 0 - 12345 - - 0 - -123456 - 123456 - - 0 - 123456 - - 0 - -123456 - 123456 - - -123456 - - 0 - -123456 - - 123456 - - 0 - 123456 - - 0 - 1.123 - -1.123 - - 0 - 1.1234 - -1.1234 - - 0 - 1.1234 - -1.1234 - - string space newline - - string space newline - - string space newline - - as123:345-.abs - - 1as123:345-.abs - - abc 123 - - as123_345-.abs - - abc - a123 - - abc - - abc a123 - - en - en-us - - http://www.example.com/foo#bar - - schemaLocation - xsi:schemaLocation - - MTIzNDVhYmNqaw== - YQ== - YWI= - YWJj - - - 31323334356162636a6b - - ---12+12:00 - ---01 - ---31 - ---15Z - ---15-14:00 - - --10+12:00 - --01 - --12Z - - 2007+12:00 - 0001 - -20000Z - - --10-28+12:00 - --12-31 - --01-01Z - - 2007-12+12:00 - -2007-10 - 20007-10Z - -20007-01 - - 2007-12-26+12:00 - -2007-10-15 - 20007-12-31Z - -20007-01-01 - - - - - - 2007-12-26T12:13:14.123+12:00 - -2007-10-15T12:13:14 - 20007-12-31T12:13:14Z - -20007-01-01T12:13:14 - - -P2007Y13M32DT25H61M61.123S - P1Y - P1M - P1D - PT1H - PT1M - PT1.1S - P1YT1S - - diff --git a/tests/cxx/parser/generated-impl/test.xsd b/tests/cxx/parser/generated-impl/test.xsd deleted file mode 100644 index 7bc8f23..0000000 --- a/tests/cxx/parser/generated-impl/test.xsd +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/cxx/parser/list/driver.cxx b/tests/cxx/parser/list/driver.cxx deleted file mode 100644 index dfc27bf..0000000 --- a/tests/cxx/parser/list/driver.cxx +++ /dev/null @@ -1,105 +0,0 @@ -// file : tests/cxx/parser/list/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test xsd:list parsing. -// - -#include -#include - -#include "test-pskel.hxx" - -using namespace std; -using namespace test; - -struct string_list_pimpl: string_list_pskel -{ - virtual void - pre () - { - cout << "{" << endl; - } - - virtual void - item (string const& v) - { - cout << " '" << v << "'" << endl; - } - - virtual void - post_string_list () - { - cout << "}" << endl - << endl; - } -}; - -struct string_list_lang_pimpl: string_list_lang_pskel -{ - virtual void - pre () - { - cout << "{" << endl; - } - - virtual void - item (string const& v) - { - cout << " '" << v << "'" << endl; - } - - virtual void - lang (string const& v) - { - cout << " lang: '" << v << "'" << endl; - } - - virtual void - post_string_list_lang () - { - cout << "}" << endl - << endl; - } -}; - -struct type_pimpl: type_pskel -{ -}; - -int -main (int argc, char* argv[]) -{ - if (argc != 2) - { - cerr << "usage: " << argv[0] << " test.xml" << endl; - return 1; - } - - try - { - xml_schema::string_pimpl string_p; - string_list_pimpl string_list_p; - string_list_lang_pimpl string_list_lang_p; - type_pimpl type_p; - - string_list_p.parsers (string_p); - string_list_lang_p.parsers (string_p, string_p); - type_p.parsers (string_list_p, string_list_lang_p); - - xml_schema::document doc_p (type_p, "test", "root"); - - type_p.pre (); - doc_p.parse (argv[1]); - type_p.post_type (); - } - catch (xml_schema::exception const& e) - { - cerr << e << endl; - return 1; - } - catch (ios_base::failure const&) - { - cerr << "io failure" << endl; - return 1; - } -} diff --git a/tests/cxx/parser/list/makefile b/tests/cxx/parser/list/makefile deleted file mode 100644 index c3b5a87..0000000 --- a/tests/cxx/parser/list/makefile +++ /dev/null @@ -1,82 +0,0 @@ -# file : tests/cxx/parser/list/makefile -# 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=-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): $(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/tests/cxx/parser/list/output b/tests/cxx/parser/list/output deleted file mode 100644 index 3642c4d..0000000 --- a/tests/cxx/parser/list/output +++ /dev/null @@ -1,26 +0,0 @@ -{ -} - -{ -} - -{ -} - -{ - 'one' -} - -{ - 'one' - 'two' - 'three' -} - -{ - lang: 'en' - 'one' - 'two' - 'three' -} - diff --git a/tests/cxx/parser/list/test.xml b/tests/cxx/parser/list/test.xml deleted file mode 100644 index 52229db..0000000 --- a/tests/cxx/parser/list/test.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - one - - - one two - three - - - - one two - three - - - diff --git a/tests/cxx/parser/list/test.xsd b/tests/cxx/parser/list/test.xsd deleted file mode 100644 index 79bd084..0000000 --- a/tests/cxx/parser/list/test.xsd +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/cxx/parser/makefile b/tests/cxx/parser/makefile deleted file mode 100644 index 53de7c7..0000000 --- a/tests/cxx/parser/makefile +++ /dev/null @@ -1,18 +0,0 @@ -# file : tests/cxx/parser/makefile -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -tests := built-in enumeration generated-impl list recursive \ -name-clash/inheritance polymorphism test-template validation \ -union - -default := $(out_base)/ -test := $(out_base)/.test -clean := $(out_base)/.clean - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) - -$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) diff --git a/tests/cxx/parser/name-clash/inheritance/driver.cxx b/tests/cxx/parser/name-clash/inheritance/driver.cxx deleted file mode 100644 index dc5f871..0000000 --- a/tests/cxx/parser/name-clash/inheritance/driver.cxx +++ /dev/null @@ -1,62 +0,0 @@ -// file : tests/cxx/parser/name-clash/inheritance/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test for name clashes across inheritance hierarchy. -// - -#include -#include - -#include "test-pskel.hxx" - -using namespace std; -using namespace test; - -struct derived_pimpl: derived_pskel -{ - virtual void - e (string const& v) - { - cout << "e: " << v << endl; - } - - virtual void - e1 (string const& v) - { - cout << "e1: " << v << endl; - } -}; - -int -main (int argc, char* argv[]) -{ - if (argc != 2) - { - cerr << "usage: " << argv[0] << " test.xml" << endl; - return 1; - } - - try - { - xml_schema::string_pimpl string_p; - derived_pimpl derived_p; - - derived_p.parsers (string_p, string_p); - - xml_schema::document doc_p (derived_p, "test", "root"); - - derived_p.pre (); - doc_p.parse (argv[1]); - derived_p.post_derived (); - } - 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/tests/cxx/parser/name-clash/inheritance/makefile b/tests/cxx/parser/name-clash/inheritance/makefile deleted file mode 100644 index c540ebe..0000000 --- a/tests/cxx/parser/name-clash/inheritance/makefile +++ /dev/null @@ -1,83 +0,0 @@ -# file : tests/cxx/parser/name-clash/inheritance/makefile -# 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=-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-validation -$(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/tests/cxx/parser/name-clash/inheritance/output b/tests/cxx/parser/name-clash/inheritance/output deleted file mode 100644 index 4efd51b..0000000 --- a/tests/cxx/parser/name-clash/inheritance/output +++ /dev/null @@ -1,2 +0,0 @@ -e: e -e1: e1 diff --git a/tests/cxx/parser/name-clash/inheritance/test.xml b/tests/cxx/parser/name-clash/inheritance/test.xml deleted file mode 100644 index 8c17101..0000000 --- a/tests/cxx/parser/name-clash/inheritance/test.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - e - e1 - - diff --git a/tests/cxx/parser/name-clash/inheritance/test.xsd b/tests/cxx/parser/name-clash/inheritance/test.xsd deleted file mode 100644 index 62a782e..0000000 --- a/tests/cxx/parser/name-clash/inheritance/test.xsd +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/cxx/parser/polymorphism/makefile b/tests/cxx/parser/polymorphism/makefile deleted file mode 100644 index 252d857..0000000 --- a/tests/cxx/parser/polymorphism/makefile +++ /dev/null @@ -1,16 +0,0 @@ -# file : tests/cxx/parser/polymorphism/makefile -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make - -tests := same-type recursive - -default := $(out_base)/ -test := $(out_base)/.test -clean := $(out_base)/.clean - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) - -$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) diff --git a/tests/cxx/parser/polymorphism/recursive/driver.cxx b/tests/cxx/parser/polymorphism/recursive/driver.cxx deleted file mode 100644 index 4a401bd..0000000 --- a/tests/cxx/parser/polymorphism/recursive/driver.cxx +++ /dev/null @@ -1,68 +0,0 @@ -// file : tests/cxx/parser/polymorphism/recursive/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test polymorphic recursive parsing. -// - -#include -#include - -#include "test-pskel.hxx" -#include "test-pimpl.hxx" - -using namespace std; -using namespace test; - -int -main (int argc, char* argv[]) -{ - if (argc != 2) - { - cerr << "usage: " << argv[0] << " test.xml" << endl; - return 1; - } - - try - { - xml_schema::int_pimpl int_p; - - root_pimpl root_p; - expression_pimpl expression_p; - recursive_pimpl recursive_p; - value_a_pimpl value_a_p; - value_b_pimpl value_b_p; - - xml_schema::parser_map_impl expression_map; - - // Connect the parsers together. - // - root_p.parsers (expression_p); - expression_map.insert(value_a_p); - expression_map.insert(value_b_p); - expression_map.insert(recursive_p); - - root_p.expression_parser(expression_map); - - recursive_p.parsers(expression_p); - recursive_p.expression_parser(expression_map); - - value_a_p.parsers(int_p); - value_b_p.parsers(int_p); - - xml_schema::document doc_p (root_p, "test", "root", true); - - root_p.pre (); - doc_p.parse (argv[1]); - root_p.post_root (); - } - catch (xml_schema::exception const& e) - { - cerr << e << endl; - return 1; - } - catch (std::ios_base::failure const&) - { - cerr << "io failure" << endl; - return 1; - } -} diff --git a/tests/cxx/parser/polymorphism/recursive/makefile b/tests/cxx/parser/polymorphism/recursive/makefile deleted file mode 100644 index 855d471..0000000 --- a/tests/cxx/parser/polymorphism/recursive/makefile +++ /dev/null @@ -1,83 +0,0 @@ -# file : tests/cxx/parser/polymorphism/recursive/makefile -# 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/tests/cxx/parser/polymorphism/recursive/output b/tests/cxx/parser/polymorphism/recursive/output deleted file mode 100644 index 28a835f..0000000 --- a/tests/cxx/parser/polymorphism/recursive/output +++ /dev/null @@ -1,22 +0,0 @@ -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/tests/cxx/parser/polymorphism/recursive/test-pimpl.cxx b/tests/cxx/parser/polymorphism/recursive/test-pimpl.cxx deleted file mode 100644 index 8c355ea..0000000 --- a/tests/cxx/parser/polymorphism/recursive/test-pimpl.cxx +++ /dev/null @@ -1,147 +0,0 @@ -// file : tests/cxx/parser/polymorphism/recursive/test-pimpl.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#include - -#include "test-pimpl.hxx" - -using namespace std; - -namespace test -{ - // root_pimpl - // - - void root_pimpl:: - pre () - { - cout << "root start" << endl; - } - - void root_pimpl:: - expression () - { - cout << "root->expression" << endl; - } - - void root_pimpl:: - post_root () - { - cout << "root end" << endl; - } - - // expression_pimpl - // - - void expression_pimpl:: - pre () - { - cout << "expression begin" << endl; - } - - void expression_pimpl:: - post_expression () - { - cout << "expression end" << endl; - } - - // recursive_pimpl - // - - void recursive_pimpl:: - pre () - { - cout << "recursive start" << endl; - } - - void recursive_pimpl:: - expression () - { - cout << "recursive->expression event" << endl; - } - - void recursive_pimpl:: - post_expression () - { - cout << "recursive: post_expression override" << endl; - post_recursive (); - } - - void recursive_pimpl:: - post_recursive () - { - cout << "recursive end" << endl; - } - - // value_pimpl - // - - void value_pimpl:: - pre () - { - cout << "value begin" << endl; - } - - void value_pimpl:: - constant (int) - { - cout << "value->constant" << endl; - } - - void value_pimpl:: - post_expression () - { - cout << "value: post_expression override" << endl; - post_value (); - } - - void value_pimpl:: - post_value () - { - cout << "value end" << endl; - } - - // value_a_pimpl - // - - void value_a_pimpl:: - pre () - { - cout << "value_a begin" << endl; - } - - void value_a_pimpl:: - post_value () - { - cout << "value_a: post_value override" << endl; - post_value_a (); - } - - void value_a_pimpl:: - post_value_a () - { - cout << "value_a end" << endl; - } - - // value_b_pimpl - // - - void value_b_pimpl:: - pre () - { - cout << "value_b begin" << endl; - } - - void value_b_pimpl:: - post_value () - { - cout << "value_b: post_value override" << endl; - post_value_b (); - } - - void value_b_pimpl:: - post_value_b () - { - cout << "value_b end" << endl; - } -} diff --git a/tests/cxx/parser/polymorphism/recursive/test-pimpl.hxx b/tests/cxx/parser/polymorphism/recursive/test-pimpl.hxx deleted file mode 100644 index 932be9e..0000000 --- a/tests/cxx/parser/polymorphism/recursive/test-pimpl.hxx +++ /dev/null @@ -1,94 +0,0 @@ -// file : tests/cxx/parser/polymorphism/recursive/test-pimpl.hxx -// 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/tests/cxx/parser/polymorphism/recursive/test.xml b/tests/cxx/parser/polymorphism/recursive/test.xml deleted file mode 100644 index 42035ba..0000000 --- a/tests/cxx/parser/polymorphism/recursive/test.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - 1 - - - - 2 - - - - diff --git a/tests/cxx/parser/polymorphism/recursive/test.xsd b/tests/cxx/parser/polymorphism/recursive/test.xsd deleted file mode 100644 index affcc8a..0000000 --- a/tests/cxx/parser/polymorphism/recursive/test.xsd +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/cxx/parser/polymorphism/same-type/driver.cxx b/tests/cxx/parser/polymorphism/same-type/driver.cxx deleted file mode 100644 index 4ccaec5..0000000 --- a/tests/cxx/parser/polymorphism/same-type/driver.cxx +++ /dev/null @@ -1,62 +0,0 @@ -// file : tests/cxx/parser/polymorphism/same-type/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test substitution group and xsi:type that don't change the type. -// - -#include -#include - -#include "test-pskel.hxx" - -using namespace std; -using namespace test; - -struct base_pimpl: base_pskel -{ - virtual void - a (string const& v) - { - cout << v << endl; - } -}; - -struct type_pimpl: type_pskel -{ -}; - -int -main (int argc, char* argv[]) -{ - if (argc != 2) - { - cerr << "usage: " << argv[0] << " test.xml" << endl; - return 1; - } - - try - { - xml_schema::string_pimpl string_p; - base_pimpl base_p; - type_pimpl type_p; - - base_p.parsers (string_p); - type_p.parsers (base_p); - - xml_schema::document doc_p (type_p, "test", "root", true); - - type_p.pre (); - doc_p.parse (argv[1]); - type_p.post_type (); - } - 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/tests/cxx/parser/polymorphism/same-type/makefile b/tests/cxx/parser/polymorphism/same-type/makefile deleted file mode 100644 index 588d8b6..0000000 --- a/tests/cxx/parser/polymorphism/same-type/makefile +++ /dev/null @@ -1,83 +0,0 @@ -# file : tests/cxx/parser/polymorphism/same-type/makefile -# 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=-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/tests/cxx/parser/polymorphism/same-type/output b/tests/cxx/parser/polymorphism/same-type/output deleted file mode 100644 index d418277..0000000 --- a/tests/cxx/parser/polymorphism/same-type/output +++ /dev/null @@ -1,4 +0,0 @@ -a1 -a2 -a3 -a4 diff --git a/tests/cxx/parser/polymorphism/same-type/test.xml b/tests/cxx/parser/polymorphism/same-type/test.xml deleted file mode 100644 index f8b6d1e..0000000 --- a/tests/cxx/parser/polymorphism/same-type/test.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - a1 - a2 - a3 - a4 - - diff --git a/tests/cxx/parser/polymorphism/same-type/test.xsd b/tests/cxx/parser/polymorphism/same-type/test.xsd deleted file mode 100644 index a4157d3..0000000 --- a/tests/cxx/parser/polymorphism/same-type/test.xsd +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/cxx/parser/recursive/driver.cxx b/tests/cxx/parser/recursive/driver.cxx deleted file mode 100644 index 39c6621..0000000 --- a/tests/cxx/parser/recursive/driver.cxx +++ /dev/null @@ -1,139 +0,0 @@ -// file : tests/cxx/parser/recursive/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test recursive parser invocation. -// - -#include -#include - -#include "test-pskel.hxx" - -using namespace std; - -struct sub_pimpl: sub_type_pskel -{ - virtual void - pre () - { - cout << "sub::pre" << endl; - } - - virtual void - sub () - { - cout << "sub::sub" << endl; - } - - virtual void - sub2 () - { - cout << "sub::sub2" << endl; - } - - virtual void - name (string const& n) - { - cout << "sub::name: " << n << endl; - } - - virtual void - post_sub_type () - { - cout << "sub::post" << endl; - } -}; - -struct indir_pimpl: indir_type_pskel -{ - virtual void - pre () - { - cout << "indir::pre" << endl; - } - - virtual void - sub () - { - cout << "indir::sub" << endl; - } - - virtual void - name (string const& n) - { - cout << "indir::name: " << n << endl; - } - - virtual void - post_indir_type () - { - cout << "indir::post" << endl; - } -}; - -struct test_pimpl: test_type_pskel -{ - virtual void - pre () - { - cout << "test::pre" << endl; - } - - virtual void - sub () - { - cout << "test::sub" << endl; - } - - virtual void - name (string const& n) - { - cout << "test::name: " << n << endl; - } - - virtual void - post_test_type () - { - cout << "test::post" << endl; - } -}; - - -int -main (int argc, char* argv[]) -{ - if (argc != 2) - { - cerr << "usage: " << argv[0] << " test.xml" << endl; - return 1; - } - - try - { - xml_schema::string_pimpl string_p; - - sub_pimpl sub_p; - indir_pimpl indir_p; - test_pimpl test_p; - - sub_p.parsers (sub_p, indir_p, sub_p, string_p); - indir_p.parsers (sub_p, string_p); - test_p.parsers (sub_p, string_p); - - xml_schema::document doc_p (test_p, "test"); - - test_p.pre (); - doc_p.parse (argv[1]); - test_p.post_test_type (); - } - catch (xml_schema::exception const& e) - { - cerr << e << endl; - return 1; - } - catch (ios_base::failure const&) - { - cerr << "io failure" << endl; - return 1; - } -} diff --git a/tests/cxx/parser/recursive/makefile b/tests/cxx/parser/recursive/makefile deleted file mode 100644 index a1bc9ab..0000000 --- a/tests/cxx/parser/recursive/makefile +++ /dev/null @@ -1,83 +0,0 @@ -# file : tests/cxx/parser/recursive/makefile -# 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=-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-validation -$(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/tests/cxx/parser/recursive/output b/tests/cxx/parser/recursive/output deleted file mode 100644 index f26fb72..0000000 --- a/tests/cxx/parser/recursive/output +++ /dev/null @@ -1,22 +0,0 @@ -test::pre -test::name: testName -sub::pre -sub::name: subName -sub::pre -sub::name: sub-subName -sub::post -sub::sub -indir::pre -indir::name: sub-indirName -sub::pre -sub::name: sub-indir-subName -sub::post -indir::sub -indir::post -sub::pre -sub::name: sub-sub2Name -sub::post -sub::sub2 -sub::post -test::sub -test::post diff --git a/tests/cxx/parser/recursive/test.xml b/tests/cxx/parser/recursive/test.xml deleted file mode 100644 index f6c219d..0000000 --- a/tests/cxx/parser/recursive/test.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - diff --git a/tests/cxx/parser/recursive/test.xsd b/tests/cxx/parser/recursive/test.xsd deleted file mode 100644 index 33e1d2d..0000000 --- a/tests/cxx/parser/recursive/test.xsd +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/cxx/parser/test-template/driver.cxx b/tests/cxx/parser/test-template/driver.cxx deleted file mode 100644 index 9f56496..0000000 --- a/tests/cxx/parser/test-template/driver.cxx +++ /dev/null @@ -1,66 +0,0 @@ -// file : tests/cxx/parser/test-template/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Insert test description here. -// - -#include -#include - -#include "test-pskel.hxx" - -using namespace std; -using namespace test; - -struct type_pimpl: type_pskel -{ - virtual void - pre () - { - } - - virtual void - a (string const& v) - { - cout << v << endl; - } - - virtual void - post_type () - { - } -}; - -int -main (int argc, char* argv[]) -{ - if (argc != 2) - { - cerr << "usage: " << argv[0] << " test.xml" << endl; - return 1; - } - - try - { - xml_schema::string_pimpl string_p; - type_pimpl type_p; - - type_p.parsers (string_p); - - xml_schema::document doc_p (type_p, "test", "root"); - - type_p.pre (); - doc_p.parse (argv[1]); - type_p.post_type (); - } - 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/tests/cxx/parser/test-template/makefile b/tests/cxx/parser/test-template/makefile deleted file mode 100644 index b680466..0000000 --- a/tests/cxx/parser/test-template/makefile +++ /dev/null @@ -1,82 +0,0 @@ -# file : tests/cxx/parser/test-template/makefile -# 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=-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): $(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/tests/cxx/parser/test-template/output b/tests/cxx/parser/test-template/output deleted file mode 100644 index 7898192..0000000 --- a/tests/cxx/parser/test-template/output +++ /dev/null @@ -1 +0,0 @@ -a diff --git a/tests/cxx/parser/test-template/test.xml b/tests/cxx/parser/test-template/test.xml deleted file mode 100644 index 624a80c..0000000 --- a/tests/cxx/parser/test-template/test.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - a - - diff --git a/tests/cxx/parser/test-template/test.xsd b/tests/cxx/parser/test-template/test.xsd deleted file mode 100644 index 07bebc7..0000000 --- a/tests/cxx/parser/test-template/test.xsd +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/tests/cxx/parser/union/driver.cxx b/tests/cxx/parser/union/driver.cxx deleted file mode 100644 index 5577f78..0000000 --- a/tests/cxx/parser/union/driver.cxx +++ /dev/null @@ -1,60 +0,0 @@ -// file : tests/cxx/parser/union/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test xsd:union parsing. -// - -#include -#include - -#include "test-pskel.hxx" - -using namespace std; -using namespace test; - -struct int_string_union_pimpl: int_string_union_pskel -{ - virtual void - _characters (const xml_schema::ro_string& s) - { - cout << "'" << s << "'" << endl; - } -}; - -struct type_pimpl: type_pskel -{ -}; - -int -main (int argc, char* argv[]) -{ - if (argc != 2) - { - cerr << "usage: " << argv[0] << " test.xml" << endl; - return 1; - } - - try - { - int_string_union_pimpl int_string_union_p; - type_pimpl type_p; - - type_p.parsers (int_string_union_p); - - xml_schema::document doc_p (type_p, "test", "root"); - - type_p.pre (); - doc_p.parse (argv[1]); - type_p.post_type (); - } - 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/tests/cxx/parser/union/makefile b/tests/cxx/parser/union/makefile deleted file mode 100644 index a8e70f6..0000000 --- a/tests/cxx/parser/union/makefile +++ /dev/null @@ -1,82 +0,0 @@ -# file : tests/cxx/parser/union/makefile -# 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=-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): $(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/tests/cxx/parser/union/output b/tests/cxx/parser/union/output deleted file mode 100644 index a92ffc3..0000000 --- a/tests/cxx/parser/union/output +++ /dev/null @@ -1,2 +0,0 @@ -'one' -'1' diff --git a/tests/cxx/parser/union/test.xml b/tests/cxx/parser/union/test.xml deleted file mode 100644 index 5b3e799..0000000 --- a/tests/cxx/parser/union/test.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - one - 1 - - diff --git a/tests/cxx/parser/union/test.xsd b/tests/cxx/parser/union/test.xsd deleted file mode 100644 index 5bf3d47..0000000 --- a/tests/cxx/parser/union/test.xsd +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/tests/cxx/parser/validation/all/driver.cxx b/tests/cxx/parser/validation/all/driver.cxx deleted file mode 100644 index 093d480..0000000 --- a/tests/cxx/parser/validation/all/driver.cxx +++ /dev/null @@ -1,98 +0,0 @@ -// file : tests/cxx/parser/validation/all/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test the all compositor validation. -// - -#include -#include -#include - -#include "test-pskel.hxx" - -using namespace std; -using namespace test; - -struct all_pimpl: all_pskel -{ - virtual void - pre () - { - cout << "{" << endl; - } - - virtual void - a (string const& v) - { - cout << " a = " << v << endl; - } - - virtual void - b (string const& v) - { - cout << " b = " << v << endl; - } - - virtual void - c (string const& v) - { - cout << " c = " << v << endl; - } - - virtual void - post_all () - { - cout << "}" << endl - << endl; - } -}; - -struct type_pimpl: type_pskel -{ -}; - -int -main (int argc, char* argv[]) -{ - if (argc != 2) - { - cerr << "usage: " << argv[0] << " test.xml" << endl; - return 1; - } - - try - { - xml_schema::string_pimpl string_p; - all_pimpl all_p; - type_pimpl type_p; - - all_p.parsers (string_p, string_p, string_p); - type_p.parsers (all_p); - - xml_schema::document doc_p (type_p, "test", "root"); - - try - { - ifstream ifs (argv[1]); - type_p.pre (); - doc_p.parse (ifs, argv[1], "", xml_schema::flags::dont_validate); - type_p.post_type (); - } - catch (xml_schema::exception const& e) - { - cout << " " << e << endl - << "}" << endl - << endl; - } - } - catch (xml_schema::exception const& e) - { - cerr << e << endl; - return 1; - } - catch (ios_base::failure const&) - { - cerr << "io failure" << endl; - return 1; - } -} diff --git a/tests/cxx/parser/validation/all/makefile b/tests/cxx/parser/validation/all/makefile deleted file mode 100644 index b50e067..0000000 --- a/tests/cxx/parser/validation/all/makefile +++ /dev/null @@ -1,92 +0,0 @@ -# file : tests/cxx/parser/validation/all/makefile -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make - -xsd := test.xsd -cxx := driver.cxx - -tests := 000 001 002 003 - -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-validation -$(gen): $(out_root)/xsd/xsd - -$(call include-dep,$(dep),$(obj),$(gen)) - - -# Convenience alias for default target. -# -$(out_base)/: $(driver) - - -# Test. -# -test_targets := $(addprefix $(out_base)/.test-,$(tests)) - -$(test): $(test_targets) -$(test_targets): driver := $(driver) - -.PHONY: $(out_base)/.test-% -$(out_base)/.test-%: $(driver) $(src_base)/test.xsd $(src_base)/test-%.xml $(src_base)/test-%.std - $(call message,test $(out_base)/$*,$(driver) $(src_base)/test-$*.xml | diff -u $(src_base)/test-$*.std -) - - -# 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/tests/cxx/parser/validation/all/test-000.std b/tests/cxx/parser/validation/all/test-000.std deleted file mode 100644 index b4445f2..0000000 --- a/tests/cxx/parser/validation/all/test-000.std +++ /dev/null @@ -1,46 +0,0 @@ -{ - a = a - b = b - c = c -} - -{ - a = a - c = c - b = b -} - -{ - b = b - a = a - c = c -} - -{ - b = b - c = c - a = a -} - -{ - c = c - a = a - b = b -} - -{ - c = c - b = b - a = a -} - -{ - a = a - b = b -} - -{ - a = a - b = b -} - diff --git a/tests/cxx/parser/validation/all/test-000.xml b/tests/cxx/parser/validation/all/test-000.xml deleted file mode 100644 index 6e46fae..0000000 --- a/tests/cxx/parser/validation/all/test-000.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - a - b - c - - - - a - c - b - - - - b - a - c - - - - b - c - a - - - - c - a - b - - - - c - b - a - - - - - a - b - - - - a - b - - - diff --git a/tests/cxx/parser/validation/all/test-001.std b/tests/cxx/parser/validation/all/test-001.std deleted file mode 100644 index 0472ad9..0000000 --- a/tests/cxx/parser/validation/all/test-001.std +++ /dev/null @@ -1,6 +0,0 @@ -{ - a = a - c = c - :9:9 error: expected element 'b' -} - diff --git a/tests/cxx/parser/validation/all/test-001.xml b/tests/cxx/parser/validation/all/test-001.xml deleted file mode 100644 index 3df5600..0000000 --- a/tests/cxx/parser/validation/all/test-001.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - a - c - - - diff --git a/tests/cxx/parser/validation/all/test-002.std b/tests/cxx/parser/validation/all/test-002.std deleted file mode 100644 index c014230..0000000 --- a/tests/cxx/parser/validation/all/test-002.std +++ /dev/null @@ -1,4 +0,0 @@ -{ - :7:9 error: expected element 'a' -} - diff --git a/tests/cxx/parser/validation/all/test-002.xml b/tests/cxx/parser/validation/all/test-002.xml deleted file mode 100644 index aed0c0c..0000000 --- a/tests/cxx/parser/validation/all/test-002.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - diff --git a/tests/cxx/parser/validation/all/test-003.std b/tests/cxx/parser/validation/all/test-003.std deleted file mode 100644 index dd8c0d3..0000000 --- a/tests/cxx/parser/validation/all/test-003.std +++ /dev/null @@ -1,6 +0,0 @@ -{ - a = a - b = b - :9:7 error: unexpected element 'a' -} - diff --git a/tests/cxx/parser/validation/all/test-003.xml b/tests/cxx/parser/validation/all/test-003.xml deleted file mode 100644 index b147cba..0000000 --- a/tests/cxx/parser/validation/all/test-003.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - a - b - a - - - diff --git a/tests/cxx/parser/validation/all/test.xsd b/tests/cxx/parser/validation/all/test.xsd deleted file mode 100644 index 1f670e3..0000000 --- a/tests/cxx/parser/validation/all/test.xsd +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/tests/cxx/parser/validation/any/driver.cxx b/tests/cxx/parser/validation/any/driver.cxx deleted file mode 100644 index 3896598..0000000 --- a/tests/cxx/parser/validation/any/driver.cxx +++ /dev/null @@ -1,121 +0,0 @@ -// file : tests/cxx/parser/validation/any/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test the any particle validation. -// - -#include -#include -#include - -#include "test-pskel.hxx" - -using namespace std; -using namespace test; -using xml_schema::ro_string; - -struct any_a_pimpl: any_a_pskel -{ - virtual void - pre () - { - cout << "{" << endl; - } - - virtual void - a (string const& v) - { - cout << " a = " << v << endl; - } - - virtual void - x (string const& v) - { - cout << " x = " << v << endl; - } - - virtual void - _start_any_element (ro_string const&, - ro_string const& n, - ro_string const*) - { - cout << " start any element '" << n << "'" << endl; - } - - virtual void - _end_any_element (ro_string const&, ro_string const& n) - { - cout << " end any element '" << n << "'" << endl; - } - - virtual void - _any_attribute (ro_string const&, - ro_string const& n, - ro_string const& v) - { - cout << " any attribute " << n << " = '" << v << "'" << endl; - } - - virtual void - _any_characters (ro_string const& s) - { - cout << " any text: '" << s << "'" << endl; - } - - virtual void - post_any_a () - { - cout << "}" << endl - << endl; - } -}; - -struct type_pimpl: type_pskel -{ -}; - -int -main (int argc, char* argv[]) -{ - if (argc != 2) - { - cerr << "usage: " << argv[0] << " test.xml" << endl; - return 1; - } - - try - { - xml_schema::string_pimpl string_p; - any_a_pimpl any_a_p; - type_pimpl type_p; - - any_a_p.parsers (string_p, string_p); - type_p.parsers (any_a_p); - - xml_schema::document doc_p (type_p, "test", "root"); - - try - { - ifstream ifs (argv[1]); - type_p.pre (); - doc_p.parse (ifs, argv[1], "", xml_schema::flags::dont_validate); - type_p.post_type (); - } - catch (xml_schema::exception const& e) - { - cout << " " << e << endl - << "}" << endl - << endl; - } - } - catch (xml_schema::exception const& e) - { - cerr << e << endl; - return 1; - } - catch (ios_base::failure const&) - { - cerr << "io failure" << endl; - return 1; - } -} diff --git a/tests/cxx/parser/validation/any/makefile b/tests/cxx/parser/validation/any/makefile deleted file mode 100644 index fe3cdab..0000000 --- a/tests/cxx/parser/validation/any/makefile +++ /dev/null @@ -1,92 +0,0 @@ -# file : tests/cxx/parser/validation/any/makefile -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make - -xsd := test.xsd -cxx := driver.cxx - -tests := 000 - -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-validation -$(gen): $(out_root)/xsd/xsd - -$(call include-dep,$(dep),$(obj),$(gen)) - - -# Convenience alias for default target. -# -$(out_base)/: $(driver) - - -# Test. -# -test_targets := $(addprefix $(out_base)/.test-,$(tests)) - -$(test): $(test_targets) -$(test_targets): driver := $(driver) - -.PHONY: $(out_base)/.test-% -$(out_base)/.test-%: $(driver) $(src_base)/test.xsd $(src_base)/test-%.xml $(src_base)/test-%.std - $(call message,test $(out_base)/$*,$(driver) $(src_base)/test-$*.xml | diff -u $(src_base)/test-$*.std -) - - -# 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/tests/cxx/parser/validation/any/test-000.std b/tests/cxx/parser/validation/any/test-000.std deleted file mode 100644 index a1cc6e3..0000000 --- a/tests/cxx/parser/validation/any/test-000.std +++ /dev/null @@ -1,29 +0,0 @@ -{ - start any element 'any' - end any element 'any' -} - -{ - start any element 'any' - any attribute x = 'xxx' - any text: 'aaa' - start any element 'a' - any text: 'bbb' - end any element 'a' - any text: 'ccc' - end any element 'any' -} - -{ - x = x - a = a - start any element 'any' - any attribute x = 'xxx' - any text: 'aaa' - start any element 'a' - any text: 'bbb' - end any element 'a' - any text: 'ccc' - end any element 'any' -} - diff --git a/tests/cxx/parser/validation/any/test-000.xml b/tests/cxx/parser/validation/any/test-000.xml deleted file mode 100644 index f1a0c83..0000000 --- a/tests/cxx/parser/validation/any/test-000.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - aaabbbccc - - - - a - aaabbbccc - - - diff --git a/tests/cxx/parser/validation/any/test.xsd b/tests/cxx/parser/validation/any/test.xsd deleted file mode 100644 index c05aeb5..0000000 --- a/tests/cxx/parser/validation/any/test.xsd +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/tests/cxx/parser/validation/attribute/driver.cxx b/tests/cxx/parser/validation/attribute/driver.cxx deleted file mode 100644 index 8eda713..0000000 --- a/tests/cxx/parser/validation/attribute/driver.cxx +++ /dev/null @@ -1,197 +0,0 @@ -// file : tests/cxx/parser/validation/attribute/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test attribute and attribute wildcard (anyAttribute) validation. -// - -#include -#include -#include - -#include "test-pskel.hxx" - -using namespace std; -using namespace test; -using xml_schema::ro_string; - -struct pass_a_pimpl: pass_a_pskel -{ - virtual void - pre () - { - cout << "pass-a" << endl - << "{" << endl; - } - - virtual void - a (string const& v) - { - cout << " a = " << v << endl; - } - - virtual void - b (string const& v) - { - cout << " b = " << v << endl; - } - - virtual void - _any_attribute (ro_string const& ns, - ro_string const& name, - ro_string const& value) - { - cout << " any: " << ns << "#" << name << " = " << value << endl; - } - - virtual void - post_pass_a () - { - cout << "}" << endl - << endl; - } -}; - -struct pass_b_pimpl: pass_b_pskel -{ - virtual void - pre () - { - cout << "pass-b" << endl - << "{" << endl; - } - - virtual void - a (string const& v) - { - cout << " a = " << v << endl; - } - - virtual void - b (string const& v) - { - cout << " b = " << v << endl; - } - - virtual void - _any_attribute (ro_string const& ns, - ro_string const& name, - ro_string const& value) - { - cout << " any: " << ns << "#" << name << " = " << value << endl; - } - - virtual void - post_pass_b () - { - cout << "}" << endl - << endl; - } -}; - -struct pass_c_pimpl: pass_c_pskel -{ - virtual void - pre () - { - cout << "pass-c" << endl - << "{" << endl; - } - - virtual void - a (string const& v) - { - cout << " a = " << v << endl; - } - - virtual void - b (string const& v) - { - cout << " b = " << v << endl; - } - - virtual void - post_pass_c () - { - cout << "}" << endl - << endl; - } -}; - -struct fail_pimpl: fail_pskel -{ - virtual void - pre () - { - cout << "fail" << endl - << "{" << endl; - } - - virtual void - a (string const& v) - { - cout << " a = " << v << endl; - } - - virtual void - post_fail () - { - cout << "}" << endl - << endl; - } -}; - -struct type_pimpl: type_pskel -{ -}; - -int -main (int argc, char* argv[]) -{ - if (argc != 2) - { - cerr << "usage: " << argv[0] << " test.xml" << endl; - return 1; - } - - try - { - xml_schema::string_pimpl string_p; - pass_a_pimpl pass_a_p; - pass_b_pimpl pass_b_p; - pass_c_pimpl pass_c_p; - fail_pimpl fail_p; - type_pimpl type_p; - - pass_a_p.parsers (string_p, string_p); - pass_b_p.parsers (string_p, string_p); - pass_c_p.parsers (string_p, string_p); - fail_p.parsers (string_p); - type_p.parsers (pass_a_p, pass_b_p, pass_c_p, fail_p); - - xml_schema::document doc_p (type_p, "test", "root"); - - try - { - ifstream ifs (argv[1]); - type_p.pre (); - doc_p.parse (ifs, argv[1], "", xml_schema::flags::dont_validate); - type_p.post_type (); - } - catch (xml_schema::exception const& e) - { - cout << " " << e << endl - << "}" << endl - << endl; - } - } - catch (xml_schema::exception const& e) - { - cerr << e << endl; - return 1; - } - catch (ios_base::failure const&) - { - cerr << "io failure" << endl; - return 1; - } -} diff --git a/tests/cxx/parser/validation/attribute/makefile b/tests/cxx/parser/validation/attribute/makefile deleted file mode 100644 index d92bf1d..0000000 --- a/tests/cxx/parser/validation/attribute/makefile +++ /dev/null @@ -1,92 +0,0 @@ -# file : tests/cxx/parser/validation/attribute/makefile -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make - -xsd := test.xsd -cxx := driver.cxx - -tests := 000 - -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-validation -$(gen): $(out_root)/xsd/xsd - -$(call include-dep,$(dep),$(obj),$(gen)) - - -# Convenience alias for default target. -# -$(out_base)/: $(driver) - - -# Test. -# -test_targets := $(addprefix $(out_base)/.test-,$(tests)) - -$(test): $(test_targets) -$(test_targets): driver := $(driver) - -.PHONY: $(out_base)/.test-% -$(out_base)/.test-%: $(driver) $(src_base)/test.xsd $(src_base)/test-%.xml $(src_base)/test-%.std - $(call message,test $(out_base)/$*,$(driver) $(src_base)/test-$*.xml | diff -u $(src_base)/test-$*.std -) - - -# 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/tests/cxx/parser/validation/attribute/test-000.std b/tests/cxx/parser/validation/attribute/test-000.std deleted file mode 100644 index 847b054..0000000 --- a/tests/cxx/parser/validation/attribute/test-000.std +++ /dev/null @@ -1,24 +0,0 @@ -pass-a -{ - b = b - any: test#foo = foo - any: test#bar = bar -} - -pass-b -{ - a = a - b = b -} - -pass-c -{ - a = a - b = b -} - -fail -{ - :8:10 error: expected attribute 'a' -} - diff --git a/tests/cxx/parser/validation/attribute/test-000.xml b/tests/cxx/parser/validation/attribute/test-000.xml deleted file mode 100644 index b994d1a..0000000 --- a/tests/cxx/parser/validation/attribute/test-000.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - diff --git a/tests/cxx/parser/validation/attribute/test.xsd b/tests/cxx/parser/validation/attribute/test.xsd deleted file mode 100644 index 833eb8e..0000000 --- a/tests/cxx/parser/validation/attribute/test.xsd +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/cxx/parser/validation/built-in/any-type/driver.cxx b/tests/cxx/parser/validation/built-in/any-type/driver.cxx deleted file mode 100644 index fd91247..0000000 --- a/tests/cxx/parser/validation/built-in/any-type/driver.cxx +++ /dev/null @@ -1,154 +0,0 @@ -// file : tests/cxx/parser/validation/built-in/any-type/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test the anyType and anySimpleType validation. -// - -#include -#include -#include - -#include "test-pskel.hxx" - -using namespace std; -using namespace test; -using xml_schema::ro_string; - -struct any_type_pimpl: xml_schema::any_type_pimpl -{ - virtual void - pre () - { - cout << "{" << endl; - } - - virtual void - _start_any_element (ro_string const&, - ro_string const& n, - ro_string const*) - { - cout << " start any element '" << n << "'" << endl; - } - - virtual void - _end_any_element (ro_string const&, ro_string const& n) - { - cout << " end any element '" << n << "'" << endl; - } - - virtual void - _any_attribute (ro_string const&, - ro_string const& n, - ro_string const& v) - { - cout << " any attribute " << n << " = '" << v << "'" << endl; - } - - virtual void - _any_characters (ro_string const& s) - { - cout << " any text: '" << s << "'" << endl; - } - - virtual void - post_any_type () - { - cout << "}" << endl - << endl; - } -}; - -struct any_simple_type_pimpl: xml_schema::any_simple_type_pimpl -{ - virtual void - pre () - { - cout << "{" << endl; - } - - virtual void - _any_characters (ro_string const& s) - { - cout << " any text: '" << s << "'" << endl; - } - - virtual void - post_any_simple_type () - { - cout << "}" << endl - << endl; - } -}; - -struct any_extension_pimpl: virtual any_extension_pskel, - any_type_pimpl - -{ - virtual void - x (const string& v) - { - cout << " x = " << v << endl; - } -}; - -struct any_simple_extension_pimpl: virtual any_simple_extension_pskel, - any_simple_type_pimpl -{ - virtual void - x (const string& v) - { - cout << " x = " << v << endl; - } -}; - -struct type_pimpl: type_pskel -{ -}; - -int -main (int argc, char* argv[]) -{ - if (argc != 2) - { - cerr << "usage: " << argv[0] << " test.xml" << endl; - return 1; - } - - try - { - xml_schema::string_pimpl string_p; - - any_type_pimpl any_type_p; - any_simple_type_pimpl any_simple_type_p; - - any_extension_pimpl any_extension_p; - any_simple_extension_pimpl any_simple_extension_p; - - type_pimpl type_p; - - any_extension_p.parsers (string_p); - any_simple_extension_p.parsers (string_p); - - type_p.parsers (any_type_p, - any_extension_p, - any_simple_extension_p, - any_simple_type_p); - - xml_schema::document doc_p (type_p, "test", "root"); - - ifstream ifs (argv[1]); - type_p.pre (); - doc_p.parse (ifs, argv[1], "", xml_schema::flags::dont_validate); - type_p.post_type (); - } - catch (xml_schema::exception const& e) - { - cerr << e << endl; - return 1; - } - catch (ios_base::failure const&) - { - cerr << "io failure" << endl; - return 1; - } -} diff --git a/tests/cxx/parser/validation/built-in/any-type/makefile b/tests/cxx/parser/validation/built-in/any-type/makefile deleted file mode 100644 index dfbb183..0000000 --- a/tests/cxx/parser/validation/built-in/any-type/makefile +++ /dev/null @@ -1,92 +0,0 @@ -# file : tests/cxx/parser/validation/built-in/any-type/makefile -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make - -xsd := test.xsd -cxx := driver.cxx - -tests := 000 - -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-validation -$(gen): $(out_root)/xsd/xsd - -$(call include-dep,$(dep),$(obj),$(gen)) - - -# Convenience alias for default target. -# -$(out_base)/: $(driver) - - -# Test. -# -test_targets := $(addprefix $(out_base)/.test-,$(tests)) - -$(test): $(test_targets) -$(test_targets): driver := $(driver) - -.PHONY: $(out_base)/.test-% -$(out_base)/.test-%: $(driver) $(src_base)/test.xsd $(src_base)/test-%.xml $(src_base)/test-%.std - $(call message,test $(out_base)/$*,$(driver) $(src_base)/test-$*.xml | diff -u $(src_base)/test-$*.std -) - - -# 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/tests/cxx/parser/validation/built-in/any-type/test-000.std b/tests/cxx/parser/validation/built-in/any-type/test-000.std deleted file mode 100644 index 84d7b3a..0000000 --- a/tests/cxx/parser/validation/built-in/any-type/test-000.std +++ /dev/null @@ -1,99 +0,0 @@ -{ - any text: '123abc' -} - -{ - any text: ' - ' - start any element 'any' - end any element 'any' - any text: ' - ' -} - -{ - any text: ' - ' - start any element 'any' - any attribute x = 'xxx' - any text: 'aaa' - start any element 'a' - any text: 'bbb' - end any element 'a' - any text: 'ccc' - end any element 'any' - any text: ' - ' -} - -{ - any attribute x = 'x' - any text: ' - ' - start any element 'a' - any text: 'a' - end any element 'a' - any text: ' - ' - start any element 'any' - any attribute x = 'xxx' - any text: 'aaa' - start any element 'a' - any text: 'bbb' - end any element 'a' - any text: 'ccc' - end any element 'any' - any text: ' - ' -} - -{ - any text: ' - ' - start any element 'any' - end any element 'any' - any text: ' - ' -} - -{ - any text: ' - ' - start any element 'any' - any attribute x = 'xxx' - any text: 'aaa' - start any element 'a' - any text: 'bbb' - end any element 'a' - any text: 'ccc' - end any element 'any' - any text: ' - ' -} - -{ - x = x - any text: ' - ' - start any element 'a' - any text: 'a' - end any element 'a' - any text: ' - ' - start any element 'any' - any attribute x = 'xxx' - any text: 'aaa' - start any element 'a' - any text: 'bbb' - end any element 'a' - any text: 'ccc' - end any element 'any' - any text: ' - ' -} - -{ - x = x - any text: 'abc123' -} - diff --git a/tests/cxx/parser/validation/built-in/any-type/test-000.xml b/tests/cxx/parser/validation/built-in/any-type/test-000.xml deleted file mode 100644 index 7875b7e..0000000 --- a/tests/cxx/parser/validation/built-in/any-type/test-000.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - aaabbbccc - - - - a - aaabbbccc - - - - - - - - - - aaabbbccc - - - - a - aaabbbccc - - - - - abc123 - - diff --git a/tests/cxx/parser/validation/built-in/any-type/test.xsd b/tests/cxx/parser/validation/built-in/any-type/test.xsd deleted file mode 100644 index 86a4e13..0000000 --- a/tests/cxx/parser/validation/built-in/any-type/test.xsd +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/cxx/parser/validation/built-in/binary/driver.cxx b/tests/cxx/parser/validation/built-in/binary/driver.cxx deleted file mode 100644 index 86575f4..0000000 --- a/tests/cxx/parser/validation/built-in/binary/driver.cxx +++ /dev/null @@ -1,153 +0,0 @@ -// file : tests/cxx/parser/validation/built-in/binary/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test the built-in base64Binary and hexBinary types validation. -// -#include - -#include -#include - -using namespace xsd::cxx::parser::validating; - -template -bool -test_post_fail (T& p) -{ - try - { - p._post (); - } - catch (invalid_value const&) - { - return true; - } - - return false; -} - -int -main () -{ - typedef xsd::cxx::parser::buffer buffer; - - // Good. - // - - // hexBinary - // - { - hex_binary_pimpl p; - p.pre (); - p._pre (); - p._characters (" \t\n "); - p._characters (" "); - p._post (); - assert (*p.post_hex_binary () == buffer ()); - } - - { - hex_binary_pimpl p; - p.pre (); - p._pre (); - p._characters (" \t\n313"); - p._characters ("23334356162636a6b "); - p._post (); - assert (*p.post_hex_binary () == buffer ("12345abcjk", 10)); - } - - // base64Binary - // - { - base64_binary_pimpl p; - p.pre (); - p._pre (); - p._characters (" \t\n "); - p._characters ("MTIzND "); - p._characters ("VhYmNqaw = = "); - p._post (); - assert (*p.post_base64_binary () == buffer ("12345abcjk", 10)); - } - - { - base64_binary_pimpl p; - p.pre (); - p._pre (); - p._characters ("YQ=="); - p._post (); - assert (*p.post_base64_binary () == buffer ("a", 1)); - } - - { - base64_binary_pimpl p; - p.pre (); - p._pre (); - p._characters ("YWI="); - p._post (); - assert (*p.post_base64_binary () == buffer ("ab", 2)); - } - - { - base64_binary_pimpl p; - p.pre (); - p._pre (); - p._characters ("YWJj"); - p._post (); - assert (*p.post_base64_binary () == buffer ("abc", 3)); - } - - // Bad - // - - // hexBinary - // - { - hex_binary_pimpl p; - p.pre (); - p._pre (); - p._characters ("313"); - assert (test_post_fail (p)); - } - - { - hex_binary_pimpl p; - p.pre (); - p._pre (); - p._characters ("313233343X6162636a6b"); - assert (test_post_fail (p)); - } - - // base64Binary - // - { - base64_binary_pimpl p; - p.pre (); - p._pre (); - // p._characters (""); - assert (test_post_fail (p)); - } - - { - base64_binary_pimpl p; - p.pre (); - p._pre (); - p._characters ("YQ"); - assert (test_post_fail (p)); - } - - { - base64_binary_pimpl p; - p.pre (); - p._pre (); - p._characters ("=="); - assert (test_post_fail (p)); - } - - { - base64_binary_pimpl p; - p.pre (); - p._pre (); - p._characters ("MTIzNDVhYmNqaw=A"); - assert (test_post_fail (p)); - } -} diff --git a/tests/cxx/parser/validation/built-in/binary/makefile b/tests/cxx/parser/validation/built-in/binary/makefile deleted file mode 100644 index f0c5ae6..0000000 --- a/tests/cxx/parser/validation/built-in/binary/makefile +++ /dev/null @@ -1,70 +0,0 @@ -# file : tests/cxx/parser/validation/built-in/binary/makefile -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make - -cxx := driver.cxx - -obj := $(addprefix $(out_base)/,$(cxx:.cxx=.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 - -$(call include-dep,$(dep),$(obj),$(gen)) - -# Convenience alias for default target. -# -$(out_base)/: $(driver) - - -# Test. -# -$(test): driver := $(driver) -$(test): $(driver) - $(call message,test $$1,$$1,$(driver)) - -# Clean. -# -$(clean): $(driver).o.clean \ - $(addsuffix .cxx.clean,$(obj)) \ - $(addsuffix .cxx.clean,$(dep)) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(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) diff --git a/tests/cxx/parser/validation/built-in/boolean/driver.cxx b/tests/cxx/parser/validation/built-in/boolean/driver.cxx deleted file mode 100644 index 6a21cb7..0000000 --- a/tests/cxx/parser/validation/built-in/boolean/driver.cxx +++ /dev/null @@ -1,145 +0,0 @@ -// file : tests/cxx/parser/validation/built-in/boolean/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test the built-in boolean type validation. -// -#include - -#include -#include - -using namespace xsd::cxx::parser::validating; - -bool -test_post_fail (boolean_pimpl& p) -{ - try - { - p._post (); - } - catch (invalid_value const&) - { - return true; - } - - return false; -} - -int -main () -{ - // Good. - // - { - boolean_pimpl p; - p.pre (); - p._pre (); - p._characters ("true"); - p._post (); - assert (p.post_boolean ()); - } - - { - boolean_pimpl p; - p.pre (); - p._pre (); - p._characters ("1"); - p._post (); - assert (p.post_boolean ()); - } - - { - boolean_pimpl p; - p.pre (); - p._pre (); - p._characters ("false"); - p._post (); - assert (!p.post_boolean ()); - } - - { - boolean_pimpl p; - p.pre (); - p._pre (); - p._characters ("0"); - p._post (); - assert (!p.post_boolean ()); - } - - - { - boolean_pimpl p; - p.pre (); - p._pre (); - p._characters (" true "); - p._post (); - assert (p.post_boolean ()); - } - - { - boolean_pimpl p; - p.pre (); - p._pre (); - p._characters (" "); - p._characters (" \n "); - p._characters (" fa"); - p._characters ("l"); - p._characters ("se "); - p._characters (" \n "); - p._characters (" "); - p._post (); - assert (!p.post_boolean ()); - } - - // Bad - // - { - boolean_pimpl p; - p.pre (); - p._pre (); - //p._characters (""); - assert (test_post_fail (p)); - } - - { - boolean_pimpl p; - p.pre (); - p._pre (); - p._characters (""); - assert (test_post_fail (p)); - } - - { - boolean_pimpl p; - p.pre (); - p._pre (); - p._characters (" "); - assert (test_post_fail (p)); - } - - { - boolean_pimpl p; - p.pre (); - p._pre (); - p._characters (" "); - assert (test_post_fail (p)); - } - - { - boolean_pimpl p; - p.pre (); - p._pre (); - p._characters ("fal"); - p._characters ("s "); - p._characters ("e"); - assert (test_post_fail (p)); - } - - { - boolean_pimpl p; - p.pre (); - p._pre (); - p._characters ("01"); - assert (test_post_fail (p)); - } -} diff --git a/tests/cxx/parser/validation/built-in/boolean/makefile b/tests/cxx/parser/validation/built-in/boolean/makefile deleted file mode 100644 index 52f4e88..0000000 --- a/tests/cxx/parser/validation/built-in/boolean/makefile +++ /dev/null @@ -1,70 +0,0 @@ -# file : tests/cxx/parser/validation/built-in/boolean/makefile -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make - -cxx := driver.cxx - -obj := $(addprefix $(out_base)/,$(cxx:.cxx=.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 - -$(call include-dep,$(dep),$(obj),$(gen)) - -# Convenience alias for default target. -# -$(out_base)/: $(driver) - - -# Test. -# -$(test): driver := $(driver) -$(test): $(driver) - $(call message,test $$1,$$1,$(driver)) - -# Clean. -# -$(clean): $(driver).o.clean \ - $(addsuffix .cxx.clean,$(obj)) \ - $(addsuffix .cxx.clean,$(dep)) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(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) diff --git a/tests/cxx/parser/validation/built-in/byte/driver.cxx b/tests/cxx/parser/validation/built-in/byte/driver.cxx deleted file mode 100644 index c0e2b99..0000000 --- a/tests/cxx/parser/validation/built-in/byte/driver.cxx +++ /dev/null @@ -1,256 +0,0 @@ -// file : tests/cxx/parser/validation/built-in/byte/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test the built-in byte and unsigned byte types validation. -// -#include - -#include -#include - -using namespace xsd::cxx::parser::validating; - -template -bool -test_post_fail (T& p) -{ - try - { - p._post (); - } - catch (invalid_value const&) - { - return true; - } - - return false; -} - -int -main () -{ - // Good. - // - { - byte_pimpl p; - p.pre (); - p._pre (); - p._characters ("123"); - p._post (); - assert (p.post_byte () == 123); - } - - { - byte_pimpl p; - p.pre (); - p._pre (); - p._characters ("\t +123 \n "); - p._post (); - assert (p.post_byte () == 123); - } - - { - byte_pimpl p; - p.pre (); - p._pre (); - p._characters ("-123"); - p._post (); - assert (p.post_byte () == -123); - } - - { - byte_pimpl p; - p.pre (); - p._pre (); - p._characters ("+123"); - p._post (); - assert (p.post_byte () == 123); - } - - { - byte_pimpl p; - p.pre (); - p._pre (); - p._characters ("0000000000000000123"); - p._post (); - assert (p.post_byte () == 123); - } - - { - byte_pimpl p; - p.pre (); - p._pre (); - p._characters ("+0000000000000000123"); - p._post (); - assert (p.post_byte () == 123); - } - - { - byte_pimpl p; - p.pre (); - p._pre (); - p._characters ("-0000000000000000123"); - p._post (); - assert (p.post_byte () == -123); - } - - { - byte_pimpl p; - p.pre (); - p._pre (); - p._characters ("\t \n"); - p._characters (" -"); - p._characters ("00000"); - p._characters ("001"); - p._characters ("23 \n\t"); - p._post (); - assert (p.post_byte () == -123); - } - - { - byte_pimpl p; - p.pre (); - p._pre (); - p._characters ("-128"); - p._post (); - assert (p.post_byte () == -128); - } - - { - byte_pimpl p; - p.pre (); - p._pre (); - p._characters ("127"); - p._post (); - assert (p.post_byte () == 127); - } - - { - unsigned_byte_pimpl p; - p.pre (); - p._pre (); - p._characters ("+123"); - p._post (); - assert (p.post_unsigned_byte () == 123); - } - - { - unsigned_byte_pimpl p; - p.pre (); - p._pre (); - p._characters ("0"); - p._post (); - assert (p.post_unsigned_byte () == 0); - } - - { - unsigned_byte_pimpl p; - p.pre (); - p._pre (); - p._characters ("255"); - p._post (); - assert (p.post_unsigned_byte () == 255); - } - - // Bad - // - { - byte_pimpl p; - p.pre (); - p._pre (); - // p._characters (""); - assert (test_post_fail (p)); - } - - { - byte_pimpl p; - p.pre (); - p._pre (); - p._characters (""); - assert (test_post_fail (p)); - } - - { - byte_pimpl p; - p.pre (); - p._pre (); - p._characters (" \n \t "); - assert (test_post_fail (p)); - } - - { - byte_pimpl p; - p.pre (); - p._pre (); - p._characters ("+"); - assert (test_post_fail (p)); - } - - { - byte_pimpl p; - p.pre (); - p._pre (); - p._characters ("-"); - assert (test_post_fail (p)); - } - - { - byte_pimpl p; - p.pre (); - p._pre (); - p._characters ("++01"); - assert (test_post_fail (p)); - } - - { - byte_pimpl p; - p.pre (); - p._pre (); - p._characters ("--01"); - assert (test_post_fail (p)); - } - - { - byte_pimpl p; - p.pre (); - p._pre (); - p._characters ("-01"); - p._characters (" "); - p._characters ("23 "); - assert (test_post_fail (p)); - } - - { - unsigned_byte_pimpl p; - p.pre (); - p._pre (); - p._characters ("-123"); - assert (test_post_fail (p)); - } - - // Ranges - // - { - byte_pimpl p; - p.pre (); - p._pre (); - p._characters ("-129"); - assert (test_post_fail (p)); - } - - { - byte_pimpl p; - p.pre (); - p._pre (); - p._characters ("128"); - assert (test_post_fail (p)); - } - - { - unsigned_byte_pimpl p; - p.pre (); - p._pre (); - p._characters ("256"); - assert (test_post_fail (p)); - } -} diff --git a/tests/cxx/parser/validation/built-in/byte/makefile b/tests/cxx/parser/validation/built-in/byte/makefile deleted file mode 100644 index afc8174..0000000 --- a/tests/cxx/parser/validation/built-in/byte/makefile +++ /dev/null @@ -1,70 +0,0 @@ -# file : tests/cxx/parser/validation/built-in/byte/makefile -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make - -cxx := driver.cxx - -obj := $(addprefix $(out_base)/,$(cxx:.cxx=.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 - -$(call include-dep,$(dep),$(obj),$(gen)) - -# Convenience alias for default target. -# -$(out_base)/: $(driver) - - -# Test. -# -$(test): driver := $(driver) -$(test): $(driver) - $(call message,test $$1,$$1,$(driver)) - -# Clean. -# -$(clean): $(driver).o.clean \ - $(addsuffix .cxx.clean,$(obj)) \ - $(addsuffix .cxx.clean,$(dep)) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(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) diff --git a/tests/cxx/parser/validation/built-in/date-time/driver.cxx b/tests/cxx/parser/validation/built-in/date-time/driver.cxx deleted file mode 100644 index 8aa3943..0000000 --- a/tests/cxx/parser/validation/built-in/date-time/driver.cxx +++ /dev/null @@ -1,1533 +0,0 @@ -// file : tests/cxx/parser/validation/built-in/date-time/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test the built-in date and time types validation. -// -#include - -#include -#include - -using namespace xsd::cxx::parser::validating; - -template -bool -test_post_fail (T& p) -{ - try - { - p._post (); - } - catch (invalid_value const&) - { - return true; - } - - return false; -} - -int -main () -{ - typedef xsd::cxx::parser::gday gday; - typedef xsd::cxx::parser::gmonth gmonth; - typedef xsd::cxx::parser::gyear gyear; - typedef xsd::cxx::parser::gmonth_day gmonth_day; - typedef xsd::cxx::parser::gyear_month gyear_month; - typedef xsd::cxx::parser::date date; - typedef xsd::cxx::parser::time time; - typedef xsd::cxx::parser::date_time date_time; - typedef xsd::cxx::parser::duration duration; - - // Good. - // - - // gday & time zone parsing - // - { - gday_pimpl p; - p.pre (); - p._pre (); - p._characters (" \t\n "); - p._characters ("---1"); - p._characters ("2+12:00"); - p._post (); - assert (p.post_gday () == gday (12, 12, 00)); - } - - { - gday_pimpl p; - p.pre (); - p._pre (); - p._characters ("---01"); - p._post (); - assert (p.post_gday () == gday (1)); - } - - { - gday_pimpl p; - p.pre (); - p._pre (); - p._characters ("---31"); - p._post (); - assert (p.post_gday () == gday (31)); - } - - { - gday_pimpl p; - p.pre (); - p._pre (); - p._characters ("---15Z"); - p._post (); - assert (p.post_gday () == gday (15, 0, 0)); - } - - { - gday_pimpl p; - p.pre (); - p._pre (); - p._characters ("---15-14:00"); - p._post (); - assert (p.post_gday () == gday (15, -14, 0)); - } - - // gmonth - // - { - gmonth_pimpl p; - p.pre (); - p._pre (); - p._characters (" \t\n "); - p._characters ("--1"); - p._characters ("0+12:00"); - p._post (); - assert (p.post_gmonth () == gmonth (10, 12, 0)); - } - - { - gmonth_pimpl p; - p.pre (); - p._pre (); - p._characters ("--01"); - p._post (); - assert (p.post_gmonth () == gmonth (1)); - } - - { - gmonth_pimpl p; - p.pre (); - p._pre (); - p._characters ("--12Z"); - p._post (); - assert (p.post_gmonth () == gmonth (12, 0, 0)); - } - - // gyear - // - { - gyear_pimpl p; - p.pre (); - p._pre (); - p._characters (" \t\n "); - p._characters ("20"); - p._characters ("07+12:00"); - p._post (); - assert (p.post_gyear () == gyear (2007, 12, 00)); - } - - { - gyear_pimpl p; - p.pre (); - p._pre (); - p._characters ("0001"); - p._post (); - assert (p.post_gyear () == gyear (1)); - } - - { - gyear_pimpl p; - p.pre (); - p._pre (); - p._characters ("-20000Z"); - p._post (); - assert (p.post_gyear () == gyear (-20000, 0, 0)); - } - - // gmonth_day - // - { - gmonth_day_pimpl p; - p.pre (); - p._pre (); - p._characters (" \t\n "); - p._characters ("--1"); - p._characters ("0-28+12:00 "); - p._post (); - assert (p.post_gmonth_day () == gmonth_day (10, 28, 12, 00)); - } - - { - gmonth_day_pimpl p; - p.pre (); - p._pre (); - p._characters ("--12-31"); - p._post (); - assert (p.post_gmonth_day () == gmonth_day (12, 31)); - } - - { - gmonth_day_pimpl p; - p.pre (); - p._pre (); - p._characters ("--01-01Z"); - p._post (); - assert (p.post_gmonth_day () == gmonth_day (1, 1, 0, 0)); - } - - // gyear_month - // - { - gyear_month_pimpl p; - p.pre (); - p._pre (); - p._characters (" \t\n "); - p._characters ("200"); - p._characters ("7-12+12:00 "); - p._post (); - assert (p.post_gyear_month () == gyear_month (2007, 12, 12, 00)); - } - - { - gyear_month_pimpl p; - p.pre (); - p._pre (); - p._characters ("-2007-10"); - p._post (); - assert (p.post_gyear_month () == gyear_month (-2007, 10)); - } - - { - gyear_month_pimpl p; - p.pre (); - p._pre (); - p._characters ("20007-10Z"); - p._post (); - assert (p.post_gyear_month () == gyear_month (20007, 10, 0, 0)); - } - - { - gyear_month_pimpl p; - p.pre (); - p._pre (); - p._characters ("-20007-01"); - p._post (); - assert (p.post_gyear_month () == gyear_month (-20007, 1)); - } - - // date - // - { - date_pimpl p; - p.pre (); - p._pre (); - p._characters (" \t\n "); - p._characters ("200"); - p._characters ("7-12-26+12:00 "); - p._post (); - assert (p.post_date () == date (2007, 12, 26, 12, 0)); - } - - { - date_pimpl p; - p.pre (); - p._pre (); - p._characters ("-2007-10-15"); - p._post (); - assert (p.post_date () == date (-2007, 10, 15)); - } - - { - date_pimpl p; - p.pre (); - p._pre (); - p._characters ("20007-12-31Z"); - p._post (); - assert (p.post_date () == date (20007, 12, 31, 0, 0)); - } - - { - date_pimpl p; - p.pre (); - p._pre (); - p._characters ("-20007-01-01"); - p._post (); - assert (p.post_date () == date (-20007, 1, 1)); - } - - // time - // - { - time_pimpl p; - p.pre (); - p._pre (); - p._characters (" \t\n "); - p._characters ("12:"); - p._characters ("46:23.456+12:00 "); - p._post (); - assert (p.post_time () == time (12, 46, 23.456, 12, 0)); - } - - { - time_pimpl p; - p.pre (); - p._pre (); - p._characters ("12:13:14"); - p._post (); - assert (p.post_time () == time (12, 13, 14.0)); - } - - { - time_pimpl p; - p.pre (); - p._pre (); - p._characters ("12:13:14Z"); - p._post (); - assert (p.post_time () == time (12, 13, 14.0, 0, 0)); - } - - // date_time - // - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters (" \t\n "); - p._characters ("200"); - p._characters ("7-12-26T12:13:14.123+12:00 "); - p._post (); - assert (p.post_date_time () == - date_time (2007, 12, 26, 12, 13, 14.123, 12, 0)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("-2007-10-15T12:13:14"); - p._post (); - assert (p.post_date_time () == date_time (-2007, 10, 15, 12, 13, 14.0)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("20007-12-31T12:13:14Z"); - p._post (); - assert (p.post_date_time () == - date_time (20007, 12, 31, 12, 13, 14.0, 0, 0)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("-20007-01-01T12:13:14"); - p._post (); - assert (p.post_date_time () == date_time (-20007, 1, 1, 12, 13, 14.0)); - } - - // duration - // - { - duration_pimpl p; - p.pre (); - p._pre (); - p._characters (" \t\n "); - p._characters ("-P200"); - p._characters ("7Y13M32DT25H61M61.123S "); - p._post (); - assert (p.post_duration () == - duration (true, 2007, 13, 32, 25, 61, 61.123)); - } - - { - duration_pimpl p; - p.pre (); - p._pre (); - p._characters ("P1Y"); - p._post (); - assert (p.post_duration () == duration (false, 1, 0, 0, 0, 0, 0.0)); - } - - { - duration_pimpl p; - p.pre (); - p._pre (); - p._characters ("P1M"); - p._post (); - assert (p.post_duration () == duration (false, 0, 1, 0, 0, 0, 0.0)); - } - - { - duration_pimpl p; - p.pre (); - p._pre (); - p._characters ("P1D"); - p._post (); - assert (p.post_duration () == duration (false, 0, 0, 1, 0, 0, 0.0)); - } - - { - duration_pimpl p; - p.pre (); - p._pre (); - p._characters ("PT1H"); - p._post (); - assert (p.post_duration () == duration (false, 0, 0, 0, 1, 0, 0.0)); - } - - { - duration_pimpl p; - p.pre (); - p._pre (); - p._characters ("PT1M"); - p._post (); - assert (p.post_duration () == duration (false, 0, 0, 0, 0, 1, 0.0)); - } - - { - duration_pimpl p; - p.pre (); - p._pre (); - p._characters ("PT1.1S"); - p._post (); - assert (p.post_duration () == duration (false, 0, 0, 0, 0, 0, 1.1)); - } - - { - duration_pimpl p; - p.pre (); - p._pre (); - p._characters ("P1YT1S"); - p._post (); - assert (p.post_duration () == duration (false, 1, 0, 0, 0, 0, 1.0)); - } - - // Bad - // - - // gday & time zone parsing - // - { - gday_pimpl p; - p.pre (); - p._pre (); - // p._characters (""); - assert (test_post_fail (p)); - } - - { - gday_pimpl p; - p.pre (); - p._pre (); - p._characters ("--12"); - assert (test_post_fail (p)); - } - - { - gday_pimpl p; - p.pre (); - p._pre (); - p._characters ("---1"); - assert (test_post_fail (p)); - } - - { - gday_pimpl p; - p.pre (); - p._pre (); - p._characters ("---00"); - assert (test_post_fail (p)); - } - - { - gday_pimpl p; - p.pre (); - p._pre (); - p._characters ("---32"); - assert (test_post_fail (p)); - } - - { - gday_pimpl p; - p.pre (); - p._pre (); - p._characters ("---2X"); - assert (test_post_fail (p)); - } - - { - gday_pimpl p; - p.pre (); - p._pre (); - p._characters ("---12asd"); - assert (test_post_fail (p)); - } - - { - gday_pimpl p; - p.pre (); - p._pre (); - p._characters ("---12X"); - assert (test_post_fail (p)); - } - - { - gday_pimpl p; - p.pre (); - p._pre (); - p._characters ("---1212:00"); - assert (test_post_fail (p)); - } - - { - gday_pimpl p; - p.pre (); - p._pre (); - p._characters ("---12+2:00"); - assert (test_post_fail (p)); - } - - { - gday_pimpl p; - p.pre (); - p._pre (); - p._characters ("---12+1200"); - assert (test_post_fail (p)); - } - - { - gday_pimpl p; - p.pre (); - p._pre (); - p._characters ("---12+15:00"); - assert (test_post_fail (p)); - } - - { - gday_pimpl p; - p.pre (); - p._pre (); - p._characters ("---12+12:60"); - assert (test_post_fail (p)); - } - - { - gday_pimpl p; - p.pre (); - p._pre (); - p._characters ("---12+14:01"); - assert (test_post_fail (p)); - } - - // gmonth - // - { - gmonth_pimpl p; - p.pre (); - p._pre (); - // p._characters (""); - assert (test_post_fail (p)); - } - - { - gmonth_pimpl p; - p.pre (); - p._pre (); - p._characters ("-12"); - assert (test_post_fail (p)); - } - - { - gmonth_pimpl p; - p.pre (); - p._pre (); - p._characters ("--00"); - assert (test_post_fail (p)); - } - - { - gmonth_pimpl p; - p.pre (); - p._pre (); - p._characters ("--13"); - assert (test_post_fail (p)); - } - - { - gmonth_pimpl p; - p.pre (); - p._pre (); - p._characters ("--1X"); - assert (test_post_fail (p)); - } - - { - gmonth_pimpl p; - p.pre (); - p._pre (); - p._characters ("--11+12:3o"); - assert (test_post_fail (p)); - } - - // gyear - // - { - gyear_pimpl p; - p.pre (); - p._pre (); - // p._characters (""); - assert (test_post_fail (p)); - } - - { - gyear_pimpl p; - p.pre (); - p._pre (); - p._characters ("207"); - assert (test_post_fail (p)); - } - - { - gyear_pimpl p; - p.pre (); - p._pre (); - p._characters ("-207"); - assert (test_post_fail (p)); - } - - { - gyear_pimpl p; - p.pre (); - p._pre (); - p._characters ("-0000"); - assert (test_post_fail (p)); - } - - { - gyear_pimpl p; - p.pre (); - p._pre (); - p._characters ("20X7"); - assert (test_post_fail (p)); - } - - { - gyear_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007+12:3o"); - assert (test_post_fail (p)); - } - - // gmonth_day - // - { - gmonth_day_pimpl p; - p.pre (); - p._pre (); - // p._characters (""); - assert (test_post_fail (p)); - } - - { - gmonth_day_pimpl p; - p.pre (); - p._pre (); - p._characters ("-12-12"); - assert (test_post_fail (p)); - } - - { - gmonth_day_pimpl p; - p.pre (); - p._pre (); - p._characters ("--1212"); - assert (test_post_fail (p)); - } - - { - gmonth_day_pimpl p; - p.pre (); - p._pre (); - p._characters ("--12?12"); - assert (test_post_fail (p)); - } - - { - gmonth_day_pimpl p; - p.pre (); - p._pre (); - p._characters ("--00-12"); - assert (test_post_fail (p)); - } - - { - gmonth_day_pimpl p; - p.pre (); - p._pre (); - p._characters ("--12-00"); - assert (test_post_fail (p)); - } - - { - gmonth_day_pimpl p; - p.pre (); - p._pre (); - p._characters ("--13-23"); - assert (test_post_fail (p)); - } - - { - gmonth_day_pimpl p; - p.pre (); - p._pre (); - p._characters ("--12-32"); - assert (test_post_fail (p)); - } - - { - gmonth_day_pimpl p; - p.pre (); - p._pre (); - p._characters ("--1X-12"); - assert (test_post_fail (p)); - } - - { - gmonth_day_pimpl p; - p.pre (); - p._pre (); - p._characters ("--12-2X"); - assert (test_post_fail (p)); - } - - { - gmonth_day_pimpl p; - p.pre (); - p._pre (); - p._characters ("--11-11+12:3o"); - assert (test_post_fail (p)); - } - - // gyear_month - // - { - gyear_month_pimpl p; - p.pre (); - p._pre (); - // p._characters (""); - assert (test_post_fail (p)); - } - - { - gyear_month_pimpl p; - p.pre (); - p._pre (); - p._characters ("207-01"); - assert (test_post_fail (p)); - } - - { - gyear_month_pimpl p; - p.pre (); - p._pre (); - p._characters ("-207-01"); - assert (test_post_fail (p)); - } - - { - gyear_month_pimpl p; - p.pre (); - p._pre (); - p._characters ("0000-01"); - assert (test_post_fail (p)); - } - - { - gyear_month_pimpl p; - p.pre (); - p._pre (); - p._characters ("20X7-01"); - assert (test_post_fail (p)); - } - - { - gyear_month_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007"); - assert (test_post_fail (p)); - } - - { - gyear_month_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007?12"); - assert (test_post_fail (p)); - } - - { - gyear_month_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-0"); - assert (test_post_fail (p)); - } - - { - gyear_month_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-00"); - assert (test_post_fail (p)); - } - - { - gyear_month_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-13"); - assert (test_post_fail (p)); - } - - { - gyear_month_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-1X"); - assert (test_post_fail (p)); - } - - { - gyear_month_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-01+12:3o"); - assert (test_post_fail (p)); - } - - // date - // - { - date_pimpl p; - p.pre (); - p._pre (); - // p._characters (""); - assert (test_post_fail (p)); - } - - { - date_pimpl p; - p.pre (); - p._pre (); - p._characters ("207-01-01"); - assert (test_post_fail (p)); - } - - { - date_pimpl p; - p.pre (); - p._pre (); - p._characters ("-207-01-01"); - assert (test_post_fail (p)); - } - - { - date_pimpl p; - p.pre (); - p._pre (); - p._characters ("0000-01-01"); - assert (test_post_fail (p)); - } - - { - date_pimpl p; - p.pre (); - p._pre (); - p._characters ("20X7-01-01"); - assert (test_post_fail (p)); - } - - { - date_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007"); - assert (test_post_fail (p)); - } - - { - date_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007?01-01"); - assert (test_post_fail (p)); - } - - { - date_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-0-01"); - assert (test_post_fail (p)); - } - - { - date_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-00-01"); - assert (test_post_fail (p)); - } - - { - date_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-13-01"); - assert (test_post_fail (p)); - } - - { - date_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-1X-01"); - assert (test_post_fail (p)); - } - - { - date_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-10"); - assert (test_post_fail (p)); - } - - { - date_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-10?12"); - assert (test_post_fail (p)); - } - - { - date_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-10-"); - assert (test_post_fail (p)); - } - - { - date_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-10-0"); - assert (test_post_fail (p)); - } - - { - date_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-10-00"); - assert (test_post_fail (p)); - } - - { - date_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-10-32"); - assert (test_post_fail (p)); - } - - { - date_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-10-2X"); - assert (test_post_fail (p)); - } - - { - date_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-01-01+12:3o"); - assert (test_post_fail (p)); - } - - // time - // - { - time_pimpl p; - p.pre (); - p._pre (); - // p._characters (""); - assert (test_post_fail (p)); - } - - { - time_pimpl p; - p.pre (); - p._pre (); - p._characters ("1:01:01"); - assert (test_post_fail (p)); - } - - { - time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2X:01:01"); - assert (test_post_fail (p)); - } - - { - time_pimpl p; - p.pre (); - p._pre (); - p._characters ("23"); - assert (test_post_fail (p)); - } - - { - time_pimpl p; - p.pre (); - p._pre (); - p._characters ("23?01:01"); - assert (test_post_fail (p)); - } - - { - time_pimpl p; - p.pre (); - p._pre (); - p._characters ("23:0:01"); - assert (test_post_fail (p)); - } - - { - time_pimpl p; - p.pre (); - p._pre (); - p._characters ("23:60:01"); - assert (test_post_fail (p)); - } - - { - time_pimpl p; - p.pre (); - p._pre (); - p._characters ("23:4X:01"); - assert (test_post_fail (p)); - } - - { - time_pimpl p; - p.pre (); - p._pre (); - p._characters ("23:10"); - assert (test_post_fail (p)); - } - - { - time_pimpl p; - p.pre (); - p._pre (); - p._characters ("23:10?12"); - assert (test_post_fail (p)); - } - - { - time_pimpl p; - p.pre (); - p._pre (); - p._characters ("23:10:"); - assert (test_post_fail (p)); - } - - { - time_pimpl p; - p.pre (); - p._pre (); - p._characters ("23:10:0"); - assert (test_post_fail (p)); - } - - { - time_pimpl p; - p.pre (); - p._pre (); - p._characters ("23:10:01."); - assert (test_post_fail (p)); - } - - { - time_pimpl p; - p.pre (); - p._pre (); - p._characters ("23:10:60"); - assert (test_post_fail (p)); - } - - { - time_pimpl p; - p.pre (); - p._pre (); - p._characters ("23:10:2X"); - assert (test_post_fail (p)); - } - - { - time_pimpl p; - p.pre (); - p._pre (); - p._characters ("24:01:00"); - assert (test_post_fail (p)); - } - - { - time_pimpl p; - p.pre (); - p._pre (); - p._characters ("24:00:01"); - assert (test_post_fail (p)); - } - - { - time_pimpl p; - p.pre (); - p._pre (); - p._characters ("23:01:01+12:3o"); - assert (test_post_fail (p)); - } - - // date_time - // - { - date_time_pimpl p; - p.pre (); - p._pre (); - // p._characters (""); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("207-01-01T12:13:14"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("-207-01-01T12:13:14"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("0000-01-01T12:13:14"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("20X7-01-01T12:13:14"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007?01-01T12:13:14"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-0-01T12:13:14"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-00-01T12:13:14"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-13-01T12:13:14"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-1X-01T12:13:14"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-10"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-10?12T12:13:14"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-10-T12:13:14"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-10-0T12:13:14"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-10-00T12:13:14"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-10-32T12:13:14"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-10-2XT12:13:14"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-01-01T1:01:01"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-01-01T2X:01:01"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-01-01T23"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-01-01T23?01:01"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-01-01T23:0:01"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-01-01T23:60:01"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-01-01T23:4X:01"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-01-01T23:10"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-01-01T23:10?12"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-01-01T23:10:"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-01-01T23:10:0"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-01-01T23:10:01."); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-01-01T23:10:60"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-01-01T23:10:2X"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-01-01T24:01:00"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-01-01T24:00:01"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("23:01:01+12:3o"); - assert (test_post_fail (p)); - } - - { - date_time_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007-01-01T12:13:14+12:3o"); - assert (test_post_fail (p)); - } - - // duration - // - { - duration_pimpl p; - p.pre (); - p._pre (); - // p._characters (""); - assert (test_post_fail (p)); - } - - { - duration_pimpl p; - p.pre (); - p._pre (); - p._characters ("2007Y"); - assert (test_post_fail (p)); - } - - { - duration_pimpl p; - p.pre (); - p._pre (); - p._characters ("-2007Y"); - assert (test_post_fail (p)); - } - - { - duration_pimpl p; - p.pre (); - p._pre (); - p._characters ("P-2007Y"); - assert (test_post_fail (p)); - } - - { - duration_pimpl p; - p.pre (); - p._pre (); - p._characters ("P-1M"); - assert (test_post_fail (p)); - } - - { - duration_pimpl p; - p.pre (); - p._pre (); - p._characters ("P-1D"); - assert (test_post_fail (p)); - } - - { - duration_pimpl p; - p.pre (); - p._pre (); - p._characters ("PT-1H"); - assert (test_post_fail (p)); - } - - { - duration_pimpl p; - p.pre (); - p._pre (); - p._characters ("PT-1M"); - assert (test_post_fail (p)); - } - - { - duration_pimpl p; - p.pre (); - p._pre (); - p._characters ("PT-1.1S"); - assert (test_post_fail (p)); - } - - { - duration_pimpl p; - p.pre (); - p._pre (); - p._characters ("P1H1M1S"); - assert (test_post_fail (p)); - } - - { - duration_pimpl p; - p.pre (); - p._pre (); - p._characters ("P1M1Y"); - assert (test_post_fail (p)); - } - - { - duration_pimpl p; - p.pre (); - p._pre (); - p._characters ("PT1S1H"); - assert (test_post_fail (p)); - } - - { - duration_pimpl p; - p.pre (); - p._pre (); - p._characters ("PT1H1Y"); - assert (test_post_fail (p)); - } - - { - duration_pimpl p; - p.pre (); - p._pre (); - p._characters ("P1Ygarbage"); - assert (test_post_fail (p)); - } - - { - duration_pimpl p; - p.pre (); - p._pre (); - p._characters ("P1YT"); - assert (test_post_fail (p)); - } -} diff --git a/tests/cxx/parser/validation/built-in/date-time/makefile b/tests/cxx/parser/validation/built-in/date-time/makefile deleted file mode 100644 index 42d60e8..0000000 --- a/tests/cxx/parser/validation/built-in/date-time/makefile +++ /dev/null @@ -1,70 +0,0 @@ -# file : tests/cxx/parser/validation/built-in/date-time/makefile -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make - -cxx := driver.cxx - -obj := $(addprefix $(out_base)/,$(cxx:.cxx=.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 - -$(call include-dep,$(dep),$(obj),$(gen)) - -# Convenience alias for default target. -# -$(out_base)/: $(driver) - - -# Test. -# -$(test): driver := $(driver) -$(test): $(driver) - $(call message,test $$1,$$1,$(driver)) - -# Clean. -# -$(clean): $(driver).o.clean \ - $(addsuffix .cxx.clean,$(obj)) \ - $(addsuffix .cxx.clean,$(dep)) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(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) diff --git a/tests/cxx/parser/validation/built-in/float/driver.cxx b/tests/cxx/parser/validation/built-in/float/driver.cxx deleted file mode 100644 index 7563aa7..0000000 --- a/tests/cxx/parser/validation/built-in/float/driver.cxx +++ /dev/null @@ -1,285 +0,0 @@ -// file : tests/cxx/parser/validation/built-in/float/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test the built-in float, double, and decimal types validation. -// -#include -#include - -#include -#include - -using namespace xsd::cxx::parser::validating; - -template -bool -test_post_fail (T& p) -{ - try - { - p._post (); - } - catch (invalid_value const&) - { - return true; - } - - return false; -} - -int -main () -{ - // Good. - // - - // float - // - { - float_pimpl p; - p.pre (); - p._pre (); - p._characters (" 0000123.456 "); - p._post (); - assert (p.post_float () == 123.456F); - } - - { - float_pimpl p; - p.pre (); - p._pre (); - p._characters ("-12.345E2"); - p._post (); - assert (p.post_float () == -12.345E2F); - } - - { - float_pimpl p; - p.pre (); - p._pre (); - p._characters ("0"); - p._post (); - assert (p.post_float () == 0.0F); - } - - { - float_pimpl p; - p.pre (); - p._pre (); - p._characters ("-0"); - p._post (); - assert (p.post_float () == -0.0F); - } - - { - float_pimpl p; - p.pre (); - p._pre (); - p._characters ("INF"); - p._post (); - assert (isinf (p.post_float ())); - } - - { - float_pimpl p; - p.pre (); - p._pre (); - p._characters ("-INF"); - p._post (); - assert (isinf (p.post_float ())); - } - - { - float_pimpl p; - p.pre (); - p._pre (); - p._characters ("NaN"); - p._post (); - assert (isnan (p.post_float ())); - } - - // double - // - { - double_pimpl p; - p.pre (); - p._pre (); - p._characters (" 0000123.456789 "); - p._post (); - assert (p.post_double () == 123.456789); - } - - { - double_pimpl p; - p.pre (); - p._pre (); - p._characters ("-12.3456789E2"); - p._post (); - assert (p.post_double () == -12.3456789E2); - } - - { - double_pimpl p; - p.pre (); - p._pre (); - p._characters ("0"); - p._post (); - assert (p.post_double () == 0.0); - } - - { - double_pimpl p; - p.pre (); - p._pre (); - p._characters ("-0"); - p._post (); - assert (p.post_double () == -0.0); - } - - { - double_pimpl p; - p.pre (); - p._pre (); - p._characters ("INF"); - p._post (); - assert (isinf (p.post_double ())); - } - - { - double_pimpl p; - p.pre (); - p._pre (); - p._characters ("-INF"); - p._post (); - assert (isinf (p.post_double ())); - } - - { - double_pimpl p; - p.pre (); - p._pre (); - p._characters ("NaN"); - p._post (); - assert (isnan (p.post_double ())); - } - - // decimal - // - { - decimal_pimpl p; - p.pre (); - p._pre (); - p._characters (" 0000123.456789 "); - p._post (); - assert (p.post_decimal () == 123.456789); - } - - { - decimal_pimpl p; - p.pre (); - p._pre (); - p._characters ("-123.45678912345"); - p._post (); - assert (p.post_decimal () == -123.45678912345); - } - - { - decimal_pimpl p; - p.pre (); - p._pre (); - p._characters ("0"); - p._post (); - assert (p.post_decimal () == 0.0); - } - - { - decimal_pimpl p; - p.pre (); - p._pre (); - p._characters ("-0"); - p._post (); - assert (p.post_decimal () == -0.0); - } - - - // Bad - // - - // float - // - { - float_pimpl p; - p.pre (); - p._pre (); - p._characters ("+INF"); - assert (test_post_fail (p)); - } - - { - float_pimpl p; - p.pre (); - p._pre (); - p._characters ("1.45 E2"); - assert (test_post_fail (p)); - } - - // double - // - { - double_pimpl p; - p.pre (); - p._pre (); - p._characters ("+INF"); - assert (test_post_fail (p)); - } - - { - double_pimpl p; - p.pre (); - p._pre (); - p._characters ("1.45 E2"); - assert (test_post_fail (p)); - } - - // decimal - // - { - decimal_pimpl p; - p.pre (); - p._pre (); - p._characters ("INF"); - assert (test_post_fail (p)); - } - - { - decimal_pimpl p; - p.pre (); - p._pre (); - p._characters ("+INF"); - assert (test_post_fail (p)); - } - - { - decimal_pimpl p; - p.pre (); - p._pre (); - p._characters ("-INF"); - assert (test_post_fail (p)); - } - - { - decimal_pimpl p; - p.pre (); - p._pre (); - p._characters ("NaN"); - assert (test_post_fail (p)); - } - - { - decimal_pimpl p; - p.pre (); - p._pre (); - p._characters ("1.45 2"); - assert (test_post_fail (p)); - } -} diff --git a/tests/cxx/parser/validation/built-in/float/makefile b/tests/cxx/parser/validation/built-in/float/makefile deleted file mode 100644 index 68fac22..0000000 --- a/tests/cxx/parser/validation/built-in/float/makefile +++ /dev/null @@ -1,70 +0,0 @@ -# file : tests/cxx/parser/validation/built-in/float/makefile -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make - -cxx := driver.cxx - -obj := $(addprefix $(out_base)/,$(cxx:.cxx=.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 - -$(call include-dep,$(dep),$(obj),$(gen)) - -# Convenience alias for default target. -# -$(out_base)/: $(driver) - - -# Test. -# -$(test): driver := $(driver) -$(test): $(driver) - $(call message,test $$1,$$1,$(driver)) - -# Clean. -# -$(clean): $(driver).o.clean \ - $(addsuffix .cxx.clean,$(obj)) \ - $(addsuffix .cxx.clean,$(dep)) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(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) diff --git a/tests/cxx/parser/validation/built-in/int/driver.cxx b/tests/cxx/parser/validation/built-in/int/driver.cxx deleted file mode 100644 index 18e83ca..0000000 --- a/tests/cxx/parser/validation/built-in/int/driver.cxx +++ /dev/null @@ -1,116 +0,0 @@ -// file : tests/cxx/parser/validation/built-in/int/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test the built-in int and unsigned int types validation. -// -#include - -#include -#include - -using namespace xsd::cxx::parser::validating; - -template -bool -test_post_fail (T& p) -{ - try - { - p._post (); - } - catch (invalid_value const&) - { - return true; - } - - return false; -} - -int -main () -{ - // Good. - // - { - int_pimpl p; - p.pre (); - p._pre (); - p._characters ("-2147483648"); - p._post (); - assert (p.post_int () == -2147483648); - } - - { - int_pimpl p; - p.pre (); - p._pre (); - p._characters ("0"); - p._post (); - assert (p.post_int () == 0); - } - - { - int_pimpl p; - p.pre (); - p._pre (); - p._characters ("2147483647"); - p._post (); - assert (p.post_int () == 2147483647); - } - - { - unsigned_int_pimpl p; - p.pre (); - p._pre (); - p._characters ("0"); - p._post (); - assert (p.post_unsigned_int () == 0); - } - - { - unsigned_int_pimpl p; - p.pre (); - p._pre (); - p._characters ("4294967295"); - p._post (); - assert (p.post_unsigned_int () == 4294967295); - } - - // Bad - // - - { - unsigned_int_pimpl p; - p.pre (); - p._pre (); - p._characters ("-123"); - assert (test_post_fail (p)); - } - - - // Ranges - // - { - int_pimpl p; - p.pre (); - p._pre (); - p._characters ("-2147483649"); - assert (test_post_fail (p)); - } - - { - int_pimpl p; - p.pre (); - p._pre (); - p._characters ("2147483648"); - assert (test_post_fail (p)); - } - - { - unsigned_int_pimpl p; - p.pre (); - p._pre (); - p._characters ("4294967296"); - assert (test_post_fail (p)); - } -} diff --git a/tests/cxx/parser/validation/built-in/int/makefile b/tests/cxx/parser/validation/built-in/int/makefile deleted file mode 100644 index 7a13105..0000000 --- a/tests/cxx/parser/validation/built-in/int/makefile +++ /dev/null @@ -1,70 +0,0 @@ -# file : tests/cxx/parser/validation/built-in/int/makefile -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make - -cxx := driver.cxx - -obj := $(addprefix $(out_base)/,$(cxx:.cxx=.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 - -$(call include-dep,$(dep),$(obj),$(gen)) - -# Convenience alias for default target. -# -$(out_base)/: $(driver) - - -# Test. -# -$(test): driver := $(driver) -$(test): $(driver) - $(call message,test $$1,$$1,$(driver)) - -# Clean. -# -$(clean): $(driver).o.clean \ - $(addsuffix .cxx.clean,$(obj)) \ - $(addsuffix .cxx.clean,$(dep)) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(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) diff --git a/tests/cxx/parser/validation/built-in/integer/driver.cxx b/tests/cxx/parser/validation/built-in/integer/driver.cxx deleted file mode 100644 index 7eeb708..0000000 --- a/tests/cxx/parser/validation/built-in/integer/driver.cxx +++ /dev/null @@ -1,303 +0,0 @@ -// file : tests/cxx/parser/validation/built-in/int/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test the built-in integer & friends types validation. -// -#include - -#include -#include -#include - -#include -#include - -using namespace std; -using namespace xsd::cxx::parser::validating; - -template -bool -test_post_fail (T& p) -{ - try - { - p._post (); - } - catch (invalid_value const&) - { - return true; - } - - return false; -} - -int -main () -{ - // Good. - // - - std::string min; - std::string max; - std::string umax; - - { - ostringstream ostr; - ostr << LLONG_MIN; - min = ostr.str (); - } - - { - ostringstream ostr; - ostr << LLONG_MAX; - max = ostr.str (); - } - - { - ostringstream ostr; - ostr << ULLONG_MAX; - umax = ostr.str (); - } - - // integer - // - { - integer_pimpl p; - p.pre (); - p._pre (); - p._characters (min.c_str ()); - p._post (); - assert (p.post_integer () == LLONG_MIN); - } - - { - integer_pimpl p; - p.pre (); - p._pre (); - p._characters ("0"); - p._post (); - assert (p.post_integer () == 0); - } - - { - integer_pimpl p; - p.pre (); - p._pre (); - p._characters (max.c_str ()); - p._post (); - assert (p.post_integer () == LLONG_MAX); - } - - // negative_integer - // - { - negative_integer_pimpl p; - p.pre (); - p._pre (); - p._characters (min.c_str ()); - p._post (); - assert (p.post_negative_integer () == LLONG_MIN); - } - - { - negative_integer_pimpl p; - p.pre (); - p._pre (); - p._characters ("-1"); - p._post (); - assert (p.post_negative_integer () == -1); - } - - // non_positive_integer - // - { - non_positive_integer_pimpl p; - p.pre (); - p._pre (); - p._characters (min.c_str ()); - p._post (); - assert (p.post_non_positive_integer () == LLONG_MIN); - } - - { - non_positive_integer_pimpl p; - p.pre (); - p._pre (); - p._characters ("+0"); - p._post (); - assert (p.post_non_positive_integer () == 0); - } - - // positive_integer - // - { - positive_integer_pimpl p; - p.pre (); - p._pre (); - p._characters ("1"); - p._post (); - assert (p.post_positive_integer () == 1); - } - - { - positive_integer_pimpl p; - p.pre (); - p._pre (); - p._characters (umax.c_str ()); - p._post (); - assert (p.post_positive_integer () == ULLONG_MAX); - } - - // non_negative_integer - // - /* - { - non_negative_integer_pimpl p; - p.pre (); - p._pre (); - p._characters ("-0"); - p._post (); - assert (p.post_non_negative_integer () == 0); - } - */ - - { - non_negative_integer_pimpl p; - p.pre (); - p._pre (); - p._characters ("0"); - p._post (); - assert (p.post_non_negative_integer () == 0); - } - - { - non_negative_integer_pimpl p; - p.pre (); - p._pre (); - p._characters (umax.c_str ()); - p._post (); - assert (p.post_non_negative_integer () == ULLONG_MAX); - } - - - // Bad - // - - std::string past_min (min); - std::string past_max (max); - std::string past_umax (umax); - - assert (*past_min.rbegin () != '9'); - assert (*past_max.rbegin () != '9'); - assert (*past_umax.rbegin () != '9'); - - (*past_min.rbegin ())++; - (*past_max.rbegin ())++; - (*past_umax.rbegin ())++; - - // integer - // - { - integer_pimpl p; - p.pre (); - p._pre (); - p._characters (past_min.c_str ()); - assert (test_post_fail (p)); - } - - { - integer_pimpl p; - p.pre (); - p._pre (); - p._characters (past_max.c_str ()); - assert (test_post_fail (p)); - } - - // negative_integer - // - { - negative_integer_pimpl p; - p.pre (); - p._pre (); - p._characters (past_min.c_str ()); - assert (test_post_fail (p)); - } - - { - negative_integer_pimpl p; - p.pre (); - p._pre (); - p._characters ("-0"); - assert (test_post_fail (p)); - } - - { - negative_integer_pimpl p; - p.pre (); - p._pre (); - p._characters ("1"); - assert (test_post_fail (p)); - } - - // non_positive_integer - // - { - non_positive_integer_pimpl p; - p.pre (); - p._pre (); - p._characters (past_min.c_str ()); - assert (test_post_fail (p)); - } - - { - non_positive_integer_pimpl p; - p.pre (); - p._pre (); - p._characters ("1"); - assert (test_post_fail (p)); - } - - // positive_integer - // - { - positive_integer_pimpl p; - p.pre (); - p._pre (); - p._characters ("-1"); - assert (test_post_fail (p)); - } - - { - positive_integer_pimpl p; - p.pre (); - p._pre (); - p._characters ("+0"); - assert (test_post_fail (p)); - } - - { - positive_integer_pimpl p; - p.pre (); - p._pre (); - p._characters (past_umax.c_str ()); - assert (test_post_fail (p)); - } - - // non_negative_integer - // - { - non_negative_integer_pimpl p; - p.pre (); - p._pre (); - p._characters ("-1"); - assert (test_post_fail (p)); - } - - { - non_negative_integer_pimpl p; - p.pre (); - p._pre (); - p._characters (past_umax.c_str ()); - assert (test_post_fail (p)); - } -} diff --git a/tests/cxx/parser/validation/built-in/integer/makefile b/tests/cxx/parser/validation/built-in/integer/makefile deleted file mode 100644 index 66a7dd6..0000000 --- a/tests/cxx/parser/validation/built-in/integer/makefile +++ /dev/null @@ -1,70 +0,0 @@ -# file : tests/cxx/parser/validation/built-in/integer/makefile -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make - -cxx := driver.cxx - -obj := $(addprefix $(out_base)/,$(cxx:.cxx=.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 - -$(call include-dep,$(dep),$(obj),$(gen)) - -# Convenience alias for default target. -# -$(out_base)/: $(driver) - - -# Test. -# -$(test): driver := $(driver) -$(test): $(driver) - $(call message,test $$1,$$1,$(driver)) - -# Clean. -# -$(clean): $(driver).o.clean \ - $(addsuffix .cxx.clean,$(obj)) \ - $(addsuffix .cxx.clean,$(dep)) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(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) diff --git a/tests/cxx/parser/validation/built-in/long/driver.cxx b/tests/cxx/parser/validation/built-in/long/driver.cxx deleted file mode 100644 index a44ae70..0000000 --- a/tests/cxx/parser/validation/built-in/long/driver.cxx +++ /dev/null @@ -1,116 +0,0 @@ -// file : tests/cxx/parser/validation/built-in/long/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test the built-in long and unsigned long types validation. -// -#include - -#include -#include - -using namespace xsd::cxx::parser::validating; - -template -bool -test_post_fail (T& p) -{ - try - { - p._post (); - } - catch (invalid_value const&) - { - return true; - } - - return false; -} - -int -main () -{ - // Good. - // - { - long_pimpl p; - p.pre (); - p._pre (); - p._characters ("-9223372036854775808"); - p._post (); - assert (p.post_long () == (-9223372036854775807LL - 1)); - } - - { - long_pimpl p; - p.pre (); - p._pre (); - p._characters ("0"); - p._post (); - assert (p.post_long () == 0); - } - - { - long_pimpl p; - p.pre (); - p._pre (); - p._characters ("9223372036854775807"); - p._post (); - assert (p.post_long () == 9223372036854775807LL); - } - - { - unsigned_long_pimpl p; - p.pre (); - p._pre (); - p._characters ("0"); - p._post (); - assert (p.post_unsigned_long () == 0); - } - - { - unsigned_long_pimpl p; - p.pre (); - p._pre (); - p._characters ("18446744073709551615"); - p._post (); - assert (p.post_unsigned_long () == 18446744073709551615ULL); - } - - // Bad - // - - { - unsigned_long_pimpl p; - p.pre (); - p._pre (); - p._characters ("-123"); - assert (test_post_fail (p)); - } - - - // Ranges - // - { - long_pimpl p; - p.pre (); - p._pre (); - p._characters ("-9223372036854775809"); - assert (test_post_fail (p)); - } - - { - long_pimpl p; - p.pre (); - p._pre (); - p._characters ("9223372036854775808"); - assert (test_post_fail (p)); - } - - { - unsigned_long_pimpl p; - p.pre (); - p._pre (); - p._characters ("18446744073709551616"); - assert (test_post_fail (p)); - } -} diff --git a/tests/cxx/parser/validation/built-in/long/makefile b/tests/cxx/parser/validation/built-in/long/makefile deleted file mode 100644 index 5854363..0000000 --- a/tests/cxx/parser/validation/built-in/long/makefile +++ /dev/null @@ -1,70 +0,0 @@ -# file : tests/cxx/parser/validation/built-in/long/makefile -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make - -cxx := driver.cxx - -obj := $(addprefix $(out_base)/,$(cxx:.cxx=.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 - -$(call include-dep,$(dep),$(obj),$(gen)) - -# Convenience alias for default target. -# -$(out_base)/: $(driver) - - -# Test. -# -$(test): driver := $(driver) -$(test): $(driver) - $(call message,test $$1,$$1,$(driver)) - -# Clean. -# -$(clean): $(driver).o.clean \ - $(addsuffix .cxx.clean,$(obj)) \ - $(addsuffix .cxx.clean,$(dep)) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(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) diff --git a/tests/cxx/parser/validation/built-in/makefile b/tests/cxx/parser/validation/built-in/makefile deleted file mode 100644 index 79eab4f..0000000 --- a/tests/cxx/parser/validation/built-in/makefile +++ /dev/null @@ -1,17 +0,0 @@ -# file : tests/cxx/parser/validation/built-in/makefile -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make - -tests := any-type binary boolean byte date-time float int integer long \ -qname short string uri - -default := $(out_base)/ -test := $(out_base)/.test -clean := $(out_base)/.clean - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) - -$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) diff --git a/tests/cxx/parser/validation/built-in/qname/driver.cxx b/tests/cxx/parser/validation/built-in/qname/driver.cxx deleted file mode 100644 index 6da6f2f..0000000 --- a/tests/cxx/parser/validation/built-in/qname/driver.cxx +++ /dev/null @@ -1,105 +0,0 @@ -// file : tests/cxx/parser/validation/built-in/qname/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test the built-in QName type validation. -// -#include - -#include -#include - -using namespace xsd::cxx::parser::validating; - -bool -test_post_fail (qname_pimpl& p) -{ - try - { - p._post (); - } - catch (invalid_value const&) - { - return true; - } - - return false; -} - -int -main () -{ - typedef xsd::cxx::parser::qname qname; - - // Good. - // - { - qname_pimpl p; - p.pre (); - p._pre (); - p._characters (" xsi"); - p._characters (":"); - p._characters ("schemaLocation"); - p._post (); - assert (p.post_qname () == qname ("xsi", "schemaLocation")); - } - - { - qname_pimpl p; - p.pre (); - p._pre (); - p._characters ("schemaLocation"); - p._post (); - assert (p.post_qname () == qname ("schemaLocation")); - } - - - // Bad - // - { - qname_pimpl p; - p.pre (); - p._pre (); - //p._characters (""); - assert (test_post_fail (p)); - } - - { - qname_pimpl p; - p.pre (); - p._pre (); - p._characters (":"); - assert (test_post_fail (p)); - } - - { - qname_pimpl p; - p.pre (); - p._pre (); - p._characters ("xsi:"); - assert (test_post_fail (p)); - } - - { - qname_pimpl p; - p.pre (); - p._pre (); - p._characters (":schemaLocation"); - assert (test_post_fail (p)); - } - - { - qname_pimpl p; - p.pre (); - p._pre (); - p._characters ("x?i:schemaLocation"); - assert (test_post_fail (p)); - } - - { - qname_pimpl p; - p.pre (); - p._pre (); - p._characters ("xsi:schema Location"); - assert (test_post_fail (p)); - } -} diff --git a/tests/cxx/parser/validation/built-in/qname/makefile b/tests/cxx/parser/validation/built-in/qname/makefile deleted file mode 100644 index c442812..0000000 --- a/tests/cxx/parser/validation/built-in/qname/makefile +++ /dev/null @@ -1,70 +0,0 @@ -# file : tests/cxx/parser/validation/built-in/qname/makefile -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make - -cxx := driver.cxx - -obj := $(addprefix $(out_base)/,$(cxx:.cxx=.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 - -$(call include-dep,$(dep),$(obj),$(gen)) - -# Convenience alias for default target. -# -$(out_base)/: $(driver) - - -# Test. -# -$(test): driver := $(driver) -$(test): $(driver) - $(call message,test $$1,$$1,$(driver)) - -# Clean. -# -$(clean): $(driver).o.clean \ - $(addsuffix .cxx.clean,$(obj)) \ - $(addsuffix .cxx.clean,$(dep)) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(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) diff --git a/tests/cxx/parser/validation/built-in/short/driver.cxx b/tests/cxx/parser/validation/built-in/short/driver.cxx deleted file mode 100644 index 42009a1..0000000 --- a/tests/cxx/parser/validation/built-in/short/driver.cxx +++ /dev/null @@ -1,116 +0,0 @@ -// file : tests/cxx/parser/validation/built-in/short/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test the built-in short and unsigned short types validation. -// -#include - -#include -#include - -using namespace xsd::cxx::parser::validating; - -template -bool -test_post_fail (T& p) -{ - try - { - p._post (); - } - catch (invalid_value const&) - { - return true; - } - - return false; -} - -int -main () -{ - // Good. - // - { - short_pimpl p; - p.pre (); - p._pre (); - p._characters ("-32768"); - p._post (); - assert (p.post_short () == -32768); - } - - { - short_pimpl p; - p.pre (); - p._pre (); - p._characters ("0"); - p._post (); - assert (p.post_short () == 0); - } - - { - short_pimpl p; - p.pre (); - p._pre (); - p._characters ("32767"); - p._post (); - assert (p.post_short () == 32767); - } - - { - unsigned_short_pimpl p; - p.pre (); - p._pre (); - p._characters ("0"); - p._post (); - assert (p.post_unsigned_short () == 0); - } - - { - unsigned_short_pimpl p; - p.pre (); - p._pre (); - p._characters ("65535"); - p._post (); - assert (p.post_unsigned_short () == 65535); - } - - // Bad - // - - { - unsigned_short_pimpl p; - p.pre (); - p._pre (); - p._characters ("-1234"); - assert (test_post_fail (p)); - } - - - // Ranges - // - { - short_pimpl p; - p.pre (); - p._pre (); - p._characters ("-32769"); - assert (test_post_fail (p)); - } - - { - short_pimpl p; - p.pre (); - p._pre (); - p._characters ("32768"); - assert (test_post_fail (p)); - } - - { - unsigned_short_pimpl p; - p.pre (); - p._pre (); - p._characters ("65536"); - assert (test_post_fail (p)); - } -} diff --git a/tests/cxx/parser/validation/built-in/short/makefile b/tests/cxx/parser/validation/built-in/short/makefile deleted file mode 100644 index 05f8e2c..0000000 --- a/tests/cxx/parser/validation/built-in/short/makefile +++ /dev/null @@ -1,70 +0,0 @@ -# file : tests/cxx/parser/validation/built-in/short/makefile -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make - -cxx := driver.cxx - -obj := $(addprefix $(out_base)/,$(cxx:.cxx=.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 - -$(call include-dep,$(dep),$(obj),$(gen)) - -# Convenience alias for default target. -# -$(out_base)/: $(driver) - - -# Test. -# -$(test): driver := $(driver) -$(test): $(driver) - $(call message,test $$1,$$1,$(driver)) - -# Clean. -# -$(clean): $(driver).o.clean \ - $(addsuffix .cxx.clean,$(obj)) \ - $(addsuffix .cxx.clean,$(dep)) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(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) diff --git a/tests/cxx/parser/validation/built-in/string/driver.cxx b/tests/cxx/parser/validation/built-in/string/driver.cxx deleted file mode 100644 index b5da70d..0000000 --- a/tests/cxx/parser/validation/built-in/string/driver.cxx +++ /dev/null @@ -1,512 +0,0 @@ -// file : tests/cxx/parser/validation/built-in/string/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test the built-in string & friends types validation. -// -#include -#include - -#include -#include - -using namespace xsd::cxx::parser::validating; - -template -bool -test_post_fail (T& p) -{ - try - { - p._post_impl (); // List implementation needs this to be post_impl. - } - catch (invalid_value const&) - { - return true; - } - - return false; -} - -int -main () -{ - typedef xsd::cxx::parser::string_sequence strings; - - // Good. - // - - // string - // - { - string_pimpl p; - p.pre (); - p._pre (); - p._characters (" \n\t"); - p._characters (" aaa "); - p._characters ("bbb"); - p._characters (" "); - p._post (); - assert (p.post_string () == " \n\t aaa bbb "); - } - - // normalized_string - // - { - normalized_string_pimpl p; - p.pre (); - p._pre (); - p._characters (" \n\t"); - p._characters (" aaa \n\t "); - p._characters (" bbb"); - p._characters (" "); - p._post (); - assert (p.post_normalized_string () == " aaa bbb "); - } - - // token - // - { - token_pimpl p; - p.pre (); - p._pre (); - p._characters (" \n\t"); - p._characters (" aaa \n\t "); - p._characters (" bbb \n\t"); - p._characters (" "); - p._post (); - assert (p.post_token () == "aaa bbb"); - } - - // name - // - { - name_pimpl p; - p.pre (); - p._pre (); - p._characters (" \n\t"); - p._characters (" a:b-c_d123 "); - p._characters (" "); - p._post (); - assert (p.post_name () == "a:b-c_d123"); - } - - { - name_pimpl p; - p.pre (); - p._pre (); - p._characters (" \n\t"); - p._characters (" _12 "); - p._characters (" "); - p._post (); - assert (p.post_name () == "_12"); - } - - { - name_pimpl p; - p.pre (); - p._pre (); - p._characters (" \n\t"); - p._characters (" :12 "); - p._characters (" "); - p._post (); - assert (p.post_name () == ":12"); - } - - // nmtoken - // - { - nmtoken_pimpl p; - p.pre (); - p._pre (); - p._characters (" \n\t"); - p._characters (" 123a:b-c_d123 "); - p._characters (" \n\t"); - p._characters (" "); - p._post (); - assert (p.post_nmtoken () == "123a:b-c_d123"); - } - - // nmtokens - // - { - strings s; - s.push_back ("123"); - s.push_back ("abc"); - - nmtokens_pimpl p; - p.pre (); - p._pre (); - p._characters (" \n\t"); - p._characters (" 123 "); - p._characters (" \n\t abc "); - p._characters (" "); - p._post (); - assert (p.post_nmtokens () == s); - } - - // ncname - // - { - ncname_pimpl p; - p.pre (); - p._pre (); - p._characters (" \n\t"); - p._characters (" a.b-c_d123 "); - p._characters (" "); - p._post (); - assert (p.post_ncname () == "a.b-c_d123"); - } - - // id - // - { - id_pimpl p; - p.pre (); - p._pre (); - p._characters (" \n\t"); - p._characters (" a.b-c_d123 "); - p._characters (" "); - p._post (); - assert (p.post_id () == "a.b-c_d123"); - } - - // idref - // - { - idref_pimpl p; - p.pre (); - p._pre (); - p._characters (" \n\t"); - p._characters (" a.b-c_d123 "); - p._characters (" "); - p._post (); - assert (p.post_idref () == "a.b-c_d123"); - } - - // idrefs - // - { - strings s; - s.push_back ("a123"); - s.push_back ("abc"); - - idrefs_pimpl p; - p.pre (); - p._pre (); - p._characters (" \n\t"); - p._characters (" a123 "); - p._characters (" \n\t abc "); - p._characters (" "); - p._post (); - assert (p.post_idrefs () == s); - } - - // language - // - { - language_pimpl p; - p.pre (); - p._pre (); - p._characters (" x "); - p._post (); - assert (p.post_language () == "x"); - } - - { - language_pimpl p; - p.pre (); - p._pre (); - p._characters (" en "); - p._post (); - assert (p.post_language () == "en"); - } - - { - language_pimpl p; - p.pre (); - p._pre (); - p._characters (" en"); - p._characters ("-us "); - p._post (); - assert (p.post_language () == "en-us"); - } - - { - language_pimpl p; - p.pre (); - p._pre (); - p._characters ("one-two-three-four44-seven77-eight888"); - p._post (); - assert (p.post_language () == "one-two-three-four44-seven77-eight888"); - } - - - // Bad - // - - // name - // - { - name_pimpl p; - p.pre (); - p._pre (); - p._characters (""); - assert (test_post_fail (p)); - } - - { - name_pimpl p; - p.pre (); - p._pre (); - p._characters (".a"); - assert (test_post_fail (p)); - } - - { - name_pimpl p; - p.pre (); - p._pre (); - p._characters ("-a"); - assert (test_post_fail (p)); - } - - { - name_pimpl p; - p.pre (); - p._pre (); - p._characters ("1a"); - assert (test_post_fail (p)); - } - - { - name_pimpl p; - p.pre (); - p._pre (); - p._characters ("a,b"); - assert (test_post_fail (p)); - } - - { - name_pimpl p; - p.pre (); - p._pre (); - p._characters ("a b"); - assert (test_post_fail (p)); - } - - { - name_pimpl p; - p.pre (); - p._pre (); - p._characters ("a p; - p.pre (); - p._pre (); - p._characters (""); - assert (test_post_fail (p)); - } - - { - nmtoken_pimpl p; - p.pre (); - p._pre (); - p._characters ("a,b"); - assert (test_post_fail (p)); - } - - { - nmtoken_pimpl p; - p.pre (); - p._pre (); - p._characters ("a b"); - assert (test_post_fail (p)); - } - - { - nmtoken_pimpl p; - p.pre (); - p._pre (); - p._characters ("a p; - p.pre (); - p._pre (); - p._characters (" "); - p._characters (" \t\n "); - assert (test_post_fail (p)); - } - - { - nmtokens_pimpl p; - p.pre (); - p._pre (); - p._characters ("ab a,b"); - assert (test_post_fail (p)); - } - - // ncname - // - { - ncname_pimpl p; - p.pre (); - p._pre (); - p._characters (""); - assert (test_post_fail (p)); - } - - { - ncname_pimpl p; - p.pre (); - p._pre (); - p._characters (".a"); - assert (test_post_fail (p)); - } - - { - ncname_pimpl p; - p.pre (); - p._pre (); - p._characters ("-a"); - assert (test_post_fail (p)); - } - - { - ncname_pimpl p; - p.pre (); - p._pre (); - p._characters (":a"); - assert (test_post_fail (p)); - } - - { - ncname_pimpl p; - p.pre (); - p._pre (); - p._characters ("1a"); - assert (test_post_fail (p)); - } - - { - ncname_pimpl p; - p.pre (); - p._pre (); - p._characters ("1:a"); - assert (test_post_fail (p)); - } - - { - ncname_pimpl p; - p.pre (); - p._pre (); - p._characters ("a,b"); - assert (test_post_fail (p)); - } - - { - ncname_pimpl p; - p.pre (); - p._pre (); - p._characters ("a b"); - assert (test_post_fail (p)); - } - - { - ncname_pimpl p; - p.pre (); - p._pre (); - p._characters ("a p; - p.pre (); - p._pre (); - p._characters ("a b"); - assert (test_post_fail (p)); - } - - // idref - // - { - idref_pimpl p; - p.pre (); - p._pre (); - p._characters ("a b"); - assert (test_post_fail (p)); - } - - // idrefs - // - { - idrefs_pimpl p; - p.pre (); - p._pre (); - p._characters (" "); - p._characters (" \t\n "); - assert (test_post_fail (p)); - } - - { - idrefs_pimpl p; - p.pre (); - p._pre (); - p._characters ("ab a p; - p.pre (); - p._pre (); - p._characters (" "); - assert (test_post_fail (p)); - } - - { - language_pimpl p; - p.pre (); - p._pre (); - p._characters ("en-"); - assert (test_post_fail (p)); - } - - { - language_pimpl p; - p.pre (); - p._pre (); - p._characters ("a1"); - assert (test_post_fail (p)); - } - - { - language_pimpl p; - p.pre (); - p._pre (); - p._characters ("en+us"); - assert (test_post_fail (p)); - } - - { - language_pimpl p; - p.pre (); - p._pre (); - p._characters ("en-nine99999"); - assert (test_post_fail (p)); - } -} diff --git a/tests/cxx/parser/validation/built-in/string/makefile b/tests/cxx/parser/validation/built-in/string/makefile deleted file mode 100644 index bcdae7e..0000000 --- a/tests/cxx/parser/validation/built-in/string/makefile +++ /dev/null @@ -1,70 +0,0 @@ -# file : tests/cxx/parser/validation/built-in/string/makefile -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make - -cxx := driver.cxx - -obj := $(addprefix $(out_base)/,$(cxx:.cxx=.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 - -$(call include-dep,$(dep),$(obj),$(gen)) - -# Convenience alias for default target. -# -$(out_base)/: $(driver) - - -# Test. -# -$(test): driver := $(driver) -$(test): $(driver) - $(call message,test $$1,$$1,$(driver)) - -# Clean. -# -$(clean): $(driver).o.clean \ - $(addsuffix .cxx.clean,$(obj)) \ - $(addsuffix .cxx.clean,$(dep)) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(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) diff --git a/tests/cxx/parser/validation/built-in/uri/driver.cxx b/tests/cxx/parser/validation/built-in/uri/driver.cxx deleted file mode 100644 index 9e487e6..0000000 --- a/tests/cxx/parser/validation/built-in/uri/driver.cxx +++ /dev/null @@ -1,53 +0,0 @@ -// file : tests/cxx/parser/validation/built-in/uri/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test the built-in anyURI type validation. -// -#include - -#include -#include - -using namespace xsd::cxx::parser::validating; - -int -main () -{ - // Good. - // - { - uri_pimpl p; - p.pre (); - p._pre (); - p._characters (" "); - p._post (); - assert (p.post_uri () == ""); - } - - { - uri_pimpl p; - p.pre (); - p._pre (); - p._characters ("relative"); - p._post (); - assert (p.post_uri () == "relative"); - } - - { - uri_pimpl p; - p.pre (); - p._pre (); - p._characters ("#id"); - p._post (); - assert (p.post_uri () == "#id"); - } - - { - uri_pimpl p; - p.pre (); - p._pre (); - p._characters ("http://www.example.com/foo#bar"); - p._post (); - assert (p.post_uri () == "http://www.example.com/foo#bar"); - } -} diff --git a/tests/cxx/parser/validation/built-in/uri/makefile b/tests/cxx/parser/validation/built-in/uri/makefile deleted file mode 100644 index ae7e8bd..0000000 --- a/tests/cxx/parser/validation/built-in/uri/makefile +++ /dev/null @@ -1,70 +0,0 @@ -# file : tests/cxx/parser/validation/built-in/uri/makefile -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../../build/bootstrap.make - -cxx := driver.cxx - -obj := $(addprefix $(out_base)/,$(cxx:.cxx=.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 - -$(call include-dep,$(dep),$(obj),$(gen)) - -# Convenience alias for default target. -# -$(out_base)/: $(driver) - - -# Test. -# -$(test): driver := $(driver) -$(test): $(driver) - $(call message,test $$1,$$1,$(driver)) - -# Clean. -# -$(clean): $(driver).o.clean \ - $(addsuffix .cxx.clean,$(obj)) \ - $(addsuffix .cxx.clean,$(dep)) - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(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) diff --git a/tests/cxx/parser/validation/choice/driver.cxx b/tests/cxx/parser/validation/choice/driver.cxx deleted file mode 100644 index af30727..0000000 --- a/tests/cxx/parser/validation/choice/driver.cxx +++ /dev/null @@ -1,126 +0,0 @@ -// file : tests/cxx/parser/validation/choice/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test the choice compositor validation. -// - -#include -#include -#include - -#include "test-pskel.hxx" - -using namespace std; -using namespace test; -using xml_schema::ro_string; - -struct choice_pimpl: choice_pskel -{ - virtual void - pre () - { - cout << "{" << endl; - } - - virtual void - a (string const& v) - { - cout << " a = " << v << endl; - } - - virtual void - b (string const& v) - { - cout << " b = " << v << endl; - } - - virtual void - c (string const& v) - { - cout << " c = " << v << endl; - } - - virtual void - d (string const& v) - { - cout << " d = " << v << endl; - } - - virtual void - _start_any_element (ro_string const& ns, - ro_string const& name, - ro_string const*) - { - cout << " any: " << ns << "#" << name << endl - << " {" << endl; - } - - virtual void - _any_characters (ro_string const& v) - { - cout << " chars = " << v << endl; - } - - virtual void - _end_any_element (ro_string const&, ro_string const&) - { - cout << " }" << endl; - } - - virtual void - post_choice () - { - cout << "}" << endl - << endl; - } -}; - -struct type_pimpl: type_pskel -{ -}; - -int -main (int argc, char* argv[]) -{ - if (argc != 2) - { - cerr << "usage: " << argv[0] << " test.xml" << endl; - return 1; - } - - try - { - xml_schema::string_pimpl string_p; - choice_pimpl choice_p; - type_pimpl type_p; - - choice_p.parsers (string_p, string_p, string_p, string_p); - type_p.parsers (choice_p); - - xml_schema::document doc_p (type_p, "test", "root"); - - try - { - ifstream ifs (argv[1]); - type_p.pre (); - doc_p.parse (ifs, argv[1], "", xml_schema::flags::dont_validate); - type_p.post_type (); - } - catch (xml_schema::exception const& e) - { - cout << " " << e << endl - << "}" << endl - << endl; - } - } - catch (xml_schema::exception const& e) - { - cerr << e << endl; - return 1; - } - catch (ios_base::failure const&) - { - cerr << "io failure" << endl; - return 1; - } -} diff --git a/tests/cxx/parser/validation/choice/makefile b/tests/cxx/parser/validation/choice/makefile deleted file mode 100644 index 93b05c5..0000000 --- a/tests/cxx/parser/validation/choice/makefile +++ /dev/null @@ -1,92 +0,0 @@ -# file : tests/cxx/parser/validation/choice/makefile -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make - -xsd := test.xsd -cxx := driver.cxx - -tests := 000 001 002 003 004 - -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-validation -$(gen): $(out_root)/xsd/xsd - -$(call include-dep,$(dep),$(obj),$(gen)) - - -# Convenience alias for default target. -# -$(out_base)/: $(driver) - - -# Test. -# -test_targets := $(addprefix $(out_base)/.test-,$(tests)) - -$(test): $(test_targets) -$(test_targets): driver := $(driver) - -.PHONY: $(out_base)/.test-% -$(out_base)/.test-%: $(driver) $(src_base)/test.xsd $(src_base)/test-%.xml $(src_base)/test-%.std - $(call message,test $(out_base)/$*,$(driver) $(src_base)/test-$*.xml | diff -u $(src_base)/test-$*.std -) - - -# 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/tests/cxx/parser/validation/choice/test-000.std b/tests/cxx/parser/validation/choice/test-000.std deleted file mode 100644 index 856b7f5..0000000 --- a/tests/cxx/parser/validation/choice/test-000.std +++ /dev/null @@ -1,22 +0,0 @@ -{ - a = a - b = b -} - -{ - c = c - d = d - any: other#any - { - chars = any - } - a = a -} - -{ - c = c - d = d - d = d - a = a -} - diff --git a/tests/cxx/parser/validation/choice/test-000.xml b/tests/cxx/parser/validation/choice/test-000.xml deleted file mode 100644 index 39b9614..0000000 --- a/tests/cxx/parser/validation/choice/test-000.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - a - - b - - - - c - d - - any - - a - - - - c - d - - d - - a - - - diff --git a/tests/cxx/parser/validation/choice/test-001.std b/tests/cxx/parser/validation/choice/test-001.std deleted file mode 100644 index 8a78666..0000000 --- a/tests/cxx/parser/validation/choice/test-001.std +++ /dev/null @@ -1,4 +0,0 @@ -{ - :8:12 error: expected element 'a' -} - diff --git a/tests/cxx/parser/validation/choice/test-001.xml b/tests/cxx/parser/validation/choice/test-001.xml deleted file mode 100644 index c509e0d..0000000 --- a/tests/cxx/parser/validation/choice/test-001.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/tests/cxx/parser/validation/choice/test-002.std b/tests/cxx/parser/validation/choice/test-002.std deleted file mode 100644 index 1dc1a3a..0000000 --- a/tests/cxx/parser/validation/choice/test-002.std +++ /dev/null @@ -1,11 +0,0 @@ -{ - c = c - d = d - any: other#any - { - chars = any - } - a = a - :14:8 error: unexpected element 'b' -} - diff --git a/tests/cxx/parser/validation/choice/test-002.xml b/tests/cxx/parser/validation/choice/test-002.xml deleted file mode 100644 index 3b7e663..0000000 --- a/tests/cxx/parser/validation/choice/test-002.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - c - d - - any - - a - b - - - diff --git a/tests/cxx/parser/validation/choice/test-003.std b/tests/cxx/parser/validation/choice/test-003.std deleted file mode 100644 index 29d5e44..0000000 --- a/tests/cxx/parser/validation/choice/test-003.std +++ /dev/null @@ -1,5 +0,0 @@ -{ - c = c - :9:12 error: expected element 'd' -} - diff --git a/tests/cxx/parser/validation/choice/test-003.xml b/tests/cxx/parser/validation/choice/test-003.xml deleted file mode 100644 index ba15c7e..0000000 --- a/tests/cxx/parser/validation/choice/test-003.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - c - - - diff --git a/tests/cxx/parser/validation/choice/test-004.std b/tests/cxx/parser/validation/choice/test-004.std deleted file mode 100644 index 4a7530b..0000000 --- a/tests/cxx/parser/validation/choice/test-004.std +++ /dev/null @@ -1,4 +0,0 @@ -{ - :8:8 error: expected element 'a' instead of 'x' -} - diff --git a/tests/cxx/parser/validation/choice/test-004.xml b/tests/cxx/parser/validation/choice/test-004.xml deleted file mode 100644 index f6960dd..0000000 --- a/tests/cxx/parser/validation/choice/test-004.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - x - - - diff --git a/tests/cxx/parser/validation/choice/test.xsd b/tests/cxx/parser/validation/choice/test.xsd deleted file mode 100644 index 8132bbb..0000000 --- a/tests/cxx/parser/validation/choice/test.xsd +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/cxx/parser/validation/makefile b/tests/cxx/parser/validation/makefile deleted file mode 100644 index 600d9dd..0000000 --- a/tests/cxx/parser/validation/makefile +++ /dev/null @@ -1,16 +0,0 @@ -# file : tests/cxx/parser/validation/makefile -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../build/bootstrap.make - -tests := all any attribute built-in choice restriction sequence - -default := $(out_base)/ -test := $(out_base)/.test -clean := $(out_base)/.clean - -$(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) -$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) -$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) - -$(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) diff --git a/tests/cxx/parser/validation/restriction/driver.cxx b/tests/cxx/parser/validation/restriction/driver.cxx deleted file mode 100644 index 6f9a871..0000000 --- a/tests/cxx/parser/validation/restriction/driver.cxx +++ /dev/null @@ -1,107 +0,0 @@ -// file : tests/cxx/parser/validation/restriction/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test the restriction compositor validation. -// - -#include -#include -#include - -#include "test-pskel.hxx" - -using namespace std; -using namespace test; - -struct base_a_pimpl: base_a_pskel -{ -}; - -struct restriction_a_pimpl: restriction_a_pskel -{ -}; - -struct extension_b_pimpl: extension_b_pskel -{ -}; - -struct restriction_b_pimpl: restriction_b_pskel -{ -}; - -struct type_b_pimpl: type_b_pskel -{ -}; - -struct type_r_pimpl: type_r_pskel -{ -}; - - -int -main (int argc, char* argv[]) -{ - if (argc != 2) - { - cerr << "usage: " << argv[0] << " test.xml" << endl; - return 1; - } - - try - { - xml_schema::string_pimpl string_p; - base_a_pimpl base_a_p; - restriction_a_pimpl restriction_a_p; - extension_b_pimpl extension_b_p; - restriction_b_pimpl restriction_b_p; - type_b_pimpl type_b_p; - type_r_pimpl type_r_p; - - base_a_p.parsers (string_p, string_p, string_p, - string_p, string_p, string_p); - - restriction_a_p.parsers (string_p, string_p, string_p, - string_p, string_p, string_p); - - extension_b_p.parsers (string_p, string_p, string_p, - string_p, string_p); - - restriction_b_p.parsers (string_p, string_p, string_p, - string_p, string_p); - - type_b_p.parsers (base_a_p, extension_b_p); - type_r_p.parsers (restriction_a_p, restriction_b_p); - - xml_schema::document doc_b_p (type_b_p, "test", "root"); - xml_schema::document doc_r_p (type_r_p, "test", "root"); - - { - ifstream ifs (argv[1]); - type_b_p.pre (); - doc_b_p.parse (ifs, argv[1], "", xml_schema::flags::dont_validate); - type_b_p.post_type_b (); - } - - try - { - ifstream ifs (argv[1]); - type_r_p.pre (); - doc_r_p.parse (ifs, argv[1], "", xml_schema::flags::dont_validate); - type_r_p.post_type_r (); - } - catch (xml_schema::exception const& e) - { - cout << e << endl; - } - } - catch (xml_schema::exception const& e) - { - cerr << e << endl; - return 1; - } - catch (ios_base::failure const&) - { - cerr << "io failure" << endl; - return 1; - } -} diff --git a/tests/cxx/parser/validation/restriction/makefile b/tests/cxx/parser/validation/restriction/makefile deleted file mode 100644 index 61af2bf..0000000 --- a/tests/cxx/parser/validation/restriction/makefile +++ /dev/null @@ -1,92 +0,0 @@ -# file : tests/cxx/parser/validation/restriction/makefile -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make - -xsd := test.xsd -cxx := driver.cxx - -tests := 000 001 002 003 004 005 - -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-validation -$(gen): $(out_root)/xsd/xsd - -$(call include-dep,$(dep),$(obj),$(gen)) - - -# Convenience alias for default target. -# -$(out_base)/: $(driver) - - -# Test. -# -test_targets := $(addprefix $(out_base)/.test-,$(tests)) - -$(test): $(test_targets) -$(test_targets): driver := $(driver) - -.PHONY: $(out_base)/.test-% -$(out_base)/.test-%: $(driver) $(src_base)/test.xsd $(src_base)/test-%.xml $(src_base)/test-%.std - $(call message,test $(out_base)/$*,$(driver) $(src_base)/test-$*.xml | diff -u $(src_base)/test-$*.std -) - - -# 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/tests/cxx/parser/validation/restriction/test-000.std b/tests/cxx/parser/validation/restriction/test-000.std deleted file mode 100644 index e69de29..0000000 diff --git a/tests/cxx/parser/validation/restriction/test-000.xml b/tests/cxx/parser/validation/restriction/test-000.xml deleted file mode 100644 index 21402b4..0000000 --- a/tests/cxx/parser/validation/restriction/test-000.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - a - b - c - - - - a - b - c - - - - a - b - - - - a - c - - - - a - - - diff --git a/tests/cxx/parser/validation/restriction/test-001.std b/tests/cxx/parser/validation/restriction/test-001.std deleted file mode 100644 index 5077837..0000000 --- a/tests/cxx/parser/validation/restriction/test-001.std +++ /dev/null @@ -1 +0,0 @@ -:7:8 error: expected element 'a' instead of 'b' diff --git a/tests/cxx/parser/validation/restriction/test-001.xml b/tests/cxx/parser/validation/restriction/test-001.xml deleted file mode 100644 index 4015302..0000000 --- a/tests/cxx/parser/validation/restriction/test-001.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - b - c - - - diff --git a/tests/cxx/parser/validation/restriction/test-002.std b/tests/cxx/parser/validation/restriction/test-002.std deleted file mode 100644 index f12c342..0000000 --- a/tests/cxx/parser/validation/restriction/test-002.std +++ /dev/null @@ -1 +0,0 @@ -:10:19 error: expected attribute 'z' diff --git a/tests/cxx/parser/validation/restriction/test-002.xml b/tests/cxx/parser/validation/restriction/test-002.xml deleted file mode 100644 index eb7684c..0000000 --- a/tests/cxx/parser/validation/restriction/test-002.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - a - b - c - - - diff --git a/tests/cxx/parser/validation/restriction/test-003.std b/tests/cxx/parser/validation/restriction/test-003.std deleted file mode 100644 index 0c65175..0000000 --- a/tests/cxx/parser/validation/restriction/test-003.std +++ /dev/null @@ -1 +0,0 @@ -:11:8 error: unexpected element 'a' diff --git a/tests/cxx/parser/validation/restriction/test-003.xml b/tests/cxx/parser/validation/restriction/test-003.xml deleted file mode 100644 index 49f18c7..0000000 --- a/tests/cxx/parser/validation/restriction/test-003.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - a - b - c - - a - b - c - - - diff --git a/tests/cxx/parser/validation/restriction/test-004.std b/tests/cxx/parser/validation/restriction/test-004.std deleted file mode 100644 index 5077837..0000000 --- a/tests/cxx/parser/validation/restriction/test-004.std +++ /dev/null @@ -1 +0,0 @@ -:7:8 error: expected element 'a' instead of 'b' diff --git a/tests/cxx/parser/validation/restriction/test-004.xml b/tests/cxx/parser/validation/restriction/test-004.xml deleted file mode 100644 index 115cd38..0000000 --- a/tests/cxx/parser/validation/restriction/test-004.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - b - - - diff --git a/tests/cxx/parser/validation/restriction/test-005.std b/tests/cxx/parser/validation/restriction/test-005.std deleted file mode 100644 index e92de14..0000000 --- a/tests/cxx/parser/validation/restriction/test-005.std +++ /dev/null @@ -1 +0,0 @@ -:9:19 error: expected attribute 'y' diff --git a/tests/cxx/parser/validation/restriction/test-005.xml b/tests/cxx/parser/validation/restriction/test-005.xml deleted file mode 100644 index e9ab7d9..0000000 --- a/tests/cxx/parser/validation/restriction/test-005.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - a - b - - - diff --git a/tests/cxx/parser/validation/restriction/test.xsd b/tests/cxx/parser/validation/restriction/test.xsd deleted file mode 100644 index 158ded5..0000000 --- a/tests/cxx/parser/validation/restriction/test.xsd +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/cxx/parser/validation/sequence/driver.cxx b/tests/cxx/parser/validation/sequence/driver.cxx deleted file mode 100644 index 61652b3..0000000 --- a/tests/cxx/parser/validation/sequence/driver.cxx +++ /dev/null @@ -1,139 +0,0 @@ -// file : tests/cxx/parser/validation/sequence/driver.cxx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -// Test the sequence compositor validation. -// - -#include -#include -#include - -#include "test-pskel.hxx" - -using namespace std; -using namespace test; -using xml_schema::ro_string; - -struct sequence_pimpl: sequence_pskel -{ - virtual void - pre () - { - cout << "{" << endl; - } - - virtual void - a (string const& v) - { - cout << " a = " << v << endl; - } - - virtual void - b (string const& v) - { - cout << " b = " << v << endl; - } - - virtual void - c (string const& v) - { - cout << " c = " << v << endl; - } - - virtual void - d (string const& v) - { - cout << " d = " << v << endl; - } - - virtual void - e (string const& v) - { - cout << " e = " << v << endl; - } - - virtual void - f (string const& v) - { - cout << " f = " << v << endl; - } - - virtual void - _start_any_element (ro_string const& ns, - ro_string const& name, - ro_string const*) - { - cout << " any: " << ns << "#" << name << endl - << " {" << endl; - } - - virtual void - _any_characters (ro_string const& v) - { - cout << " chars = " << v << endl; - } - - virtual void - _end_any_element (ro_string const&, ro_string const&) - { - cout << " }" << endl; - } - - virtual void - post_sequence () - { - cout << "}" << endl - << endl; - } -}; - -struct type_pimpl: type_pskel -{ -}; - -int -main (int argc, char* argv[]) -{ - if (argc != 2) - { - cerr << "usage: " << argv[0] << " test.xml" << endl; - return 1; - } - - try - { - xml_schema::string_pimpl string_p; - sequence_pimpl sequence_p; - type_pimpl type_p; - - sequence_p.parsers (string_p, string_p, string_p, - string_p, string_p, string_p); - type_p.parsers (sequence_p); - - xml_schema::document doc_p (type_p, "test", "root"); - - try - { - ifstream ifs (argv[1]); - type_p.pre (); - doc_p.parse (ifs, argv[1], "", xml_schema::flags::dont_validate); - type_p.post_type (); - } - catch (xml_schema::exception const& e) - { - cout << " " << e << endl - << "}" << endl - << endl; - } - } - catch (xml_schema::exception const& e) - { - cerr << e << endl; - return 1; - } - catch (ios_base::failure const&) - { - cerr << "io failure" << endl; - return 1; - } -} diff --git a/tests/cxx/parser/validation/sequence/makefile b/tests/cxx/parser/validation/sequence/makefile deleted file mode 100644 index f0a7b14..0000000 --- a/tests/cxx/parser/validation/sequence/makefile +++ /dev/null @@ -1,92 +0,0 @@ -# file : tests/cxx/parser/validation/sequence/makefile -# license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../../../build/bootstrap.make - -xsd := test.xsd -cxx := driver.cxx - -tests := 000 001 002 003 004 005 006 - -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-validation -$(gen): $(out_root)/xsd/xsd - -$(call include-dep,$(dep),$(obj),$(gen)) - - -# Convenience alias for default target. -# -$(out_base)/: $(driver) - - -# Test. -# -test_targets := $(addprefix $(out_base)/.test-,$(tests)) - -$(test): $(test_targets) -$(test_targets): driver := $(driver) - -.PHONY: $(out_base)/.test-% -$(out_base)/.test-%: $(driver) $(src_base)/test.xsd $(src_base)/test-%.xml $(src_base)/test-%.std - $(call message,test $(out_base)/$*,$(driver) $(src_base)/test-$*.xml | diff -u $(src_base)/test-$*.std -) - - -# 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/tests/cxx/parser/validation/sequence/test-000.std b/tests/cxx/parser/validation/sequence/test-000.std deleted file mode 100644 index 8a44762..0000000 --- a/tests/cxx/parser/validation/sequence/test-000.std +++ /dev/null @@ -1,56 +0,0 @@ -{ - c = c - d = d - any: test#any - { - chars = aaa - any: #a - { - chars = bbb - } - chars = ccc - } - f = f - e = e -} - -{ - a = a - b = b - c = c - d = d - d = d - d = d - any: other#any - { - chars = any - } - f = f - e = e - e = e -} - -{ - a = a - b = b - c = c - d = d - d = d - d = d - any: other#any - { - chars = any - } - f = f - e = e - e = e - c = c - d = d - any: test#any - { - chars = any - } - f = f - e = e -} - diff --git a/tests/cxx/parser/validation/sequence/test-000.xml b/tests/cxx/parser/validation/sequence/test-000.xml deleted file mode 100644 index 9bcbd7e..0000000 --- a/tests/cxx/parser/validation/sequence/test-000.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - c - d - aaabbbccc - f - e - - - - a - b - c - d - d - d - any - f - e - e - - - - a - b - c - d - d - d - any - f - e - e - - c - d - any - f - e - - - diff --git a/tests/cxx/parser/validation/sequence/test-001.std b/tests/cxx/parser/validation/sequence/test-001.std deleted file mode 100644 index 20dea34..0000000 --- a/tests/cxx/parser/validation/sequence/test-001.std +++ /dev/null @@ -1,4 +0,0 @@ -{ - :8:14 error: expected element 'a' -} - diff --git a/tests/cxx/parser/validation/sequence/test-001.xml b/tests/cxx/parser/validation/sequence/test-001.xml deleted file mode 100644 index 67d33ce..0000000 --- a/tests/cxx/parser/validation/sequence/test-001.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/tests/cxx/parser/validation/sequence/test-002.std b/tests/cxx/parser/validation/sequence/test-002.std deleted file mode 100644 index 61343e7..0000000 --- a/tests/cxx/parser/validation/sequence/test-002.std +++ /dev/null @@ -1,20 +0,0 @@ -{ - c = c - d = d - any: test#any - { - chars = any - } - f = f - e = e - c = c - d = d - any: test#any - { - chars = any - } - f = f - e = e - :20:8 error: unexpected element 'c' -} - diff --git a/tests/cxx/parser/validation/sequence/test-002.xml b/tests/cxx/parser/validation/sequence/test-002.xml deleted file mode 100644 index be25fcf..0000000 --- a/tests/cxx/parser/validation/sequence/test-002.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - c - d - any - f - e - - c - d - any - f - e - - c - d - any - f - e - - - diff --git a/tests/cxx/parser/validation/sequence/test-003.std b/tests/cxx/parser/validation/sequence/test-003.std deleted file mode 100644 index c4e1e46..0000000 --- a/tests/cxx/parser/validation/sequence/test-003.std +++ /dev/null @@ -1,5 +0,0 @@ -{ - a = a - :9:8 error: expected element 'b' instead of 'a' -} - diff --git a/tests/cxx/parser/validation/sequence/test-003.xml b/tests/cxx/parser/validation/sequence/test-003.xml deleted file mode 100644 index af7d21d..0000000 --- a/tests/cxx/parser/validation/sequence/test-003.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - a - a - c - d - any - f - e - - - diff --git a/tests/cxx/parser/validation/sequence/test-004.std b/tests/cxx/parser/validation/sequence/test-004.std deleted file mode 100644 index f4c1d4d..0000000 --- a/tests/cxx/parser/validation/sequence/test-004.std +++ /dev/null @@ -1,4 +0,0 @@ -{ - :8:8 error: expected element 'a' instead of 'd' -} - diff --git a/tests/cxx/parser/validation/sequence/test-004.xml b/tests/cxx/parser/validation/sequence/test-004.xml deleted file mode 100644 index a58b6d4..0000000 --- a/tests/cxx/parser/validation/sequence/test-004.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - d - any - f - e - - - diff --git a/tests/cxx/parser/validation/sequence/test-005.std b/tests/cxx/parser/validation/sequence/test-005.std deleted file mode 100644 index 9fa7904..0000000 --- a/tests/cxx/parser/validation/sequence/test-005.std +++ /dev/null @@ -1,6 +0,0 @@ -{ - c = c - d = d - :10:13 error: expected element '##targetNamespace#*' instead of 'other1#any' -} - diff --git a/tests/cxx/parser/validation/sequence/test-005.xml b/tests/cxx/parser/validation/sequence/test-005.xml deleted file mode 100644 index e3dd03d..0000000 --- a/tests/cxx/parser/validation/sequence/test-005.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - c - d - any - f - e - - - diff --git a/tests/cxx/parser/validation/sequence/test-006.std b/tests/cxx/parser/validation/sequence/test-006.std deleted file mode 100644 index eb79f47..0000000 --- a/tests/cxx/parser/validation/sequence/test-006.std +++ /dev/null @@ -1,13 +0,0 @@ -{ - c = c - d = d - any: test#any - { - chars = any - } - f = f - e = e - e = e - :14:8 error: unexpected element 'e' -} - diff --git a/tests/cxx/parser/validation/sequence/test-006.xml b/tests/cxx/parser/validation/sequence/test-006.xml deleted file mode 100644 index e1ecd69..0000000 --- a/tests/cxx/parser/validation/sequence/test-006.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - c - d - any - f - e - e - e - - - diff --git a/tests/cxx/parser/validation/sequence/test.xsd b/tests/cxx/parser/validation/sequence/test.xsd deleted file mode 100644 index 8753f54..0000000 --- a/tests/cxx/parser/validation/sequence/test.xsd +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- cgit v1.1