From 3670ee1a3682e0e3bfd8576d7555b1f2adfd0c57 Mon Sep 17 00:00:00 2001 From: jez_higgins <> Date: Tue, 18 Oct 2005 11:39:56 +0000 Subject: [PATCH] pulled out xpath_test_suite.hpp --- test/XPath/axis_enumerator_test.hpp | 1 - test/XPath/main.cpp | 28 ++------------------- test/XPath/xpath_test_suite.hpp | 36 +++++++++++++++++++++++++++ test/XPath/xpathic.vcproj | 26 +------------------ test/XPath_silly/main.cpp | 30 +++------------------- test/XPath_silly/xpathic_silly.vcproj | 26 +------------------ test/XPath_wide/main.cpp | 32 +++--------------------- test/XPath_wide/xpathic_wide.vcproj | 32 +----------------------- 8 files changed, 47 insertions(+), 164 deletions(-) create mode 100644 test/XPath/xpath_test_suite.hpp diff --git a/test/XPath/axis_enumerator_test.hpp b/test/XPath/axis_enumerator_test.hpp index 4907e5d6..8cf0f4d7 100644 --- a/test/XPath/axis_enumerator_test.hpp +++ b/test/XPath/axis_enumerator_test.hpp @@ -971,6 +971,5 @@ TestSuite* AxisEnumeratorTest_suite() return suiteOfTests; } // AxisEnumeratorTest_suite - #endif diff --git a/test/XPath/main.cpp b/test/XPath/main.cpp index 59f888c6..6c76caf9 100644 --- a/test/XPath/main.cpp +++ b/test/XPath/main.cpp @@ -3,38 +3,14 @@ #pragma warning(disable:4224 4267) #endif -#include "../CppUnit/TestRunner.hpp" #include -#include "../CppUnit/framework/Test.h" -#include "../CppUnit/framework/TestSuite.h" - -#include "parse_test.hpp" -#include "value_test.hpp" -#include "arithmetic_test.hpp" -#include "relational_test.hpp" -#include "logical_test.hpp" -#include "axis_enumerator_test.hpp" -#include "node_test_test.hpp" -#include "step_test.hpp" -#include "execute_test.hpp" +#include "xpath_test_suite.hpp" ///////////////////////////////////////// int main(int argc, char** argv) { std::cout << "Hello" << std::endl; - TestRunner runner; - - runner.addTest("ValueTest", ValueTest_suite >()); - runner.addTest("ArithmeticTest", ArithmeticTest_suite >()); - runner.addTest("RelationalTest", RelationalTest_suite >()); - runner.addTest("LogicalTest", LogicalTest_suite >()); - runner.addTest("AxisEnumeratorTest", AxisEnumeratorTest_suite >()); - runner.addTest("NodeTestTest", NodeTestTest_suite >()); - runner.addTest("StepTest", StepTest_suite >()); - runner.addTest("ParseTest", ParseTest_suite >()); - runner.addTest("ExecuteTest", ExecuteTest_suite >()); - - runner.run(argc, argv); + XPath_test_suite >(argc, argv); } // main diff --git a/test/XPath/xpath_test_suite.hpp b/test/XPath/xpath_test_suite.hpp new file mode 100644 index 00000000..7c272f64 --- /dev/null +++ b/test/XPath/xpath_test_suite.hpp @@ -0,0 +1,36 @@ +#ifndef XPATHIC_XPATH_TEST_SUITE_HPP +#define XPATHIC_XPATH_TEST_SUITE_HPP + +#include "../CppUnit/TestRunner.hpp" +#include "../CppUnit/framework/Test.h" +#include "../CppUnit/framework/TestSuite.h" + +#include "parse_test.hpp" +#include "value_test.hpp" +#include "arithmetic_test.hpp" +#include "relational_test.hpp" +#include "logical_test.hpp" +#include "axis_enumerator_test.hpp" +#include "node_test_test.hpp" +#include "step_test.hpp" +#include "execute_test.hpp" + +template +void XPath_test_suite(int argc, char** argv) +{ + TestRunner runner; + + runner.addTest("ValueTest", ValueTest_suite()); + runner.addTest("ArithmeticTest", ArithmeticTest_suite()); + runner.addTest("RelationalTest", RelationalTest_suite()); + runner.addTest("LogicalTest", LogicalTest_suite()); + runner.addTest("AxisEnumeratorTest", AxisEnumeratorTest_suite()); + runner.addTest("NodeTestTest", NodeTestTest_suite()); + runner.addTest("StepTest", StepTest_suite()); + runner.addTest("ParseTest", ParseTest_suite()); + runner.addTest("ExecuteTest", ExecuteTest_suite()); + + runner.run(argc, argv); +} // XPath_test_suite + +#endif diff --git a/test/XPath/xpathic.vcproj b/test/XPath/xpathic.vcproj index 8fe6076a..acb8cf58 100644 --- a/test/XPath/xpathic.vcproj +++ b/test/XPath/xpathic.vcproj @@ -134,31 +134,7 @@ Filter="h;hpp;hxx;hm;inl;inc;xsd" UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> - - - - - - - - - - - - - - - - + RelativePath=".\xpath_test_suite.hpp"> +#include "../XPath/xpath_test_suite.hpp" #include "../silly_string/silly_string.hpp" template<> class Arabica::default_string_adaptor : public silly_string_adaptor { }; @@ -27,18 +15,6 @@ int main(int argc, char** argv) { std::cout << "Hello" << std::endl; - TestRunner runner; - - runner.addTest("ValueTest", ValueTest_suite >()); - runner.addTest("ArithmeticTest", ArithmeticTest_suite >()); - runner.addTest("RelationalTest", RelationalTest_suite >()); - runner.addTest("LogicalTest", LogicalTest_suite >()); - runner.addTest("AxisEnumeratorTest", AxisEnumeratorTest_suite >()); - runner.addTest("NodeTestTest", NodeTestTest_suite >()); - runner.addTest("StepTest", StepTest_suite >()); - runner.addTest("ParseTest", ParseTest_suite >()); - runner.addTest("ExecuteTest", ExecuteTest_suite >()); - - runner.run(argc, argv); + XPath_test_suite >(argc, argv); } // main diff --git a/test/XPath_silly/xpathic_silly.vcproj b/test/XPath_silly/xpathic_silly.vcproj index 9be7071b..133944c6 100644 --- a/test/XPath_silly/xpathic_silly.vcproj +++ b/test/XPath_silly/xpathic_silly.vcproj @@ -136,35 +136,11 @@ Name="Header Files" Filter="h;hpp;hxx;hm;inl;inc;xsd" UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> - - - - - - - - - - - - - - - - + RelativePath="..\XPath\xpath_test_suite.hpp"> +#include +#include "../XPath/xpath_test_suite.hpp" ///////////////////////////////////////// int main(int argc, char** argv) { std::cout << "Hello" << std::endl; - TestRunner runner; - - runner.addTest("ValueTest", ValueTest_suite >()); - runner.addTest("ArithmeticTest", ArithmeticTest_suite >()); - runner.addTest("RelationalTest", RelationalTest_suite >()); - runner.addTest("LogicalTest", LogicalTest_suite >()); - runner.addTest("AxisEnumeratorTest", AxisEnumeratorTest_suite >()); - runner.addTest("NodeTestTest", NodeTestTest_suite >()); - runner.addTest("StepTest", StepTest_suite >()); - runner.addTest("ParseTest", ParseTest_suite >()); - runner.addTest("ExecuteTest", ExecuteTest_suite >()); - - runner.run(argc, argv); + XPath_test_suite >(argc, argv); } // main diff --git a/test/XPath_wide/xpathic_wide.vcproj b/test/XPath_wide/xpathic_wide.vcproj index 46e9cd39..9ad069fd 100644 --- a/test/XPath_wide/xpathic_wide.vcproj +++ b/test/XPath_wide/xpathic_wide.vcproj @@ -128,43 +128,13 @@ - - - - - - - - - - - - - - - - - - - - + RelativePath="..\XPath\xpath_test_suite.hpp">