How to use test_gcc method in avocado

Best Python code snippet using avocado_python

auto.py

Source:auto.py Github

copy

Full Screen

...54 diff = subp.Popen(['diff', './dce-ssa_'+output, 'dce-ssa_'+output], stdout=subp.PIPE, stderr=subp.PIPE)55 outdiff, err = diff.communicate()56 check(outdiff, '', 'diff')57# ------------------------------------------------------------------------------58def test_gcc():59 for test in glb('../dce-tests/spec/gcc/*.bc'):60 name = test[22:-3]61 output = name+'.opt.ll'62 liveness = subp.Popen([llicommand, './dce-liveness_'+output], stdout=subp.PIPE, stderr=subp.PIPE)63 ssa = subp.Popen([llicommand, './dce-ssa_'+output], stdout=subp.PIPE, stderr=subp.PIPE)64 outlive, err = liveness.communicate()65 outssa, err = ssa.communicate()66 67 check(outlive, outssa, name)68 diff = subp.Popen(['diff', './dce-ssa_'+output, 'dce-ssa_'+output], stdout=subp.PIPE, stderr=subp.PIPE)69 outdiff, err = diff.communicate()70 check(outdiff, '', 'diff')71# ------------------------------------------------------------------------------72def run_minijava():73 if os.path.isdir("../dce-tests/minijava/"+outdir):74 print 'Output dir - OK!'75 optimize_minijava()76 else:77 print 'Creating directory: ' + outdir78 os.system('mkdir ../dce-tests/minijava/'+outdir)79 optimize_minijava()80# ------------------------------------------------------------------------------81def run_gcc():82 if os.path.isdir("../dce-tests/spec/gcc/"+outdir):83 print 'Output dir - OK!'84 optimize_gcc()85 else:86 print 'Creating directory: ' + outdir87 os.system('mkdir ../dce-tests/spec/gcc/'+outdir)88 optimize_gcc()89# ------------------------------------------------------------------------------90def run_deal():91 if os.path.isdir("../dce-tests/spec/dealII/"+outdir):92 print 'Output dir - OK!'93 optimize_deal()94 else:95 print 'Creating directory: ' + outdir96 os.system('mkdir ../dce-tests/spec/deal/'+outdir)97 optimize_deal()98# ------------------------------------------------------------------------------99def main(argv):100 # make the directory and build the .so101 if os.path.isdir("./Release"):102 os.system('make')103 else:104 os.system('mkdir Release')105 os.system('make')106 # run the tests107 for arg in argv:108 if arg == 'minijava':109 run_minijava()110 test_minijava()111 elif arg == 'gcc':112 run_gcc('dce-ssa')113 #test_gcc()114 else:115 run_deal()116 #test_deal()117# set the main as the entry point118if __name__ == '__main__':...

Full Screen

Full Screen

test_compiler.py

Source:test_compiler.py Github

copy

Full Screen

...10# See the Mulan PSL v2 for more details.11import yatuner12import unittest13class TestCompiler(unittest.TestCase):14 def test_gcc(self):15 src = 'tests/src/test.c'16 out = 'tests/build/test'17 gcc = yatuner.compiler.Gcc(src, out, cc='gcc')18 print(gcc.fetch_parameters())19 20class TestOptimizer(unittest.TestCase):21 def test_initialize(self):22 optimizer = yatuner.optimizer.Optimizer()...

Full Screen

Full Screen

test_country_code.py

Source:test_country_code.py Github

copy

Full Screen

1import unittest2from country_code import get_country_code as gcc3class Testgcc(unittest.TestCase):4 """测试gcc函数"""5 def test_gcc(self):6 reply=gcc('Mexico')7 self.assertEqual(reply,'mx')...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run avocado automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful