diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/OffscreenContextWGL.cc | 17 | ||||
| -rwxr-xr-x | tests/test_cmdline_tool.py | 1 | ||||
| -rwxr-xr-x | tests/test_pretty_print.py | 14 | 
3 files changed, 19 insertions, 13 deletions
| diff --git a/tests/OffscreenContextWGL.cc b/tests/OffscreenContextWGL.cc index ba12a4f..f36671c 100644 --- a/tests/OffscreenContextWGL.cc +++ b/tests/OffscreenContextWGL.cc @@ -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); diff --git a/tests/test_cmdline_tool.py b/tests/test_cmdline_tool.py index 3e9f45a..40aa4d6 100755 --- a/tests/test_cmdline_tool.py +++ b/tests/test_cmdline_tool.py @@ -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 diff --git a/tests/test_pretty_print.py b/tests/test_pretty_print.py index 897f7b8..8ba0512 100755 --- a/tests/test_pretty_print.py +++ b/tests/test_pretty_print.py @@ -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(): | 
