How to use outputdir method in avocado

Best Python code snippet using avocado_python

gen_meta.py

Source:gen_meta.py Github

copy

Full Screen

1from binding import *2from classes.Extension import *3def metaExtensionToString(extension):4 return '{ GLextension::%s, "%s" }' % (extensionBID(extension), extension.name)5def metaStringToExtension(extension):6 return '{ "%s", GLextension::%s }' % (extension.name, extensionBID(extension))7def genMetaStringsByExtension(extensions, outputdir, outputfile):8 status(outputdir + outputfile)9 with open(outputdir + outputfile, 'w') as file:10 file.write(template(outputfile) % (",\n" + tab).join(11 [ metaExtensionToString(e) for e in extensions ]))12def genMetaExtensionsByString(extensions, outputdir, outputfile): 13 status(outputdir + outputfile)14 with open(outputdir + outputfile, 'w') as file:15 file.write(template(outputfile) % (",\n" + tab).join(16 [ metaStringToExtension(e) for e in extensions ]))17def metaEnumToString(enum, type):18 # t = (enum.groupString if type == "GLbitfield" else type)19 return ('{ ' + type + '::%s, "%s" }') % (enumBID(enum), enum.name)20def metaStringToEnum(enum, type):21 # t = (enum.groupString if type == "GLbitfield" else type)22 return ('{ "%s", ' + type + '::%s }') % (enum.name, enumBID(enum))23def metaStringToBitfieldGroupMap(group):24 return "extern const std::unordered_map<std::string, gl::%s> Meta_%sByString;" % (group.name, group.name)25def metaBitfieldGroupToStringMap(group):26 return "extern const std::unordered_map<gl::%s, std::string> Meta_StringsBy%s;" % (group.name, group.name)27def metaStringsByBitfieldGroup(group):28 return """const std::unordered_map<%s, std::string> Meta_StringsBy%s 29{30#ifdef STRINGS_BY_GL31 %s32#endif33};34 """ % (group.name, group.name, ",\n\t".join([ metaEnumToString(e, group.name) for e in sorted(group.enums) ]))35def genMetaMaps(enums, outputdir, outputfile, bitfGroups):36 status(outputdir + outputfile)37 with open(outputdir + outputfile, 'w') as file:38 file.write(template(outputfile) % ("\n".join([ metaBitfieldGroupToStringMap(g) for g in bitfGroups ])))39def genMetaStringsByEnum(enums, outputdir, outputfile, type):40 status(outputdir + outputfile)41 pureEnums = [ e for e in enums if e.type == type ]42 d = sorted([ es[0] for v, es in groupEnumsByValue(pureEnums).items() ])43 44 with open(outputdir + outputfile, 'w') as file:45 file.write(template(outputfile) % ((",\n" + tab).join(46 [ metaEnumToString(e, type) for e in d ]))) 47def genMetaStringsByBitfield(bitfGroups, outputdir, outputfile):48 status(outputdir + outputfile)49 d = sorted([ metaStringsByBitfieldGroup(g) for g in bitfGroups ])50 51 with open(outputdir + outputfile, 'w') as file:52 file.write(template(outputfile) % "\n".join(d))53def genMetaBitfieldByString(bitfGroups, outputdir, outputfile):54 55 status(outputdir + outputfile)56 map = [ (",\n"+tab).join([ '{ "%s", static_cast<GLbitfield>(%s::%s) }' % (e.name, g.name, e.name) 57 for e in sorted(g.enums) ]) for g in sorted(bitfGroups) ]58 with open(outputdir + outputfile, 'w') as file:59 file.write(template(outputfile) % ((",\n" + tab).join(map)))60def genMetaEnumsByString(enums, outputdir, outputfile, type):61 status(outputdir + outputfile)62 pureEnums = [ e for e in enums if e.type == type ]63 with open(outputdir + outputfile, 'w') as file:64 file.write(template(outputfile) % ((",\n" + tab).join(65 [ metaStringToEnum(e, type) for e in pureEnums ])))66def groupEnumsByValue(enums):67 d = dict()68 for e in enums:69 v = int(e.value, 0)70 if not v in d:71 d[v] = []72 d[v].append(e)73 74 for key in d.keys():75 d[key] = sortEnumsBySuffix(d[key])76 77 return d78def sortEnumsBySuffix(enums):79 return sorted(enums, key = lambda e : enumSuffixPriority(e.name))80def enumSuffixPriority(name):81 index = name.rfind("_")82 if index < 0:83 return -184 ext = name[index + 1:]85 if ext not in Extension.suffixes:86 return -187 88 return Extension.suffixes.index(ext)89def extensionVersionPair(extension):90 return "{ GLextension::%s, { %s, %s } }" % (91 extensionBID(extension), extension.incore.major, extension.incore.minor)92def genReqVersionsByExtension(extensions, outputdir, outputfile):93 status(outputdir + outputfile)94 inCoreExts = [ e for e in extensions if e.incore ]95 sortedExts = sorted(inCoreExts, key = lambda e : e.incore)96 with open(outputdir + outputfile, 'w') as file:97 file.write(template(outputfile) % (",\n" + tab).join(98 [ extensionVersionPair(e) for e in sortedExts if e.incore ]))99def extensionRequiredFunctions(extension):100 return "{ GLextension::%s, { %s } }" % (extensionBID(extension), ", ".join(101 [ '"%s"' % f.name for f in extension.reqCommands ]))102def functionRequiredByExtensions(function, extensions):103 return '{ "%s", { %s } }' % (function.name, ", ".join(104 [ "GLextension::" + extensionBID(e) for e in extensions ]))105def genFunctionStringsByExtension(extensions, outputdir, outputfile): 106 status(outputdir + outputfile)107 with open(outputdir + outputfile, 'w') as file: 108 file.write(template(outputfile) % ((",\n" + tab).join(109 [ extensionRequiredFunctions(e) for e in extensions if len(e.reqCommands) > 0 ])))110def genExtensionsByFunctionString(extensions, outputdir, outputfile): 111 status(outputdir + outputfile)112 extensionsByCommands = dict()113 for e in extensions:114 for c in e.reqCommands:115 if not c in extensionsByCommands:116 extensionsByCommands[c] = set()117 extensionsByCommands[c].add(e)118 with open(outputdir + outputfile, 'w') as file: 119 file.write(template(outputfile) % ((",\n" + tab).join(...

