def testDlint(file): sj.create_and_cd_jalangi_tmp() sj.execute_np(sj.INSTRUMENTATION_SCRIPT + ' --inlineIID --inlineSource ../' + file + '.js') out = sj.execute(sj.ANALYSIS_SCRIPT + analysesStr + ' ../' + file + '_jalangi_.js') sj.cd_parent()
def test(prefix, file, rest): sj.create_and_cd_jalangi_tmp() ana = sj.execute_return_np(sj.JALANGI_SCRIPT+' --inlineIID --inlineSource --analysis ../src/js/sample_analyses/ChainedAnalyses.js --analysis ../src/js/runtime/SMemory.js --analysis ../src/js/sample_analyses/pldi16/TraceAll.js '+prefix+file+'.js '+rest, savestderr=True) if 'analysis exception!!!' in ana: print ana print "{} failed".format(file) else: print "{} passed".format(file) sj.cd_parent()
def testDlint (file, output): sj.create_and_cd_jalangi_tmp() sj.execute_np(sj.INSTRUMENTATION_SCRIPT+' --initIID ../tests/dsjs/'+file+'.js') out = sj.execute_return_np(sj.ANALYSIS2_SCRIPT+ analysesStr+' ../tests/dsjs/'+file+'_jalangi_.js') if output != out: print "{} failed".format(file) print out print output else: print "{} passed".format(file) sj.cd_parent()
def testDlint(file, output): sj.create_and_cd_jalangi_tmp() sj.execute_np(sj.INSTRUMENTATION_SCRIPT + ' ../tests/dlint/' + file + '.js') out = sj.execute_return_np(sj.ANALYSIS2_SCRIPT + analysesStr + ' ../tests/dlint/' + file + '_jalangi_.js') if output != out: print "{} failed".format(file) print out print output else: print "{} passed".format(file) sj.cd_parent()
def test(prefix, file, rest): sj.create_and_cd_jalangi_tmp() ana = sj.execute_return_np( sj.JALANGI_SCRIPT + ' --inlineIID --inlineSource --analysis ../src/js/sample_analyses/ChainedAnalyses.js --analysis ../src/js/runtime/SMemory.js --analysis ../src/js/sample_analyses/tutorial/TraceAll.js ' + prefix + file + '.js ' + rest, savestderr=True) if 'analysis exception!!!' in ana: print ana print "{} failed".format(file) else: print "{} passed".format(file) sj.cd_parent()
def testDlint (file, output): sj.create_and_cd_jalangi_tmp() sj.execute_np(sj.INSTRUMENTATION_SCRIPT+' --inlineIID --inlineSource ../tests/dlint/'+file+'.js') out = sj.execute_return_np(sj.ANALYSIS_SCRIPT+ analysesStr+' ../tests/dlint/'+file+'_jalangi_.js') if output != out: print "{} failed".format(file) print "********** Actual **********" print out print "********** Expected **********" print output status = 1 else: print "{} passed".format(file) sj.cd_parent()
def test(prefix, file, rest): sj.create_and_cd_jalangi_tmp() sj.execute_np(sj.INSTRUMENTATION_SCRIPT+' --inlineIID --inlineSource '+prefix+file+'.js') normal = sj.execute_return_np(prefix+file+'.js '+rest, savestderr=True) ana = sj.execute_return_np(sj.ANALYSIS_SCRIPT+' --analysis ../src/js/sample_analyses/ChainedAnalyses.js --analysis ../src/js/runtime/analysisCallbackTemplate.js '+prefix+file+'_jalangi_.js '+rest, savestderr=True) if normal != ana: print "{} failed".format(file) print normal print ana status = 1 else: print "{} passed".format(file) sj.cd_parent()
def test(prefix, file, rest): sj.create_and_cd_jalangi_tmp() sj.mkempty("inputs.js") sj.execute_np(sj.INSTRUMENTATION_SCRIPT+' '+prefix+file+'.js') normal = sj.execute_return_np(prefix+file+'.js '+rest, savestderr=True) ana = sj.execute_return_np(sj.ANALYSIS2_SCRIPT+' --analysis ../src/js/analyses2/ChainedAnalyses2.js --analysis ../src/js/analysis2CallbackTemplate.js '+prefix+file+'_jalangi_.js '+rest, savestderr=True) if normal != ana: print "{} failed".format(file) print normal print ana else: print "{} passed".format(file) sj.cd_parent()
def testDlint (file, output): global status sj.create_and_cd_jalangi_tmp() sj.execute_np(sj.INSTRUMENTATION_SCRIPT+' --inlineIID --inlineSource ../tests/dlint/'+file+'.js') out = sj.execute_return_np(sj.ANALYSIS_SCRIPT+ analysesStr+' ../tests/dlint/'+file+'_jalangi_.js') if output != out.decode(): print("{} failed".format(file)) print("********** Actual **********") print(out) print("********** Expected **********") print(output) status = 1 else: print("{} passed".format(file)) sj.cd_parent()
import sj import sys # scripting jalangi sample 2 sj.create_and_cd_jalangi_tmp() sj.execute(sj.INSTRUMENTATION_SCRIPT+' --inlineIID --inlineSource ../'+sys.argv[1]+'.js') normal = sj.execute_return('../'+sys.argv[1]+'.js', savestderr=True) ana = sj.execute_return(sj.ANALYSIS_SCRIPT+' --analysis ../src/js/sample_analyses/ChainedAnalyses.js --analysis ../src/js/runtime/analysisCallbackTemplate.js ../'+sys.argv[1]+'_jalangi_.js', savestderr=True) if normal != ana: print "{} failed".format(sys.argv[1]) print normal print ana else: print "{} passed".format(sys.argv[1]) print normal print ana sj.cd_parent()
def testDlint (file): sj.create_and_cd_jalangi_tmp() sj.execute(sj.INSTRUMENTATION_SCRIPT+' --inlineIID --inlineSource ../'+file+'.js') out = sj.execute(sj.ANALYSIS_SCRIPT+ analysesStr+' ../'+file+'_jalangi_.js') sj.cd_parent()
import sj import sys # scripting jalangi sample 2 sj.create_and_cd_jalangi_tmp() sj.execute(sj.INSTRUMENTATION_SCRIPT + ' --inlineIID --inlineSource ../' + sys.argv[1] + '.js') normal = sj.execute_return('../' + sys.argv[1] + '.js', savestderr=True) ana = sj.execute_return( sj.ANALYSIS_SCRIPT + ' --analysis ../src/js/sample_analyses/ChainedAnalyses.js --analysis ../src/js/runtime/analysisCallbackTemplate.js ../' + sys.argv[1] + '_jalangi_.js', savestderr=True) if normal != ana: print "{} failed".format(sys.argv[1]) print normal print ana else: print "{} passed".format(sys.argv[1]) print normal print ana sj.cd_parent()