aboutsummaryrefslogtreecommitdiff
path: root/test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test.cc')
-rw-r--r--test.cc52
1 files changed, 47 insertions, 5 deletions
diff --git a/test.cc b/test.cc
index b3bf40e..9b978da 100644
--- a/test.cc
+++ b/test.cc
@@ -1,12 +1,54 @@
#include "plattform_guard.h"
#include "transformation_facade.h"
-#include "gtest/gtest.h"
+#include "boost/program_options.hpp"
-int main(int argc, char** argv) {
- InputXSLT::PlattformGuard plattform;
+#include <iostream>
- testing::InitGoogleTest(&argc, argv);
+int main(int ac, char** av) {
+ boost::program_options::options_description optionDescription(
+ "Supported options"
+ );
+
+ optionDescription.add_options()
+ ("transformation", boost::program_options::value<std::string>()->required(), "transformation file")
+ ("target", boost::program_options::value<std::string>()->required(), "target file")
+ ;
+
+ boost::program_options::variables_map variables;
+
+ boost::program_options::store(
+ boost::program_options::parse_command_line(
+ ac, av, optionDescription
+ ),
+ variables
+ );
+
+ try {
+ boost::program_options::notify(variables);
+ }
+ catch ( std::exception& exception ) {
+ std::cerr << exception.what() << std::endl;
+ }
+
+ if ( variables.count("transformation") &&
+ variables.count("target") ) {
+ InputXSLT::PlattformGuard plattform;
+
+ InputXSLT::TransformationFacade transformation(
+ variables["transformation"].as<std::string>()
+ );
+
+ return transformation.generate(
+ variables["target"].as<std::string>(),
+ {
+ {"test", "42"}
+ }
+ );
+ } else {
+ std::cout << optionDescription << std::endl;
+
+ return 1;
+ }
- return RUN_ALL_TESTS();
}