diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2021-12-10 12:57:22 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2021-12-10 12:57:22 +0200 |
commit | b06944fa51ac3dc93f2ccb1fcdee50d78ad92dc6 (patch) | |
tree | 55c7d944bd0e7453802bb4fbe766a3f9993169c4 /xsd/tests | |
parent | 12982daf073ff7f78232f804661de9d1232e9378 (diff) |
Add basic test to xsd package
Diffstat (limited to 'xsd/tests')
-rw-r--r-- | xsd/tests/.gitignore | 2 | ||||
-rw-r--r-- | xsd/tests/build/.gitignore | 3 | ||||
-rw-r--r-- | xsd/tests/build/bootstrap.build | 8 | ||||
-rw-r--r-- | xsd/tests/build/root.build | 16 | ||||
-rw-r--r-- | xsd/tests/buildfile | 4 | ||||
-rw-r--r-- | xsd/tests/testscript | 26 |
6 files changed, 59 insertions, 0 deletions
diff --git a/xsd/tests/.gitignore b/xsd/tests/.gitignore new file mode 100644 index 0000000..35ec43f --- /dev/null +++ b/xsd/tests/.gitignore @@ -0,0 +1,2 @@ +test/ +test-*/ diff --git a/xsd/tests/build/.gitignore b/xsd/tests/build/.gitignore new file mode 100644 index 0000000..4a730a3 --- /dev/null +++ b/xsd/tests/build/.gitignore @@ -0,0 +1,3 @@ +config.build +root/ +bootstrap/ diff --git a/xsd/tests/build/bootstrap.build b/xsd/tests/build/bootstrap.build new file mode 100644 index 0000000..33c8d02 --- /dev/null +++ b/xsd/tests/build/bootstrap.build @@ -0,0 +1,8 @@ +# file : tests/build/bootstrap.build +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +project = # Unnamed subproject. + +using config +using dist +using test diff --git a/xsd/tests/build/root.build b/xsd/tests/build/root.build new file mode 100644 index 0000000..dd7abe5 --- /dev/null +++ b/xsd/tests/build/root.build @@ -0,0 +1,16 @@ +# file : tests/build/root.build +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +# We need to configure C++ module to obtain the target information (see +# below). +# +using cxx.config + +# Import the XSD compiler we will be testing. +# +import! [metadata] xsd = xsd%exe{xsd} +testscript{*}: test = $xsd + +# Specify the test target for cross-testing. +# +test.target = $cxx.target diff --git a/xsd/tests/buildfile b/xsd/tests/buildfile new file mode 100644 index 0000000..201b1d7 --- /dev/null +++ b/xsd/tests/buildfile @@ -0,0 +1,4 @@ +# file : tests/buildfile +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +./: testscript $xsd diff --git a/xsd/tests/testscript b/xsd/tests/testscript new file mode 100644 index 0000000..7570d4d --- /dev/null +++ b/xsd/tests/testscript @@ -0,0 +1,26 @@ +# file : tests/testscript +# license : GNU GPL v2 + exceptions; see accompanying LICENSE file + +: version +: +$* --version >>~/EOO/ +/CodeSynthesis XSD XML Schema to C\+\+ compiler .+/ +/.*/* +EOO + +: basics +: +cat <<EOI >=test.xsd; +<?xml version="1.0"?> +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <xsd:complexType name="hello_t"> + <xsd:sequence> + <xsd:element name="greeting" type="xsd:string"/> + <xsd:element name="name" type="xsd:string" maxOccurs="unbounded"/> + </xsd:sequence> + </xsd:complexType> + <xsd:element name="hello" type="hello_t"/> +</xsd:schema> +EOI +$* cxx-tree --generate-inline test.xsd &test.hxx &test.ixx &test.cxx; +test -f test.hxx && test -f test.ixx && test -f test.cxx |