Full Screen

Full Screen

packageRelease.py

Source:packageRelease.py Github

copy

Full Screen

1import os2import sys3import shutil4import re5global gCompiler6global gPlatform7def copyIgnore( path, names ):8 result = []9 if re.search( "__AppTemplates", path ) != None:10 return result11 for name in names:12 if name == 'vc2013' and gCompiler != 'vc2013':13 result.append( name )14 if name == 'vc2015_winrt' and gCompiler != 'vc2013':15 result.append( name )16 elif name == 'vc2015' and gCompiler != 'vc2015':17 result.append( name )18 elif name == 'ios' and gCompiler != 'xcode':19 result.append( name )20 elif name == 'ios-sim' and gCompiler != 'xcode':21 result.append( name )22 elif name == 'macosx' and gCompiler != 'xcode':23 result.append( name )24 elif name == 'xcode' and gCompiler != 'xcode':25 result.append( name )26 elif name == 'xcode_ios' and gCompiler != 'xcode':27 result.append( name )28 elif name == 'msw' and gCompiler == 'xcode':29 result.append( name )30 elif name == 'msw-uwp' and gCompiler == 'xcode':31 result.append( name )32 elif gPlatform == 'mac' and name == 'TinderBox-Win':33 result.append( name )34 elif gPlatform == 'msw' and name == 'TinderBox-Mac':35 result.append( name )36 elif name == 'Readme.md':37 result.append( name )38 elif name == 'scripts':39 result.append( name )40 elif name == 'linux' and re.search( "lib", path ) != None:41 result.append( name )42 elif name == 'android':43 result.append( name )44 elif name == 'androidstudio':45 result.append( name )46 elif re.search( "libboost.*-vc120.*", name ) != None and gCompiler != 'vc2013':47 result.append( name )48 elif re.search( "^.git.*", name ) != None:49 result.append( name )50 return result51def printUsage():52 print "Run from the root of the repository (having run vcvars):"53 print "python tools/packageRelease.py (version number) (xcode|vc2013|vc2015)"54def processExport( outputName, compilerName, version ):55 print "creating a clean clone of cinder"56 baseDir = os.getcwd()57 fileUrl = "file://" + baseDir58 fileUrl.replace( os.sep, "/" )59 os.system( "git clone --recursive --depth 1 -b master " + fileUrl + " .." + os.sep + "cinder_temp" )60 os.chdir( baseDir + os.sep + ".." + os.sep + "cinder_temp" )61 outputDir = baseDir + os.sep + ".." + os.sep + "cinder_" + version + "_" + outputName + os.sep62 print "performing selective copy to " + outputDir63 shutil.copytree( ".", outputDir, ignore=copyIgnore )64 print "removing test"65 shutil.rmtree( outputDir + "test" )66 return outputDir67 68def cleanupMswLibDir( dir ):69 for f in os.listdir( dir ):70 if os.path.splitext( f ) == ".idb":71 os.remove( os.path.join(dir, f) )72 73if len(sys.argv) != 3:74 printUsage()75elif sys.argv[2] == 'xcode':76 gCompiler = 'xcode'77 gPlatform = 'mac'78 outputDir = processExport( "mac", "xcode", sys.argv[1] )79 os.chdir( outputDir + "proj/xcode" )80 os.system( "./fullbuild.sh" )81 shutil.rmtree( outputDir + "proj/xcode/build" )82 # strip debug symbols83 os.chdir( outputDir + "lib/ios/Debug" )84 os.system( "strip -S -r libcinder.a" )85 os.chdir( outputDir + "lib/ios/Release" )86 os.system( "strip -S -r libcinder.a" )87 os.chdir( outputDir + "lib/ios-sim/Debug" )88 os.system( "strip -S -r libcinder.a" )89 os.chdir( outputDir + "lib/ios-sim/Release" )90 os.system( "strip -S -r libcinder.a" )91 os.chdir( outputDir + "lib/macosx/Debug" )92 os.system( "strip -S -r libcinder.a" )93 os.chdir( outputDir + "lib/macosx/Release" )94 os.system( "strip -S -r libcinder.a" )95elif sys.argv[2] == 'vc2013':96 gCompiler = 'vc2013'97 gPlatform = 'msw'98 outputDir = processExport( "vc2013", "vc2013", sys.argv[1] )99 os.chdir( outputDir + "proj\\vc2013" )100 os.system( "msbuild cinder.vcxproj /p:platform=win32 /p:configuration=debug" )101 os.system( "msbuild cinder.vcxproj /p:platform=win32 /p:configuration=release" )102 shutil.rmtree( outputDir + "proj\\vc2013\\build" )103# os.system( "msbuild cinder.vcxproj /p:platform=x64 /p:configuration=debug" )104# shutil.rmtree( outputDir + "vc2013\\x64\\Debug" )105# os.system( "msbuild cinder.vcxproj /p:platform=x64 /p:configuration=release" )106# shutil.rmtree( outputDir + "vc2013\\x64\\Release" )107 cleanupMswLibDir( outputDir + "lib\\msw\\x86\\debug" )108# cleanupMswLibDir( outputDir + "lib\\msw\\x64" )109elif sys.argv[2] == 'vc2015':110 gCompiler = 'vc2015'111 gPlatform = 'msw'112 outputDir = processExport( "vc2015", "vc2015", sys.argv[1] )113 os.chdir( outputDir + "vc2013" )114 os.system( "msbuild cinder.vcxproj /p:platform=win32 /p:configuration=debug" )115 shutil.rmtree( outputDir + "vc2013\\Debug" )116 os.system( "msbuild cinder.vcxproj /p:platform=win32 /p:configuration=release" )117 shutil.rmtree( outputDir + "vc2013\\Release" )118 os.system( "msbuild cinder.vcxproj /p:platform=x64 /p:configuration=debug" )119 shutil.rmtree( outputDir + "vc2013\\x64\\Debug" )120 os.system( "msbuild cinder.vcxproj /p:platform=x64 /p:configuration=release" )121 shutil.rmtree( outputDir + "vc2013\\x64\\Release" )122 cleanupMswLibDir( outputDir + "lib\\msw\\x86" )123 cleanupMswLibDir( outputDir + "lib\\msw\\x64" )124else:...

