@@ -142,9 +142,13 @@ def run_old_pypy_test_on(filename):
142142 old_pypy_runnable = True
143143 old_pypy_exe = os .path .expanduser ('~/pypy-1.9/bin/pypy' )
144144
145- webclgl = None
146- if os .path .isfile ( os .path .expanduser ('~/webclgl/WebCLGL_2.0.Min.class.js' ) ):
147- webclgl = open ( os .path .expanduser ('~/webclgl/WebCLGL_2.0.Min.class.js' ), 'rb' ).read ().decode ('utf-8' )
145+ webclgl = []
146+ if os .path .isdir ( os .path .expanduser ('~/webclgl' ) ):
147+ #webclgl.append( open( os.path.expanduser('~/webclgl/WebCLGL_2.0.Min.class.js'), 'rb').read().decode('utf-8') )
148+ webclgl .append ( open ( os .path .expanduser ('~/webclgl/WebCLGLUtils.class.js' ), 'rb' ).read ().decode ('utf-8' ) )
149+ webclgl .append ( open ( os .path .expanduser ('~/webclgl/WebCLGLBuffer.class.js' ), 'rb' ).read ().decode ('utf-8' ) )
150+ webclgl .append ( open ( os .path .expanduser ('~/webclgl/WebCLGLKernel.class.js' ), 'rb' ).read ().decode ('utf-8' ) )
151+ webclgl .append ( open ( os .path .expanduser ('~/webclgl/WebCLGL.class.js' ), 'rb' ).read ().decode ('utf-8' ) )
148152
149153## rhino is not run by default because it simply freezes up on maximum callstack errors
150154rhino_runnable = '--rhino' in sys .argv and runnable ("rhino -e 'quit()'" )
@@ -432,10 +436,11 @@ def patch_python(filename, dart=False, python='PYTHONJS', backend=None):
432436 # out.append( line )
433437 # code = '\n'.join( out )
434438 a = [
435- _patch_header ,
436439 'PYTHON="%s"' % python ,
437440 'BACKEND="%s"' % backend ,
438441 ]
442+ if backend != 'GO' :
443+ a .append (_patch_header )
439444
440445 if python != 'PYTHONJS' :
441446 code = typedpython .transform_source ( code , strip = True )
@@ -693,9 +698,10 @@ def run_js_nodewebkit(content):
693698
694699 html = ['<html>' ]
695700 if webclgl :
696- html .append ('<script>' )
697- html .append ( webclgl )
698- html .append ('</script>' )
701+ for data in webclgl :
702+ html .append ('<script>' )
703+ html .append ( data )
704+ html .append ('</script>' )
699705
700706 html .append ('<script>' )
701707 html .extend ( lines )
@@ -776,9 +782,12 @@ def run_pythonjs_go_test(dummy_filename):
776782
777783def run_go (content ):
778784 """compile and run go program"""
779- #builtins = read(os.path.join("../external/lua.js", "lua.js"))
780785 write ("%s.go" % tmpname , content )
781- return run_command ("go build %s.go" % tmpname )
786+ errors = run_command ("go build %s.go" % tmpname )
787+ if errors :
788+ return errors
789+ else :
790+ return run_command ( tmpname )
782791
783792
784793def run_html_test ( filename , sum_errors ):
0 commit comments