diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/OffscreenContext.cc | 2 | ||||
-rw-r--r-- | tests/OffscreenView.h | 3 | ||||
-rw-r--r-- | tests/cgalpngtest.cc | 1 | ||||
-rw-r--r-- | tests/opencsgtest.cc | 18 | ||||
-rwxr-xr-x | tests/test_cmdline_tool.py | 8 |
5 files changed, 21 insertions, 11 deletions
diff --git a/tests/OffscreenContext.cc b/tests/OffscreenContext.cc index d5c4c09..66b4ab3 100644 --- a/tests/OffscreenContext.cc +++ b/tests/OffscreenContext.cc @@ -181,7 +181,7 @@ bool save_framebuffer(OffscreenContext *ctx, const char *filename) //char * filename2="blah2.tga"; //PRINTF("writing %s\n",filename2); //write_targa(filename2,pixels,ctx->width, ctx->height); - char * filename2="blah2.png"; + //char * filename2="blah2.png"; PRINTF("writing %s . . .",filename); //write_targa(filename2,pixels,ctx->width, ctx->height); write_png(filename,pixels,ctx->width, ctx->height); diff --git a/tests/OffscreenView.h b/tests/OffscreenView.h index 587255a..85c0144 100644 --- a/tests/OffscreenView.h +++ b/tests/OffscreenView.h @@ -1,6 +1,9 @@ #ifndef OFFSCREENVIEW_H_ #define OFFSCREENVIEW_H_ +#define EIGEN_DONT_VECTORIZE 1 +#define EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT 1 + #include "OffscreenContext.h" #include <Eigen/Core> #include <Eigen/Geometry> diff --git a/tests/cgalpngtest.cc b/tests/cgalpngtest.cc index d7c6886..cae5c67 100644 --- a/tests/cgalpngtest.cc +++ b/tests/cgalpngtest.cc @@ -178,6 +178,7 @@ int main(int argc, char **argv) QDir::setCurrent(original_path.absolutePath()); +// match with csgtest ends csgInfo.glview = new OffscreenView(512,512); //glewInit(); diff --git a/tests/opencsgtest.cc b/tests/opencsgtest.cc index 98e1037..d5e83dd 100644 --- a/tests/opencsgtest.cc +++ b/tests/opencsgtest.cc @@ -1,4 +1,4 @@ -#include <GL/glew.h> +//#include <GL/glew.h> #include "openscad.h" #include "handle_dep.h" #include "builtin.h" @@ -144,9 +144,9 @@ int main(int argc, char *argv[]) CsgInfo csgInfo; CGALEvaluator cgalevaluator(tree); CSGTermEvaluator evaluator(tree, &cgalevaluator.psevaluator); - CSGTerm *root_raw_term = evaluator.evaluateCSGTerm(*root_node, - csgInfo.highlight_terms, - csgInfo.background_terms); + CSGTerm *root_raw_term = evaluator.evaluateCSGTerm(*root_node, + csgInfo.highlight_terms, + csgInfo.background_terms); if (!root_raw_term) { cerr << "Error: CSG generation failed! (no top level object found)\n"; @@ -203,6 +203,8 @@ int main(int argc, char *argv[]) QDir::setCurrent(original_path.absolutePath()); + + csgInfo.glview = new OffscreenView(512,512); BoundingBox bbox = csgInfo.root_chain->getBoundingBox(); @@ -214,7 +216,7 @@ int main(int argc, char *argv[]) Vector3d camerapos = center - radius*1.8*cameradir; csgInfo.glview->setCamera(camerapos, center); - glewInit(); + //glewInit(); #ifdef DEBUG cout << "GLEW version " << glewGetString(GLEW_VERSION) << "\n"; cout << (const char *)glGetString(GL_RENDERER) << "(" << (const char *)glGetString(GL_VENDOR) << ")\n" @@ -234,9 +236,9 @@ int main(int argc, char *argv[]) #endif OpenCSGRenderer opencsgRenderer(csgInfo.root_chain, csgInfo.highlights_chain, csgInfo.background_chain, csgInfo.glview->shaderinfo); - ThrownTogetherRenderer thrownTogetherRenderer(csgInfo.root_chain, csgInfo.highlights_chain, csgInfo.background_chain); - csgInfo.glview->setRenderer(&thrownTogetherRenderer); -// csgInfo.glview->setRenderer(&opencsgRenderer); + //ThrownTogetherRenderer thrownTogetherRenderer(csgInfo.root_chain, csgInfo.highlights_chain, csgInfo.background_chain); + //csgInfo.glview->setRenderer(&thrownTogetherRenderer); + csgInfo.glview->setRenderer(&opencsgRenderer); csgInfo.glview->paintGL(); diff --git a/tests/test_cmdline_tool.py b/tests/test_cmdline_tool.py index 7f68775..07afcc8 100755 --- a/tests/test_cmdline_tool.py +++ b/tests/test_cmdline_tool.py @@ -47,8 +47,8 @@ def execute_and_redirect(cmd, params, outfile): try: proc = subprocess.Popen([cmd] + params, stdout=outfile) retval = proc.wait() - except OSError as (errno, strerror): - print >> sys.stderr, "Error: ", errno, strerror + except: + print >> sys.stderr, "Error running subprocess: ", sys.exc_info()[1] print >> sys.stderr, " cmd:", cmd print >> sys.stderr, " params:", params print >> sys.stderr, " outfile:", outfile @@ -68,6 +68,10 @@ def compare_default(resultfilename): return True def compare_png(resultfilename): + if not resultfilename: + print >> sys.stderr, "Error: OpenSCAD did not generate an image" + return False + print >> sys.stderr, 'Yee image compare: ', expectedfilename, ' ', resultfilename if execute_and_redirect("./yee_compare", [expectedfilename, resultfilename], sys.stderr) != 0: return False return True |