summaryrefslogtreecommitdiff
path: root/tests/guiopencsgtest.cc
diff options
context:
space:
mode:
authordon bright <hugh.m.bright@gmail.com>2013-02-25 03:07:37 (GMT)
committerdon bright <hugh.m.bright@gmail.com>2013-02-25 03:07:37 (GMT)
commit9896b6f15eced6d05a131ece44d60745e200b8f5 (patch)
tree7d8a362003174ed6b150c439f2827d6a7252674d /tests/guiopencsgtest.cc
parent8738cdc03451803014ca84f8614bdff1ff393ca9 (diff)
first working version of opencsg png export from gui binary
also guiopencsgtest introduced. passes 100% of 'normal' tests
Diffstat (limited to 'tests/guiopencsgtest.cc')
-rw-r--r--tests/guiopencsgtest.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/guiopencsgtest.cc b/tests/guiopencsgtest.cc
new file mode 100644
index 0000000..75e6abd
--- /dev/null
+++ b/tests/guiopencsgtest.cc
@@ -0,0 +1,27 @@
+// Wrapper around openscad gui binary, so it can act like a 'test'
+
+#include <unistd.h>
+#include <stdio.h>
+#ifndef BINPATH
+#error please define BINPATH=/some/path/openscad when compiling
+#endif
+#define PREQUOTE(x) #x
+#define QUOTE(x) PREQUOTE(x)
+int main( int argc, char * argv[] )
+{
+ fprintf(stderr,"%s: wrapper for OpenSCAD at %s\n", argv[0], QUOTE( BINPATH ) );
+ if ( argc != 3 ) {
+ fprintf(stderr,"%s: bad number of arguments: %i\n", argv[0], argc);
+ return 1;
+ }
+ char *newargs[6];
+ char *scadfilename = argv[1];
+ char *pngfilename = argv[2];
+ newargs[0] = const_cast<char *>(QUOTE( BINPATH ));
+ newargs[1] = scadfilename;
+ newargs[2] = const_cast<char *>("-o");
+ newargs[3] = pngfilename;
+ newargs[4] = NULL;
+ return execv( newargs[0], newargs );
+}
+
contact: Jan Huwald // Impressum