Full Screen

Full Screen

Snakefile

Source:Snakefile Github

copy

Full Screen

1inputfile = os.environ.get("INPUT")2outputdir = os.environ.get("OUTPUTDIR")3#command : OUTPUTDIR="outputs" INPUT="tests/RAG_small.fasta" snakemake --cores all4#print(inputfile)5rule all:6 input:7 'fasta_validated.fasta',8 'table_of_contents.txt',9 f'{outputdir}/raxml/RAxML_bipartitionsBranchLabels.output_ML',10 f'{outputdir}/iqtree/standard_name.fasta.treefile',11 f'{outputdir}/compare/all_trees.treels',12 f'{outputdir}/mega/M11CC_Out/mega_tree.nwk',13 f'{outputdir}/compare/shimodaira_hasegawa.txt',14 f'{outputdir}/compare/AU_report.txt'15 message:16 'Runs sucessfully. Folders created with the respective files.'17# Clean outputs of previous runs18rule clean:19 shell:20 'rm -rf mega iqtree raxml fastas table_of_contents.txt compare outputs'21# Validate the file22rule valid_file:23 input:24 inputfile25 output:26 'fasta_validated.fasta',27 'table_of_contents.txt'28 shell:29 'python3 scripts/fasta_validator.py {input}'30# Standardize names 31rule standardized_name:32 input:33 'fasta_validated.fasta',34 'table_of_contents.txt'35 output:36 '{outputdir}/fastas/standard_name.fasta'37 run:38 shell(f'mkdir -p {outputdir}/fastas')39 shell('mv table_of_contents.txt {outputdir}')40 shell('sed "s/ .*//g" fasta_validated.fasta > {outputdir}/fastas/standard_name.fasta')41# Create trees raxml42rule create_trees_raxml:43 input:44 '{outputdir}/fastas/standard_name.fasta'45 output:46 '{outputdir}/raxml/RAxML_bipartitionsBranchLabels.output_ML'47 benchmark:48 '{outputdir}/raxml/raxml.bwa.benchmark.txt'49 run:50 shell('mkdir -p {outputdir}/raxml')51 shell('cd {outputdir}/raxml && time raxmlHPC-PTHREADS-SSE3 -T 2 -f a -s ../../{input} -m GTRGAMMA -x 2525 -p 2525 -N 100 -n output_ML')52# Create trees iqtree53rule create_trees_iqtree:54 input:55 '{outputdir}/fastas/standard_name.fasta'56 output:57 '{outputdir}/iqtree/standard_name.fasta.treefile'58 benchmark:59 '{outputdir}/iqtree/iqtree.bwa.benchmark.txt'60 run:61 shell('mkdir -p {outputdir}/iqtree')62 shell('cp {input} {outputdir}/iqtree/standard_name.fasta')63 shell('iqtree -s {outputdir}/iqtree/standard_name.fasta')64# Create trees mega65rule create_trees_mega:66 input:67 '{outputdir}/fastas/standard_name.fasta'68 output:69 '{outputdir}/mega/M11CC_Out/mega_tree.nwk'70 benchmark:71 '{outputdir}/mega/mega.bwa.benchmark.txt'72 run:73 shell('mkdir -p {outputdir}/mega')74 shell('cp {input} {outputdir}/mega/standard_name.fasta')75 shell('megacc -a files/ML_nucleotide.mao -d {outputdir}/mega/standard_name.fasta ML_tree_mega')76 shell('cat {outputdir}/mega/M11CC_Out/*.nwk > {output}')77# Concatenate all tree files78rule concatenate_trees_files:79 input:80 '{outputdir}/mega/M11CC_Out/mega_tree.nwk',81 '{outputdir}/iqtree/standard_name.fasta.treefile',82 '{outputdir}/raxml/RAxML_bipartitionsBranchLabels.output_ML'83 output:84 '{outputdir}/compare/all_trees.treels'85 run:86 shell('mkdir -p {outputdir}/compare')87 shell('cat {input} > {outputdir}/compare/all_trees.treels')88# Compare the trees using IQTree89rule compare_shimodaira_hasegawa:90 input:91 '{outputdir}/compare/all_trees.treels',92 '{outputdir}/fastas/standard_name.fasta'93 output:94 '{outputdir}/compare/shimodaira_hasegawa.txt'95 message:96 "In the eventuality of the AU scores being too similar, in their respective directories, it's accompanied the benchmarks of each tree with the times it took too create them."97 "Every user must consider this data when choosing the best program for themselfs."98 run:99 shell('iqtree -s {outputdir}/fastas/standard_name.fasta -z {outputdir}/compare/all_trees.treels -n 0 -zb 10000 -zw -au > {output}')100# Report of the AU test101rule report_AU:102 input:103 '{outputdir}/compare/shimodaira_hasegawa.txt'104 output:105 '{outputdir}/compare/AU_report.txt'106 message:107 'The results of the Au test'108 run:109 shell('grep "TreeID" -A 5 {input} > {output}')110 shell('printf "1 - MEGA\n2 - IQTREE\n3 - RAxML\n" >> {output}')...

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