summaryrefslogtreecommitdiff
path: root/tests/cgaltest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cgaltest.cc')
-rw-r--r--tests/cgaltest.cc24
1 files changed, 4 insertions, 20 deletions
diff --git a/tests/cgaltest.cc b/tests/cgaltest.cc
index 242b7b7..0cbd89a 100644
--- a/tests/cgaltest.cc
+++ b/tests/cgaltest.cc
@@ -25,8 +25,8 @@
*/
#include "myqhash.h"
+#include "tests-common.h"
#include "openscad.h"
-#include "handle_dep.h"
#include "node.h"
#include "module.h"
#include "context.h"
@@ -117,28 +117,12 @@ int main(int argc, char **argv)
AbstractModule *root_module;
ModuleInstantiation root_inst;
- QFileInfo fileInfo(filename);
- handle_dep(filename);
- FILE *fp = fopen(filename, "rt");
- if (!fp) {
- fprintf(stderr, "Can't open input file `%s'!\n", filename);
+ root_module = parsefile(filename);
+ if (!root_module) {
exit(1);
- } else {
- std::stringstream text;
- char buffer[513];
- int ret;
- while ((ret = fread(buffer, 1, 512, fp)) > 0) {
- buffer[ret] = 0;
- text << buffer;
- }
- fclose(fp);
- text << commandline_commands;
- root_module = parse(text.str().c_str(), fileInfo.absolutePath().toLocal8Bit(), false);
- if (!root_module) {
- exit(1);
- }
}
+ QFileInfo fileInfo(filename);
QDir::setCurrent(fileInfo.absolutePath());
AbstractNode::resetIndexCounter();
contact: Jan Huwald // Impressum