summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichka Popoff <michkapopoff@gmail.com>2015-05-25 08:55:04 (GMT)
committerBrad King <brad.king@kitware.com>2015-06-08 17:00:28 (GMT)
commit73b947ec075e536535e9cc5bec84d1bed4d43d5b (patch)
treea4ed0fa1ee5da56fda04f358d34b63c90fd9eb81 /test
parentad7f0dc7df8ed8ea32498a61d64dce0024478c00 (diff)
downloadCastXML-73b947ec075e536535e9cc5bec84d1bed4d43d5b.zip
CastXML-73b947ec075e536535e9cc5bec84d1bed4d43d5b.tar.gz
CastXML-73b947ec075e536535e9cc5bec84d1bed4d43d5b.tar.bz2
castxml: Teach --castxml-start to support a comma-separated list
In gccxml one could input a comma-separated list for the starting declarations to parse. Add support for this with tests for cases were a comma-separated list is used, and for the case where --castxml-start is used multiple times.
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt9
-rw-r--r--test/expect/gccxml.any.Namespace-nested-1.xml.txt11
-rw-r--r--test/expect/gccxml.any.Namespace-nested-2.xml.txt11
3 files changed, 31 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index afbbbaf..ae61ace 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -240,6 +240,15 @@ castxml_test_gccxml(Variable)
castxml_test_gccxml(Variable-in-Class)
castxml_test_gccxml(Variable-init)
+# Test multiple start declarations.
+set(castxml_test_gccxml_custom_input Namespace-nested)
+set(castxml_test_gccxml_custom_start --castxml-start start::ns1,start::ns3)
+castxml_test_gccxml(Namespace-nested-1)
+set(castxml_test_gccxml_custom_start --castxml-start start::ns1 --castxml-start start::ns3)
+castxml_test_gccxml(Namespace-nested-2)
+unset(castxml_test_gccxml_custom_start)
+unset(castxml_test_gccxml_custom_input)
+
castxml_test_gccxml(qualified-type-name)
castxml_test_gccxml(using-declaration-class)
castxml_test_gccxml(using-declaration-ns)
diff --git a/test/expect/gccxml.any.Namespace-nested-1.xml.txt b/test/expect/gccxml.any.Namespace-nested-1.xml.txt
new file mode 100644
index 0000000..49673f0
--- /dev/null
+++ b/test/expect/gccxml.any.Namespace-nested-1.xml.txt
@@ -0,0 +1,11 @@
+^<\?xml version="1.0"\?>
+<GCC_XML[^>]*>
+ <Namespace id="_1" name="ns1" context="_3" members="_4"/>
+ <Namespace id="_2" name="ns3" context="_3" members="_5"/>
+ <Function id="_4" name="f1" returns="_6" context="_1" location="f1:3" file="f1" line="3" mangled="[^"]+"/>
+ <Function id="_5" name="f3" returns="_6" context="_2" location="f1:9" file="f1" line="9" mangled="[^"]+"/>
+ <FundamentalType id="_6" name="void" size="[0-9]+" align="[0-9]+"/>
+ <Namespace id="_3" name="start" context="_7"/>
+ <Namespace id="_7" name="::"/>
+ <File id="f1" name=".*/test/input/Namespace-nested.cxx"/>
+</GCC_XML>$
diff --git a/test/expect/gccxml.any.Namespace-nested-2.xml.txt b/test/expect/gccxml.any.Namespace-nested-2.xml.txt
new file mode 100644
index 0000000..49673f0
--- /dev/null
+++ b/test/expect/gccxml.any.Namespace-nested-2.xml.txt
@@ -0,0 +1,11 @@
+^<\?xml version="1.0"\?>
+<GCC_XML[^>]*>
+ <Namespace id="_1" name="ns1" context="_3" members="_4"/>
+ <Namespace id="_2" name="ns3" context="_3" members="_5"/>
+ <Function id="_4" name="f1" returns="_6" context="_1" location="f1:3" file="f1" line="3" mangled="[^"]+"/>
+ <Function id="_5" name="f3" returns="_6" context="_2" location="f1:9" file="f1" line="9" mangled="[^"]+"/>
+ <FundamentalType id="_6" name="void" size="[0-9]+" align="[0-9]+"/>
+ <Namespace id="_3" name="start" context="_7"/>
+ <Namespace id="_7" name="::"/>
+ <File id="f1" name=".*/test/input/Namespace-nested.cxx"/>
+</GCC_XML>$