diff options
author | Don Bright <hugh.m.bright@gmail.com> | 2013-09-12 05:17:17 (GMT) |
---|---|---|
committer | Don Bright <hugh.m.bright@gmail.com> | 2013-09-12 05:17:17 (GMT) |
commit | 6af6c311a12a0211545e29666c92f1806ca0c7e8 (patch) | |
tree | 5af3769a2bbd2cdc44508152cc1d2c72b2331e77 /tests/csgtestcore.cc | |
parent | b53dde04e2a13c066cfa0c552fe5bd0cdd1b8dbd (diff) |
cmdline throwntogether, integrate w chrysn tests, update resize tests
Diffstat (limited to 'tests/csgtestcore.cc')
-rw-r--r-- | tests/csgtestcore.cc | 54 |
1 files changed, 6 insertions, 48 deletions
diff --git a/tests/csgtestcore.cc b/tests/csgtestcore.cc index 7b9dbab..780dc2a 100644 --- a/tests/csgtestcore.cc +++ b/tests/csgtestcore.cc @@ -44,45 +44,11 @@ std::string commandline_commands; //#define DEBUG -string info_dump(OffscreenView *glview) -{ - assert(glview); - -#ifdef __GNUG__ -#define compiler_info "GCC " << __VERSION__ -#elif defined(_MSC_VER) -#define compiler_info "MSVC " << _MSC_FULL_VER -#else -#define compiler_info "unknown compiler" -#endif - -#ifndef OPENCSG_VERSION_STRING -#define OPENCSG_VERSION_STRING "unknown, <1.3.2" -#endif - - std::stringstream out; -#define STRINGIFY(x) #x -#define TOSTRING(x) STRINGIFY(x) - out << "\nOpenSCAD Version: " << TOSTRING(OPENSCAD_VERSION) - << "\nCompiled by: " << compiler_info - << "\nCompile date: " << __DATE__ - << "\nBoost version: " << BOOST_LIB_VERSION - << "\nEigen version: " << EIGEN_WORLD_VERSION << "." - << EIGEN_MAJOR_VERSION << "." << EIGEN_MINOR_VERSION - << "\nCGAL version: " << TOSTRING(CGAL_VERSION) - << "\nOpenCSG version: " << OPENCSG_VERSION_STRING - << "\n" << glview->getRendererInfo() - << "\n"; - - return out.str(); -} - po::variables_map parse_options(int argc, char *argv[]) { po::options_description desc("Allowed options"); desc.add_options() ("help,h", "help message")//; - ("info,i", "information on GLEW, OpenGL, OpenSCAD, and OS")//; // po::options_description hidden("Hidden options"); // hidden.add_options() @@ -104,7 +70,6 @@ po::variables_map parse_options(int argc, char *argv[]) int csgtestcore(int argc, char *argv[], test_type_e test_type) { - bool sysinfo_dump = false; const char *filename, *outfilename = NULL; po::variables_map vm; try { @@ -112,13 +77,12 @@ int csgtestcore(int argc, char *argv[], test_type_e test_type) } catch ( po::error e ) { cerr << "error parsing options\n"; } - if (vm.count("info")) sysinfo_dump = true; if (vm.count("input-file")) filename = vm["input-file"].as< vector<string> >().begin()->c_str(); if (vm.count("output-file")) outfilename = vm["output-file"].as< vector<string> >().begin()->c_str(); - if ((!filename || !outfilename) && !sysinfo_dump) { + if ((!filename || !outfilename)) { cerr << "Usage: " << argv[0] << " <file.scad> <output.png>\n"; exit(1); } @@ -138,21 +102,16 @@ int csgtestcore(int argc, char *argv[], test_type_e test_type) FileModule *root_module; ModuleInstantiation root_inst("group"); - if (sysinfo_dump) - root_module = parse("sphere();","",false); - else - root_module = parsefile(filename); + root_module = parsefile(filename); if (!root_module) { exit(1); } - if (!sysinfo_dump) { - fs::path fpath = boosty::absolute(fs::path(filename)); - fs::path fparent = fpath.parent_path(); - fs::current_path(fparent); - top_ctx.setDocumentPath(fparent.string()); - } + fs::path fpath = boosty::absolute(fs::path(filename)); + fs::path fparent = fpath.parent_path(); + fs::current_path(fparent); + top_ctx.setDocumentPath(fparent.string()); AbstractNode::resetIndexCounter(); AbstractNode *absolute_root_node = root_module->instantiate(&top_ctx, &root_inst); @@ -174,7 +133,6 @@ int csgtestcore(int argc, char *argv[], test_type_e test_type) exit(1); } - if (sysinfo_dump) cout << info_dump(csgInfo.glview); Camera camera(Camera::VECTOR); camera.center << 0,0,0; double radius = 1.0; |