diff options
author | don bright <hugh.m.bright@gmail.com> | 2011-10-16 03:59:54 (GMT) |
---|---|---|
committer | don bright <hugh.m.bright@gmail.com> | 2011-10-16 03:59:54 (GMT) |
commit | e79ee827185e19daac8f4d2385cce44098374d64 (patch) | |
tree | f252577c49f4ecd586cb6f9977b0d77667d61a1b /tests/csgtermtest.cc | |
parent | 786dc3de411074a4b90fc51397c10539c45272f7 (diff) |
fix text tests for windows + enable framebuffer tests
Diffstat (limited to 'tests/csgtermtest.cc')
-rw-r--r-- | tests/csgtermtest.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/csgtermtest.cc b/tests/csgtermtest.cc index 80b9b9c..643a64f 100644 --- a/tests/csgtermtest.cc +++ b/tests/csgtermtest.cc @@ -47,6 +47,7 @@ #include <assert.h> #include <iostream> #include <sstream> +#include <fstream> using std::cout; @@ -57,12 +58,13 @@ QString librarydir; int main(int argc, char **argv) { - if (argc != 2) { - fprintf(stderr, "Usage: %s <file.scad>\n", argv[0]); + if (argc != 3) { + fprintf(stderr, "Usage: %s <file.scad> <output.txt>\n", argv[0]); exit(1); } const char *filename = argv[1]; + const char *outfilename = argv[2]; int rc = 0; @@ -161,12 +163,15 @@ int main(int argc, char **argv) // if (evaluator.background) cout << "Background terms: " << evaluator.background->size() << "\n"; // if (evaluator.highlights) cout << "Highlights terms: " << evaluator.highlights->size() << "\n"; + std::ofstream outfile; + outfile.open(outfilename); if (root_term) { - cout << root_term->dump() << "\n"; + outfile << root_term->dump() << "\n"; } else { - cout << "No top-level CSG object\n"; + outfile << "No top-level CSG object\n"; } + outfile.close(); destroy_builtin_functions(); destroy_builtin_modules(); |