[moulette] switched to boost::signals2
[ozulis.git] / src / moulette / test-factory.cc
blob7b92e402bf37560f67a61440e38cd91b746ea1d6
1 #include <fstream>
2 #include <iostream>
3 #include <boost/foreach.hpp>
5 #include <ozulis/core/assert.hh>
6 #include <moulette/test-parser.hh>
7 #include <moulette/tests/basic-test-suite.hh>
8 #include <moulette/tests/compile-test.hh>
9 #include <moulette/tests/dummy-test.hh>
10 #include <moulette/tests/expr-test-suite.hh>
11 #include <moulette/tests/simple-process.hh>
12 #include "test-factory.hh"
14 namespace moulette
16 Testable *
17 TestFactory::loadTest(const boost::filesystem::path & path)
19 assert(boost::filesystem::is_regular_file(path));
21 return TestParser::parseFile(path);
24 Testable *
25 TestFactory::create(const std::string & type)
27 if (type == "dummy")
28 return new DummyTest;
29 if (type == "simple-process")
30 return new SimpleProcess;
31 if (type == "test-suite")
32 return new BasicTestSuite;
33 if (type == "compile-test")
34 return new CompileTest;
35 if (type == "expr-test-suite")
36 return new ExprTestSuite;
37 std::cerr << "test not found: " << type << std::endl;
38 assert(false);