diff --git a/doc/testing.txt b/doc/testing.txt index b2974fc5..f90aca88 100644 --- a/doc/testing.txt +++ b/doc/testing.txt @@ -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: ------------------------------ diff --git a/tests/OffscreenContextWGL.cc b/tests/OffscreenContextWGL.cc index ba12a4fa..f36671c2 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 pixels(ctx->width * ctx->height * samplesPerPixel); diff --git a/tests/test_cmdline_tool.py b/tests/test_cmdline_tool.py index 3e9f45a3..40aa4d60 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 897f7b8c..8ba0512f 100755 --- a/tests/test_pretty_print.py +++ b/tests/test_pretty_print.py @@ -196,11 +196,11 @@ FAILED_TESTLOGS s = wiki_template repeat1 = ezsearch('(.*?)',s) repeat2 = ezsearch('(.*?)',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("'''(.*?)'''","\\1",x) filestrs=re.findall('\[\[File\:(.*?)\|.*?\]\]',x) for f in filestrs: - newfile_html='' + newfile_html='' x=re.sub('\[\[File\:'+f+'\|.*?\]\]',newfile_html,x) dic = { '|}':'', '|-':'', '||':'', '|':'', '!!':'', '!':'', '\n\n':'\n

\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():