stl_dim
Don Bright 2011-12-06 18:56:58 -06:00
parent d6ad921f5f
commit 750f3c8fc9
4 changed files with 28 additions and 186 deletions

View File

@ -1,7 +1,7 @@
Running regression tests:
-------------------------
Prerequisites: cmake, python, OpenCSG with FBO patch from ../patches applied
Prerequisites: cmake, python, ImageMagick 6.5.9.3 or newer
A) Building test environment
@ -16,25 +16,14 @@ First, get a normal build working by following instructions at
http://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Building_on_Windows
Then, from the QT command prompt:
$ cd tests
$ cmake . -DCMAKE_BUILD_TYPE=Release
$ sed -i s/\/MD/\/MT/ CMakeCache.txt
$ cmake .
$ nmake -f Makefile
> cd tests
> cmake . -DCMAKE_BUILD_TYPE=Release
> sed -i s/\/MD/\/MT/ CMakeCache.txt
> cmake .
> nmake -f Makefile
B) Running tests
Easy version:
$ make test
Windows:
$ nmake -f Makefile test
Headless unix servers (no X11):
$ Xvfb :5 -screen 0 800x600x24 &
$ DISPLAY=:5 make test
Partial or extended test runs:
$ ctest Runs tests enabled by default
$ ctest -R <regex> Runs only matching tests, e.g. ctest -R dxf
$ ctest -C <configs> Adds extended tests belonging to configs.
@ -44,6 +33,10 @@ $ ctest -C <configs> Adds extended tests belonging to configs.
Examples - test all examples
All - test everything
Headless unix servers (no X11):
$ Xvfb :5 -screen 0 800x600x24 &
$ DISPLAY=:5 ctest
Adding a new regression test:
------------------------------
@ -58,13 +51,16 @@ Adding a new regression test:
7) run the test normally and verify that it passes:
$ ctest -R mytest
Troubleshooting a failed test:
Troubleshooting:
------------------------------
To helping CMAKE find eigen2, OpenCSG, CGAL, Boost, and GLEW, you can use the
-D option. Here are some examples:
cmake . -DOPENCSG_DIR=~/OpenCSG-1.3.2
cmake . -DCGAL_DIR=c:\CGAL-3.7 -DBOOST_ROOT=c:\boost_1_46_0
Logs of test runs are found in tests/build/Testing/Temporary
Pretty-printed html output is in a subdir of tests/build/Testing/Temporary
Expected results are found in tests/regression/*
Actual results are found in tests/build/testname-output/*
You can also compile a single test program:
$ make cgalpngtest

View File

@ -1,153 +0,0 @@
Only in OpenCSG-1.3.1-fbopatch/: lib
diff -ur OpenCSG-1.3.1/Makefile OpenCSG-1.3.1-fbopatch/Makefile
--- OpenCSG-1.3.1/Makefile 2010-06-09 14:39:58.000000000 -0500
+++ OpenCSG-1.3.1-fbopatch/Makefile 2011-11-23 21:44:21.285641445 -0600
@@ -1,4 +1,4 @@
-SUBDIRS = glew src example
+SUBDIRS = src
all:
for X in $(SUBDIRS); do make -C $$X ; done
Only in OpenCSG-1.3.1-fbopatch/src: area.o
Only in OpenCSG-1.3.1-fbopatch/src: batch.o
Only in OpenCSG-1.3.1-fbopatch/src: channelManager.o
Only in OpenCSG-1.3.1-fbopatch/src: context.o
diff -ur OpenCSG-1.3.1/src/frameBufferObject.cpp OpenCSG-1.3.1-fbopatch/src/frameBufferObject.cpp
--- OpenCSG-1.3.1/src/frameBufferObject.cpp 2010-06-09 14:39:58.000000000 -0500
+++ OpenCSG-1.3.1-fbopatch/src/frameBufferObject.cpp 2011-11-23 22:19:33.545641258 -0600
@@ -3,8 +3,8 @@
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License,
-// Version 2, as published by the Free Software Foundation.
-// As a special exception, you have permission to link this library
+// Version 2, as published by the Free Software Foundation.
+// As a special exception, you have permission to link this library
// with the CGAL library and distribute executables.
//
// This library is distributed in the hope that it will be useful,
@@ -59,6 +59,7 @@
glGenRenderbuffers(1, &depthID);
glGenTextures(1, &textureID);
+ glGetIntegerv(GL_FRAMEBUFFER_BINDING, &oldFramebufferID);
glBindFramebuffer(GL_FRAMEBUFFER, framebufferID);
glBindTexture(GL_TEXTURE_2D, textureID);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_INT, 0);
@@ -78,7 +79,7 @@
return false;
}
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, oldFramebufferID);
glBindTexture(GL_TEXTURE_2D, 0);
textureTarget = GL_TEXTURE_2D;
@@ -135,7 +136,7 @@
// Unbinds frame buffer texture.
bool FrameBufferObject::EndCapture()
{
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, oldFramebufferID);
return true;
}
diff -ur OpenCSG-1.3.1/src/frameBufferObjectExt.cpp OpenCSG-1.3.1-fbopatch/src/frameBufferObjectExt.cpp
--- OpenCSG-1.3.1/src/frameBufferObjectExt.cpp 2010-06-09 14:39:58.000000000 -0500
+++ OpenCSG-1.3.1-fbopatch/src/frameBufferObjectExt.cpp 2011-11-23 21:43:17.701638949 -0600
@@ -3,8 +3,8 @@
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License,
-// Version 2, as published by the Free Software Foundation.
-// As a special exception, you have permission to link this library
+// Version 2, as published by the Free Software Foundation.
+// As a special exception, you have permission to link this library
// with the CGAL library and distribute executables.
//
// This library is distributed in the hope that it will be useful,
@@ -60,6 +60,7 @@
glGenRenderbuffersEXT(1, &depthID);
glGenTextures(1, &textureID);
+ glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &oldFramebufferID);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, framebufferID);
glBindTexture(GL_TEXTURE_2D, textureID);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_INT, 0);
@@ -79,7 +80,7 @@
return false;
}
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, oldFramebufferID);
glBindTexture(GL_TEXTURE_2D, 0);
textureTarget = GL_TEXTURE_2D;
@@ -136,7 +137,7 @@
// Unbinds frame buffer texture.
bool FrameBufferObjectExt::EndCapture()
{
- glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, oldFramebufferID);
return true;
}
diff -ur OpenCSG-1.3.1/src/frameBufferObjectExt.h OpenCSG-1.3.1-fbopatch/src/frameBufferObjectExt.h
--- OpenCSG-1.3.1/src/frameBufferObjectExt.h 2010-06-09 14:39:58.000000000 -0500
+++ OpenCSG-1.3.1-fbopatch/src/frameBufferObjectExt.h 2011-11-23 21:43:17.701638949 -0600
@@ -3,8 +3,8 @@
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License,
-// Version 2, as published by the Free Software Foundation.
-// As a special exception, you have permission to link this library
+// Version 2, as published by the Free Software Foundation.
+// As a special exception, you have permission to link this library
// with the CGAL library and distribute executables.
//
// This library is distributed in the hope that it will be useful,
@@ -85,6 +85,7 @@
unsigned int depthID;
unsigned int framebufferID;
+ int oldFramebufferID;
bool initialized;
};
Only in OpenCSG-1.3.1-fbopatch/src: frameBufferObjectExt.o
diff -ur OpenCSG-1.3.1/src/frameBufferObject.h OpenCSG-1.3.1-fbopatch/src/frameBufferObject.h
--- OpenCSG-1.3.1/src/frameBufferObject.h 2010-06-09 14:39:58.000000000 -0500
+++ OpenCSG-1.3.1-fbopatch/src/frameBufferObject.h 2011-11-23 21:43:17.701638949 -0600
@@ -3,8 +3,8 @@
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License,
-// Version 2, as published by the Free Software Foundation.
-// As a special exception, you have permission to link this library
+// Version 2, as published by the Free Software Foundation.
+// As a special exception, you have permission to link this library
// with the CGAL library and distribute executables.
//
// This library is distributed in the hope that it will be useful,
@@ -85,6 +85,7 @@
unsigned int depthID;
unsigned int framebufferID;
+ int oldFramebufferID;
bool initialized;
};
Only in OpenCSG-1.3.1-fbopatch/src: frameBufferObject.o
Only in OpenCSG-1.3.1-fbopatch/src: occlusionQuery.o
Only in OpenCSG-1.3.1-fbopatch/src: offscreenBuffer.o
Only in OpenCSG-1.3.1-fbopatch/src: opencsgRender.o
Only in OpenCSG-1.3.1-fbopatch/src: openglHelper.o
Only in OpenCSG-1.3.1-fbopatch/src: pBufferTexture.o
Only in OpenCSG-1.3.1-fbopatch/src: primitiveHelper.o
Only in OpenCSG-1.3.1-fbopatch/src: primitive.o
Only in OpenCSG-1.3.1-fbopatch/src: renderGoldfeather.o
Only in OpenCSG-1.3.1-fbopatch/src: renderSCS.o
Only in OpenCSG-1.3.1-fbopatch/src: RenderTexture.o
Only in OpenCSG-1.3.1-fbopatch/src: scissorMemo.o
Only in OpenCSG-1.3.1-fbopatch/src: settings.o
Only in OpenCSG-1.3.1-fbopatch/src: stencilManager.o

View File

@ -462,7 +462,7 @@ enable_testing()
# set up custom pretty printing of results
set(INFOCMD "execute_process(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/opencsgtest --info OUTPUT_FILE sysinfo.txt)")
set(PRETTYCMD "\"${PYTHON_EXECUTABLE} test_pretty_print.py --builddir=${CMAKE_CURRENT_BINARY_DIR}\"")
set(PRETTYCMD "\"${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_pretty_print.py --builddir=${CMAKE_CURRENT_BINARY_DIR}\"")
set(CTEST_CUSTOM_FILE ${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake)
set(CTEST_CUSTOM_TXT "\n
message(\"running 'opencsgtest --info' to generate sysinfo.txt\")\n
@ -471,14 +471,13 @@ set(CTEST_CUSTOM_TXT "\n
")
file(WRITE ${CTEST_CUSTOM_FILE} ${CTEST_CUSTOM_TXT})
foreach(FILE test_pretty_print.py)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${FILE}
${CMAKE_CURRENT_BINARY_DIR}/${FILE} COPYONLY)
endforeach()
#foreach(FILE test_pretty_print.py)
# configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${FILE}
# ${CMAKE_CURRENT_BINARY_DIR}/${FILE} COPYONLY)
#endforeach()
set_directory_properties(PROPERTIES TEST_INCLUDE_FILE "${CMAKE_SOURCE_DIR}/EnforceConfig.cmake")
# Find all scad files
file(GLOB MINIMAL_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/minimal/*.scad)
file(GLOB FEATURES_FILES ${CMAKE_SOURCE_DIR}/../testdata/scad/features/*.scad)
@ -527,7 +526,7 @@ disable_tests(dumptest_transform-tests
disable_tests(opencsgtest_child-background)
# FIXME: This single test takes over an hour to run on a 2.7 GHz P4
disable_tests(opencsgtest_example006)
disable_tests(opencsgtest_example006 cgalpngtest_example006)
# These tests only makes sense in OpenCSG mode
disable_tests(cgalpngtest_child-background

View File

@ -59,7 +59,7 @@ def tryread(filename):
def trysave(filename,data):
try:
if not os.path.isdir(os.path.dirname(filename)):
print 'creating',os.path.dirname(filename)
#print 'creating',os.path.dirname(filename)
os.mkdir(os.path.dirname(filename))
f=open(filename,'wb')
f.write(data)
@ -386,14 +386,14 @@ def main():
logpath, logfilename = findlogfile(builddir)
testlog = tryread(logfilename)
startdate, tests, enddate = parselog(testlog)
print 'found sysinfo.txt'
print 'found', len(makefiles),'makefiles'
print 'found sysinfo.txt,',
print 'found', len(makefiles),'makefiles,',
print 'found', len(tests),'test results'
imgs, txtpages = towiki(wiki_rootpath, startdate, tests, enddate, sysinfo, sysid, makefiles)
wikidir = os.path.join(logpath,sysid+'_wiki')
print 'writing',len(imgs),'images and',len(txtpages),'wiki pages to:\n ', wikidir
print 'writing',len(imgs),'images and',len(txtpages),'wiki pages to:\n ', '.'+wikidir.replace(os.getcwd(),'')
for k in sorted(imgs): trysave( os.path.join(wikidir,k), imgs[k])
for k in sorted(txtpages): trysave( os.path.join(wikidir,k), txtpages[k])