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 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()
Exemple #3
0
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()
Exemple #4
0
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()
Exemple #5
0
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()
Exemple #6
0
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()
Exemple #7
0
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

result = sj.execute_np(
    "src/js/commands/instrument.js --inlineIID --inlineSource -i --analysis src/js/sample_analyses/ChainedAnalyses.js --analysis src/js/sample_analyses/dlint/Utils.js --analysis src/js/sample_analyses/dlint/CheckNaN.js --analysis src/js/sample_analyses/dlint/FunCalledWithMoreArguments.js --analysis src/js/sample_analyses/dlint/CompareFunctionWithPrimitives.js --analysis src/js/sample_analyses/dlint/ShadowProtoProperty.js --analysis src/js/sample_analyses/dlint/ConcatUndefinedToString.js --analysis src/js/sample_analyses/dlint/UndefinedOffset.js --outputDir /tmp tests/tizen/annex"
)

exit(result)
Exemple #9
0
import sj
import sys

result = sj.execute_np("src/js/commands/instrument.js --inlineIID --inlineSource -i --analysis src/js/sample_analyses/ChainedAnalyses.js --analysis src/js/sample_analyses/dlint/Utils.js --analysis src/js/sample_analyses/dlint/CheckNaN.js --analysis src/js/sample_analyses/dlint/FunCalledWithMoreArguments.js --analysis src/js/sample_analyses/dlint/CompareFunctionWithPrimitives.js --analysis src/js/sample_analyses/dlint/ShadowProtoProperty.js --analysis src/js/sample_analyses/dlint/ConcatUndefinedToString.js --analysis src/js/sample_analyses/dlint/UndefinedOffset.js --outputDir /tmp tests/tizen/annex")

exit(result)
Exemple #10
0
def testDlint (file):
    sj.create_and_cd_jalangi_tmp()
    sj.execute_np(sj.INSTRUMENTATION_SCRIPT+' --initIID ../'+file+'.js')
    out = sj.execute(sj.ANALYSIS2_SCRIPT+ analysesStr+' ../'+file+'_jalangi_.js')
    sj.cd_parent()