diff options
Diffstat (limited to 'tests/csgtermtest.cc')
-rw-r--r-- | tests/csgtermtest.cc | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/tests/csgtermtest.cc b/tests/csgtermtest.cc index e793c4a..1460bbd 100644 --- a/tests/csgtermtest.cc +++ b/tests/csgtermtest.cc @@ -31,14 +31,13 @@ #include "parsersettings.h" #include "node.h" #include "module.h" -#include "context.h" +#include "modcontext.h" #include "value.h" #include "export.h" #include "builtin.h" #include "Tree.h" #include "csgterm.h" -#include <QCoreApplication> #ifndef _MSC_VER #include <getopt.h> #endif @@ -53,7 +52,6 @@ namespace fs = boost::filesystem; std::string commandline_commands; std::string currentdir; -QString examplesdir; using std::cout; @@ -71,19 +69,18 @@ int main(int argc, char **argv) Builtins::instance()->initialize(); - QCoreApplication app(argc, argv); fs::path original_path = fs::current_path(); currentdir = boosty::stringy( fs::current_path() ); - parser_init(QCoreApplication::instance()->applicationDirPath().toStdString()); - add_librarydir(boosty::stringy(fs::path(QCoreApplication::instance()->applicationDirPath().toStdString()) / "../libraries")); + parser_init(boosty::stringy(fs::path(argv[0]).branch_path())); + add_librarydir(boosty::stringy(fs::path(argv[0]).branch_path() / "../libraries")); - Context root_ctx; - register_builtin(root_ctx); + ModuleContext top_ctx; + top_ctx.registerBuiltin(); - AbstractModule *root_module; - ModuleInstantiation root_inst; + FileModule *root_module; + ModuleInstantiation root_inst("group"); const AbstractNode *root_node; root_module = parsefile(filename); @@ -96,7 +93,7 @@ int main(int argc, char **argv) } AbstractNode::resetIndexCounter(); - root_node = root_module->evaluate(&root_ctx, &root_inst); + root_node = root_module->instantiate(&top_ctx, &root_inst); Tree tree(root_node); |