File: test_pretty_print.cc

package info (click to toggle)
openscad 2015.03-2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 30,804 kB
  • ctags: 5,692
  • sloc: cpp: 39,386; sh: 3,856; ansic: 3,674; python: 1,393; yacc: 496; lex: 272; lisp: 159; makefile: 67; xml: 60
file content (30 lines) | stat: -rw-r--r-- 835 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* Workaround for CTEST_CUSTOM_POST_TEST not allowing arguments in some
 versions of cmake/ctest.

 compile with
 -DPYBIN=/usr/bin/python
 -DPYSRC=/home/janedoe/openscad/tests/test_pretty_print.py
 -DBUILDDIR=--builddir=/home/janedoe/openscad/tests/bin"

not usable for cross-build situations.
*/

#include <cstddef>
#include <unistd.h>
#include <stdio.h>

#define PREQUOTE(x) #x
#define QUOTE(x) PREQUOTE(x)
int main( int argc, char * argv[] )
{
	printf("test_pretty_print CTEST_CUSTOM_POST_TEST bug workaround\n");
	printf("attempting to run: %s %s %s\n",QUOTE(PYBIN),QUOTE(PYSRC),QUOTE(BUILDDIR));
	char *newargs[4];
	newargs[0] = const_cast<char *>(QUOTE( PYBIN ));
	newargs[1] = const_cast<char *>(QUOTE( PYSRC ));
	newargs[2] = const_cast<char *>(QUOTE( BUILDDIR ));
	newargs[3] = NULL;
	return execv( newargs[0], newargs );
}