mirror of https://github.com/vitalif/openscad
fix stencil code for windows. tweak pretty printer for windows
parent
cea502f9a3
commit
aa8d53614a
|
@ -25,12 +25,11 @@ cmake ..
|
|||
nmake -f Makefile
|
||||
nmake -f Makefile test
|
||||
|
||||
Running on headless (no X) servers:
|
||||
Running on headless (no X) unix servers:
|
||||
|
||||
Xvnc :5 -screen 0 800x600x24 &
|
||||
DISPLAY=:5 make test
|
||||
|
||||
|
||||
Adding a new regression test:
|
||||
------------------------------
|
||||
|
||||
|
|
|
@ -82,8 +82,8 @@ string offscreen_context_getinfo(OffscreenContext *ctx)
|
|||
{
|
||||
stringstream out;
|
||||
out << "GL context creator: WGL\n"
|
||||
out << "PNG generator: lodepng\n"
|
||||
<< get_windows_info();
|
||||
<< "PNG generator: lodepng\n"
|
||||
<< get_os_info();
|
||||
return out.str();
|
||||
}
|
||||
|
||||
|
@ -130,11 +130,15 @@ bool create_wgl_dummy_context(OffscreenContext &ctx)
|
|||
ZeroMemory( &pixformat, sizeof( pixformat ) );
|
||||
pixformat.nSize = sizeof( pixformat );
|
||||
pixformat.nVersion = 1;
|
||||
pixformat.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL;
|
||||
pixformat.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
|
||||
pixformat.iPixelType = PFD_TYPE_RGBA;
|
||||
pixformat.cColorBits = 24;
|
||||
pixformat.cDepthBits = 16;
|
||||
pixformat.iLayerType = PFD_MAIN_PLANE;
|
||||
pixformat.cGreenBits = 8;
|
||||
pixformat.cRedBits = 8;
|
||||
pixformat.cBlueBits = 8;
|
||||
pixformat.cAlphaBits = 8;
|
||||
pixformat.cDepthBits = 24;
|
||||
pixformat.cStencilBits = 8;
|
||||
|
||||
chosenformat = ChoosePixelFormat( dev_context, &pixformat );
|
||||
if (chosenformat==0) {
|
||||
cerr << "MS GDI - ChoosePixelFormat failed\n";
|
||||
|
@ -215,6 +219,7 @@ bool teardown_offscreen_context(OffscreenContext *ctx)
|
|||
*/
|
||||
bool save_framebuffer(OffscreenContext *ctx, const char *filename)
|
||||
{
|
||||
wglSwapLayerBuffers( ctx->dev_context, WGL_SWAP_MAIN_PLANE );
|
||||
if (!ctx || !filename) return false;
|
||||
int samplesPerPixel = 4; // R, G, B and A
|
||||
vector<GLubyte> pixels(ctx->width * ctx->height * samplesPerPixel);
|
||||
|
|
|
@ -35,6 +35,7 @@ def init_expected_filename(testname, cmd):
|
|||
global expecteddir, expectedfilename
|
||||
expecteddir = os.path.join(options.regressiondir, os.path.split(cmd)[1])
|
||||
expectedfilename = os.path.join(expecteddir, testname + "-expected." + options.suffix)
|
||||
expectedfilename = os.path.normpath( expectedfilename )
|
||||
|
||||
def verify_test(testname, cmd):
|
||||
global expectedfilename
|
||||
|
|
|
@ -196,11 +196,11 @@ FAILED_TESTLOGS
|
|||
s = wiki_template
|
||||
repeat1 = ezsearch('(<REPEAT1>.*?</REPEAT1>)',s)
|
||||
repeat2 = ezsearch('(<REPEAT2>.*?</REPEAT2>)',s)
|
||||
dic = { 'STARTDATE': startdate, 'ENDDATE': enddate, 'WIKI_ROOTPATH': wiki_rootpath,
|
||||
'SYSINFO': sysinfo, 'SYSID':sysid, 'LASTTESTLOG':testlog,
|
||||
'NUMTESTS':len(tests), 'NUMPASSED':numpassed, 'PERCENTPASSED':percent }
|
||||
dic = { 'STARTDATE': str(startdate), 'ENDDATE': str(enddate), 'WIKI_ROOTPATH': str(wiki_rootpath),
|
||||
'SYSINFO': str(sysinfo), 'SYSID':str(sysid), 'LASTTESTLOG':str(testlog),
|
||||
'NUMTESTS':str(len(tests)), 'NUMPASSED':str(numpassed), 'PERCENTPASSED':str(percent) }
|
||||
for key in dic.keys():
|
||||
s = re.sub(key,str(dic[key]),s)
|
||||
s = s.replace(key,dic[key])
|
||||
testlogs = ''
|
||||
for t in tests:
|
||||
# if t.passed: noop
|
||||
|
@ -236,7 +236,7 @@ def wikitohtml(wiki_rootpath, sysid, wikidata, manifest):
|
|||
x=re.sub("'''(.*?)'''","<b>\\1</b>",x)
|
||||
filestrs=re.findall('\[\[File\:(.*?)\|.*?\]\]',x)
|
||||
for f in filestrs:
|
||||
newfile_html='<img src="'+revmanifest[f]+'" width=250/>'
|
||||
newfile_html='<img src="'+os.path.abspath(revmanifest[f])+'" width=250/>'
|
||||
x=re.sub('\[\[File\:'+f+'\|.*?\]\]',newfile_html,x)
|
||||
dic = { '|}':'</table>', '|-':'<tr>', '||':'<td>', '|':'<td>',
|
||||
'!!':'<th>', '!':'<tr><th>', '\n\n':'\n<p>\n'} #order matters
|
||||
|
@ -262,7 +262,7 @@ def upload(wikiurl,api_php_path,wikidata,manifest,wiki_rootpath,sysid,botname,bo
|
|||
try:
|
||||
import mwclient
|
||||
except:
|
||||
print 'please download mwclient and unpack here:', os.cwd()
|
||||
print 'please download mwclient and unpack here:', os.getcwd()
|
||||
print 'open site',wikiurl
|
||||
if not api_php_path == '':
|
||||
site = mwclient.Site(wikiurl,api_php_path)
|
||||
|
@ -287,7 +287,7 @@ def upload(wikiurl,api_php_path,wikidata,manifest,wiki_rootpath,sysid,botname,bo
|
|||
print 'upload images'
|
||||
for localfile in sorted(manifest.keys()):
|
||||
if localfile:
|
||||
localf=open(localfile)
|
||||
localf = open(localfile,'rb')
|
||||
wikifile = manifest[localfile]
|
||||
skip=False
|
||||
if 'expected.png' in wikifile.lower():
|
||||
|
|
Loading…
Reference in New Issue