mirror of https://github.com/vitalif/openscad
little tweaks, cleanups, tab fixing, eliminating comments
parent
d6a57b8968
commit
30fd8b250a
|
@ -3,8 +3,10 @@ Running regression tests:
|
|||
|
||||
Prerequisites: cmake, python, ImageMagick 6.5.9.3 or newer
|
||||
|
||||
First, get a working qmake GUI build. It is used by the tests.
|
||||
Next, get MCAD installed by using 'git submodule update --init'
|
||||
First, get a working qmake GUI build of the main openscad binary. It is
|
||||
used by the tests. Next, get MCAD installed by using
|
||||
|
||||
'git submodule update --init'
|
||||
|
||||
A) Building test environment
|
||||
|
||||
|
@ -67,18 +69,6 @@ This is almost the same as adding a new regression test:
|
|||
Migration away from dedicated regression tests:
|
||||
-----------------------------------------------
|
||||
|
||||
As the main OpenSCAD binary gained the capability to output PNG renderings,
|
||||
the necessity for dedicated test binaries went away; for many test, OpenSCAD
|
||||
is now directly called, resulting in better test coverage and less code to
|
||||
maintain.
|
||||
|
||||
So far, the following tests have been fully converted to use the main binary:
|
||||
|
||||
* moduledumptest
|
||||
* csgtermtest
|
||||
* cgalpngtest
|
||||
* opencsgtest
|
||||
|
||||
Two tests still need an intermediate script that mangles away timestamps and
|
||||
near-zero floating point numbers:
|
||||
|
||||
|
@ -89,7 +79,6 @@ near-zero floating point numbers:
|
|||
Some tests are yet to be converted:
|
||||
|
||||
* csgtexttest -- verify whether this is not redundant with dumptest
|
||||
* throwntogethertest -- should be a .png output mode
|
||||
|
||||
These look like tests, but are not actually in use:
|
||||
|
||||
|
|
|
@ -41,9 +41,6 @@ void export_png_with_cgal(CGAL_Nef_polyhedron *root_N, Camera &cam, std::ostream
|
|||
cam.eye = cam.center - radius*2*cameradir;
|
||||
}
|
||||
|
||||
//std::cerr << center << "\n";
|
||||
//std::cerr << radius << "\n";
|
||||
|
||||
glview->setCamera( cam );
|
||||
glview->setRenderer(&cgalRenderer);
|
||||
glview->paintGL();
|
||||
|
@ -60,8 +57,8 @@ enum Previewer { OPENCSG, THROWN } previewer;
|
|||
|
||||
void export_png_preview_common( Tree &tree, Camera &cam, std::ostream &output, Previewer previewer = OPENCSG )
|
||||
{
|
||||
CsgInfo csgInfo = CsgInfo();
|
||||
if ( !csgInfo.compile_chains( tree ) ) {
|
||||
CsgInfo csgInfo = CsgInfo();
|
||||
if ( !csgInfo.compile_chains( tree ) ) {
|
||||
fprintf(stderr,"Couldn't initialize CSG chains\n");
|
||||
return;
|
||||
}
|
||||
|
@ -74,7 +71,7 @@ void export_png_preview_common( Tree &tree, Camera &cam, std::ostream &output, P
|
|||
}
|
||||
|
||||
Renderer *renderer;
|
||||
if ( previewer == OPENCSG) {
|
||||
if ( previewer == OPENCSG ) {
|
||||
#ifdef ENABLE_OPENCSG
|
||||
OpenCSGRenderer openCSGRenderer(csgInfo.root_chain, csgInfo.highlights_chain, csgInfo.background_chain, csgInfo.glview->shaderinfo);
|
||||
renderer = &openCSGRenderer;
|
||||
|
@ -97,15 +94,13 @@ void export_png_preview_common( Tree &tree, Camera &cam, std::ostream &output, P
|
|||
}
|
||||
|
||||
csgInfo.glview->setCamera( cam );
|
||||
csgInfo.glview->setRenderer( renderer );
|
||||
#ifdef ENABLE_OPENCSG
|
||||
csgInfo.glview->setRenderer(renderer);
|
||||
OpenCSG::setContext(0);
|
||||
OpenCSG::setOption(OpenCSG::OffscreenSetting, OpenCSG::FrameBufferObject);
|
||||
#else
|
||||
csgInfo.glview->setRenderer(renderer);
|
||||
OpenCSG::setContext( 0 );
|
||||
OpenCSG::setOption( OpenCSG::OffscreenSetting, OpenCSG::FrameBufferObject );
|
||||
#endif
|
||||
csgInfo.glview->paintGL();
|
||||
csgInfo.glview->save(output);
|
||||
csgInfo.glview->save( output );
|
||||
}
|
||||
|
||||
void export_png_with_opencsg(Tree &tree, Camera &cam, std::ostream &output)
|
||||
|
|
|
@ -88,7 +88,7 @@ static void help(const char *progname)
|
|||
"%*s[ --camera=translatex,y,z,rotx,y,z,dist | \\\n"
|
||||
"%*s --camera=eyex,y,z,centerx,y,z ] \\\n"
|
||||
"%*s[ --imgsize=width,height ] [ --projection=(o)rtho|(p)ersp] \\\n"
|
||||
"%*s[ --render | --preview[=throwntogether] ] \\\n"
|
||||
"%*s[ --render | --preview[=throwntogether] ] \\\n"
|
||||
"%*sfilename\n",
|
||||
progname, tab, "", tab, "", tab, "", tab, "", tab, "", tab, "");
|
||||
exit(1);
|
||||
|
|
|
@ -73,13 +73,13 @@ translate([10,90,10]) resize([0,0,7],auto=[true,true,false]) cube();
|
|||
}
|
||||
|
||||
color("pink"){
|
||||
translate([0 , 0,-10]) resize([4,4,4]) resize([5000,100,1000]) cube();
|
||||
translate([10,0,-10]) resize([-5,0,0]) cube();
|
||||
translate([20,0,-10]) resize([-5,0,0],auto=3) cube();
|
||||
translate([30,0,-10]) resize(-5,0,0,auto=3) cube();
|
||||
translate([40,0,-10]) resize(5,0,0) cube();
|
||||
translate([50,0,-10]) resize([0.5,0,7]) cube([0.5,1,1000]);
|
||||
translate([60,0,-10]) resize([0,0,0.5]) cube([6,6,10000000000]);
|
||||
translate([10 , 0,-10]) resize([4,4,4]) resize([5000,100,1000]) cube();
|
||||
translate([20,0,-10]) resize([-5,0,0]) cube();
|
||||
translate([30,0,-10]) resize([-5,0,0],auto=3) cube();
|
||||
translate([40,0,-10]) resize(-5,0,0,auto=3) cube();
|
||||
translate([50,0,-10]) resize(5,0,0) cube();
|
||||
translate([60,0,-10]) resize([0.5,0,7]) cube([0.5,1,1000]);
|
||||
translate([70,0,-10]) resize([0,0,0.5]) cube([6,6,10000000000]);
|
||||
}
|
||||
|
||||
color("lime"){
|
||||
|
|
|
@ -540,14 +540,6 @@ add_executable(cgalcachetest cgalcachetest.cc)
|
|||
set_target_properties(cgalcachetest PROPERTIES COMPILE_FLAGS "-DENABLE_CGAL ${CGAL_CXX_FLAGS_INIT}")
|
||||
target_link_libraries(cgalcachetest tests-cgal ${TESTS-CGAL-LIBRARIES} ${GLEW_LIBRARY} ${COCOA_LIBRARY})
|
||||
|
||||
#
|
||||
# throwntogethertest
|
||||
#
|
||||
|
||||
#add_executable(throwntogethertest throwntogethertest.cc csgtestcore.cc ../src/OpenCSGRenderer.cc ../src/ThrownTogetherRenderer.cc ../src/renderer.cc ../src/rendersettings.cc)
|
||||
#set_target_properties(throwntogethertest PROPERTIES COMPILE_FLAGS "-DENABLE_OPENCSG -DENABLE_CGAL ${CGAL_CXX_FLAGS_INIT}")
|
||||
#target_link_libraries(throwntogethertest tests-offscreen tests-cgal ${OPENCSG_LIBRARY} ${TESTS-CGAL-LIBRARIES} ${GLEW_LIBRARY} ${COCOA_LIBRARY})
|
||||
|
||||
#
|
||||
# GUI binary tests
|
||||
#
|
||||
|
@ -866,7 +858,6 @@ add_cmdline_test(csgtermtest EXE ${GUI_BINPATH} ARGS -o SUFFIX term FILES
|
|||
add_cmdline_test(cgalpngtest EXE ${GUI_BINPATH} ARGS --render -o SUFFIX png FILES ${CGALPNGTEST_FILES})
|
||||
add_cmdline_test(opencsgtest EXE ${GUI_BINPATH} ARGS -o SUFFIX png FILES ${OPENCSGTEST_FILES})
|
||||
add_cmdline_test(throwntogethertest EXE ${GUI_BINPATH} ARGS --preview=throwntogether -o SUFFIX png FILES ${THROWNTOGETHERTEST_FILES})
|
||||
#add_cmdline_test(throwntogethertest SUFFIX png FILES ${THROWNTOGETHERTEST_FILES})
|
||||
# FIXME: We don't actually need to compare the output of cgalstlsanitytest
|
||||
# with anything. It's self-contained and returns != 0 on error
|
||||
add_cmdline_test(cgalstlsanitytest EXE ${CMAKE_SOURCE_DIR}/cgalstlsanitytest SUFFIX txt ARGS ${GUI_BINPATH} FILES ${CGALSTLSANITYTEST_FILES})
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
|
@ -230,25 +230,20 @@ group() {
|
|||
}
|
||||
}
|
||||
color([1, 0.752941, 0.796078, 1]) {
|
||||
multmatrix([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, -10], [0, 0, 0, 1]]) {
|
||||
multmatrix([[1, 0, 0, 10], [0, 1, 0, 0], [0, 0, 1, -10], [0, 0, 0, 1]]) {
|
||||
resize(newsize = [4,4,4], auto = [0,0,0]) {
|
||||
resize(newsize = [5000,100,1000], auto = [0,0,0]) {
|
||||
cube(size = [1, 1, 1], center = false);
|
||||
}
|
||||
}
|
||||
}
|
||||
multmatrix([[1, 0, 0, 10], [0, 1, 0, 0], [0, 0, 1, -10], [0, 0, 0, 1]]) {
|
||||
resize(newsize = [-5,0,0], auto = [0,0,0]) {
|
||||
cube(size = [1, 1, 1], center = false);
|
||||
}
|
||||
}
|
||||
multmatrix([[1, 0, 0, 20], [0, 1, 0, 0], [0, 0, 1, -10], [0, 0, 0, 1]]) {
|
||||
resize(newsize = [-5,0,0], auto = [0,0,0]) {
|
||||
cube(size = [1, 1, 1], center = false);
|
||||
}
|
||||
}
|
||||
multmatrix([[1, 0, 0, 30], [0, 1, 0, 0], [0, 0, 1, -10], [0, 0, 0, 1]]) {
|
||||
resize(newsize = [0,0,0], auto = [0,0,0]) {
|
||||
resize(newsize = [-5,0,0], auto = [0,0,0]) {
|
||||
cube(size = [1, 1, 1], center = false);
|
||||
}
|
||||
}
|
||||
|
@ -258,11 +253,16 @@ group() {
|
|||
}
|
||||
}
|
||||
multmatrix([[1, 0, 0, 50], [0, 1, 0, 0], [0, 0, 1, -10], [0, 0, 0, 1]]) {
|
||||
resize(newsize = [0,0,0], auto = [0,0,0]) {
|
||||
cube(size = [1, 1, 1], center = false);
|
||||
}
|
||||
}
|
||||
multmatrix([[1, 0, 0, 60], [0, 1, 0, 0], [0, 0, 1, -10], [0, 0, 0, 1]]) {
|
||||
resize(newsize = [0.5,0,7], auto = [0,0,0]) {
|
||||
cube(size = [0.5, 1, 1000], center = false);
|
||||
}
|
||||
}
|
||||
multmatrix([[1, 0, 0, 60], [0, 1, 0, 0], [0, 0, 1, -10], [0, 0, 0, 1]]) {
|
||||
multmatrix([[1, 0, 0, 70], [0, 1, 0, 0], [0, 0, 1, -10], [0, 0, 0, 1]]) {
|
||||
resize(newsize = [0,0,0.5], auto = [0,0,0]) {
|
||||
cube(size = [6, 6, 1e+10], center = false);
|
||||
}
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
Binary file not shown.
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
Loading…
Reference in New Issue