How to use patched method in autotest

Best Python code snippet using autotest_python

yasm.gyp

Source:yasm.gyp Github

copy

Full Screen

1# Copyright (c) 2012 The Chromium Authors. All rights reserved.2# Use of this source code is governed by a BSD-style license that can be3# found in the LICENSE file.4# The yasm build process creates a slew of small C subprograms that5# dynamically generate files at various point in the build process. This makes6# the build integration moderately complex.7#8# There are three classes of dynamically generated files:9# 1) C source files that should be included in the build (eg., lc3bid.c)10# 2) C source files that are #included by static C sources (eg., license.c)11# 3) Intermediate files that are used as input by other subprograms to12# further generate files in category #1 or #2. (eg., version.mac)13#14# This structure is represented with the following targets:15# 1) yasm -- Sources, flags for the main yasm executable. Also has most of16# of the actions and rules that invoke the subprograms.17# 2) config_sources -- Checked in version of files generated by manually18# running configure that are used by all binaries.19# 3) generate_files -- Actions and rules for files of type #3.20# 4) genperf_libs -- Object files shared between yasm and the genperf21# subprogram.22# 5) genmacro, genmodule, etc. -- One executable target for each subprogram.23#24# You will notice that a lot of the action targets seem very similar --25# especially for genmacro invocations. This makes it seem like they should26# be a rule. The problem is that the correct invocation cannot be inferred27# purely from the file name, or extension. Nor is it obvious whether the28# output should be processed as a source or not. Thus, we are left with a29# large amount of repetitive code.30{31 'variables': {32 'yasm_include_dirs': [33 'source/config/<(OS)',34 'source/patched-yasm',35 ],36 # The cflags used by any target that will be directly linked into yasm.37 # These are specifically not used when building the subprograms. While38 # it would probably be safe to use these flags there as well, the39 # ./configure based build does not use the same flags between the main40 # yasm executable, and its subprograms.41 'yasm_defines': ['HAVE_CONFIG_H'],42 'yasm_cflags': [43 '-std=gnu99',44 '-ansi',45 '-pedantic',46 ],47 # Locations for various generated artifacts.48 'shared_generated_dir': '<(SHARED_INTERMEDIATE_DIR)/third_party/yasm',49 'generated_dir': '<(INTERMEDIATE_DIR)/third_party/yasm',50 # Various files referenced by multiple targets.51 'version_file': 'version.mac', # Generated by genversion.52 'genmodule_source': 'genmodule_outfile.c',53 },54 'target_defaults': {55 # Silence warnings in libc++ builds (C code doesn't need this flag).56 'ldflags!': [ '-stdlib=libc++', ],57 # https://crbug.com/48990158 'cflags!': [ '-fsanitize=bounds' ],59 },60 'targets': [61 {62 'target_name': 'yasm',63 'type': 'executable',64 'toolsets': ['host'],65 'dependencies': [66 'config_sources',67 'genmacro',68 'genmodule',69 'genperf',70 'genperf_libs',71 'generate_files', # Needed to generate gperf and instruction files.72 'genstring',73 're2c',74 ],75 'variables': {76 'clang_warning_flags': [77 # yasm passes a `const elf_machine_sym*` through `void*`.78 '-Wno-incompatible-pointer-types',79 ],80 },81 'conditions': [82 ['OS=="win"', {83 # As of VS 2013 Update 3, building this project with /analyze hits an84 # internal compiler error on elf-x86-amd64.c in release builds with85 # the amd64_x86 compiler. This halts the build and prevents subsequent86 # analysis. Therefore, /analyze is disabled for this project. See this87 # bug for details:88 # https://connect.microsoft.com/VisualStudio/feedback/details/1014799/internal-compiler-error-when-using-analyze89 'msvs_settings': {90 'VCCLCompilerTool': {91 'AdditionalOptions!': [ '/analyze:WX-' ]92 },93 },94 }],95 ],96 'sources': [97 'source/patched-yasm/frontends/yasm/yasm-options.c',98 'source/patched-yasm/frontends/yasm/yasm.c',99 'source/patched-yasm/libyasm/assocdat.c',100 'source/patched-yasm/libyasm/bc-align.c',101 'source/patched-yasm/libyasm/bc-data.c',102 'source/patched-yasm/libyasm/bc-incbin.c',103 'source/patched-yasm/libyasm/bc-org.c',104 'source/patched-yasm/libyasm/bc-reserve.c',105 'source/patched-yasm/libyasm/bitvect.c',106 'source/patched-yasm/libyasm/bytecode.c',107 'source/patched-yasm/libyasm/errwarn.c',108 'source/patched-yasm/libyasm/expr.c',109 'source/patched-yasm/libyasm/file.c',110 'source/patched-yasm/libyasm/floatnum.c',111 'source/patched-yasm/libyasm/hamt.c',112 'source/patched-yasm/libyasm/insn.c',113 'source/patched-yasm/libyasm/intnum.c',114 'source/patched-yasm/libyasm/inttree.c',115 'source/patched-yasm/libyasm/linemap.c',116 'source/patched-yasm/libyasm/md5.c',117 'source/patched-yasm/libyasm/mergesort.c',118 'source/patched-yasm/libyasm/section.c',119 'source/patched-yasm/libyasm/strcasecmp.c',120 'source/patched-yasm/libyasm/strsep.c',121 'source/patched-yasm/libyasm/symrec.c',122 'source/patched-yasm/libyasm/valparam.c',123 'source/patched-yasm/libyasm/value.c',124 'source/patched-yasm/modules/arch/lc3b/lc3barch.c',125 'source/patched-yasm/modules/arch/lc3b/lc3bbc.c',126 'source/patched-yasm/modules/arch/x86/x86arch.c',127 'source/patched-yasm/modules/arch/x86/x86bc.c',128 'source/patched-yasm/modules/arch/x86/x86expr.c',129 'source/patched-yasm/modules/arch/x86/x86id.c',130 'source/patched-yasm/modules/dbgfmts/codeview/cv-dbgfmt.c',131 'source/patched-yasm/modules/dbgfmts/codeview/cv-symline.c',132 'source/patched-yasm/modules/dbgfmts/codeview/cv-type.c',133 'source/patched-yasm/modules/dbgfmts/dwarf2/dwarf2-aranges.c',134 'source/patched-yasm/modules/dbgfmts/dwarf2/dwarf2-dbgfmt.c',135 'source/patched-yasm/modules/dbgfmts/dwarf2/dwarf2-info.c',136 'source/patched-yasm/modules/dbgfmts/dwarf2/dwarf2-line.c',137 'source/patched-yasm/modules/dbgfmts/null/null-dbgfmt.c',138 'source/patched-yasm/modules/dbgfmts/stabs/stabs-dbgfmt.c',139 'source/patched-yasm/modules/listfmts/nasm/nasm-listfmt.c',140 'source/patched-yasm/modules/objfmts/bin/bin-objfmt.c',141 'source/patched-yasm/modules/objfmts/coff/coff-objfmt.c',142 'source/patched-yasm/modules/objfmts/coff/win64-except.c',143 'source/patched-yasm/modules/objfmts/dbg/dbg-objfmt.c',144 'source/patched-yasm/modules/objfmts/elf/elf-objfmt.c',145 'source/patched-yasm/modules/objfmts/elf/elf-x86-amd64.c',146 'source/patched-yasm/modules/objfmts/elf/elf-x86-x86.c',147 'source/patched-yasm/modules/objfmts/elf/elf.c',148 'source/patched-yasm/modules/objfmts/macho/macho-objfmt.c',149 'source/patched-yasm/modules/objfmts/rdf/rdf-objfmt.c',150 'source/patched-yasm/modules/objfmts/xdf/xdf-objfmt.c',151 'source/patched-yasm/modules/parsers/gas/gas-parse.c',152 'source/patched-yasm/modules/parsers/gas/gas-parse-intel.c',153 'source/patched-yasm/modules/parsers/gas/gas-parser.c',154 'source/patched-yasm/modules/parsers/nasm/nasm-parse.c',155 'source/patched-yasm/modules/parsers/nasm/nasm-parser.c',156 'source/patched-yasm/modules/preprocs/cpp/cpp-preproc.c',157 'source/patched-yasm/modules/preprocs/nasm/nasm-eval.c',158 'source/patched-yasm/modules/preprocs/nasm/nasm-pp.c',159 'source/patched-yasm/modules/preprocs/nasm/nasm-preproc.c',160 'source/patched-yasm/modules/preprocs/nasm/nasmlib.c',161 'source/patched-yasm/modules/preprocs/raw/raw-preproc.c',162 # Sources needed by re2c.163 'source/patched-yasm/modules/parsers/gas/gas-token.re',164 'source/patched-yasm/modules/parsers/nasm/nasm-token.re',165 # Sources needed by genperf. Make sure the generated gperf files166 # (the ones in shared_generated_dir) are synced with the outputs167 # for the related generate_*_insn actions in the generate_files168 # target below.169 '<(shared_generated_dir)/x86insn_nasm.gperf',170 '<(shared_generated_dir)/x86insn_gas.gperf',171 '<(shared_generated_dir)/x86cpu.c',172 '<(shared_generated_dir)/x86regtmod.c',173 ],174 'include_dirs': [175 '<@(yasm_include_dirs)',176 '<(shared_generated_dir)',177 '<(generated_dir)',178 ],179 'defines': [ '<@(yasm_defines)' ],180 'cflags': [ '<@(yasm_cflags)', ],181 'msvs_disabled_warnings': [ 4267 ],182 'rules': [183 {184 'rule_name': 'generate_gperf',185 'extension': 'gperf',186 'inputs': [ '<(PRODUCT_DIR)/'187 '<(EXECUTABLE_PREFIX)genperf<(EXECUTABLE_SUFFIX)' ],188 'outputs': [189 '<(generated_dir)/<(RULE_INPUT_ROOT).c',190 ],191 'action': ['<(PRODUCT_DIR)/genperf',192 '<(RULE_INPUT_PATH)',193 '<(generated_dir)/<(RULE_INPUT_ROOT).c',194 ],195 # These files are #included, so do not treat them as sources.196 'process_outputs_as_sources': 0,197 'message': 'yasm gperf for <(RULE_INPUT_PATH)',198 },199 {200 'rule_name': 'generate_re2c',201 'extension': 're',202 'inputs': [ '<(PRODUCT_DIR)/'203 '<(EXECUTABLE_PREFIX)re2c<(EXECUTABLE_SUFFIX)' ],204 'outputs': [ '<(generated_dir)/<(RULE_INPUT_ROOT).c', ],205 'action': [206 '<(PRODUCT_DIR)/re2c',207 '-b',208 '-o',209 '<(generated_dir)/<(RULE_INPUT_ROOT).c',210 '<(RULE_INPUT_PATH)',211 ],212 'process_outputs_as_sources': 1,213 'message': 'yasm re2c for <(RULE_INPUT_PATH)',214 },215 ],216 'actions': [217 ###218 ### genmacro calls.219 ###220 {221 'action_name': 'generate_nasm_macros',222 'variables': {223 'infile': 'source/patched-yasm/modules/parsers/nasm/nasm-std.mac',224 'varname': 'nasm_standard_mac',225 'outfile': '<(generated_dir)/nasm-macros.c',226 },227 'inputs': [ '<(PRODUCT_DIR)/'228 '<(EXECUTABLE_PREFIX)genmacro<(EXECUTABLE_SUFFIX)',229 '<(infile)', ],230 'outputs': [ '<(outfile)', ],231 'action': ['<(PRODUCT_DIR)/genmacro',232 '<(outfile)', '<(varname)', '<(infile)', ],233 # Not a direct source because this is #included by234 # source/patched-yasm/modules/parsers/nasm/nasm-parser.c235 'process_outputs_as_sources': 1,236 'message': 'yasm genmacro for <(infile)',237 },238 {239 'action_name': 'generate_nasm_version',240 'variables': {241 'infile': '<(shared_generated_dir)/<(version_file)',242 'varname': 'nasm_version_mac',243 'outfile': '<(generated_dir)/nasm-version.c',244 },245 'inputs': [ '<(PRODUCT_DIR)/'246 '<(EXECUTABLE_PREFIX)genmacro<(EXECUTABLE_SUFFIX)',247 '<(infile)', ],248 'outputs': [ '<(outfile)', ],249 'action': ['<(PRODUCT_DIR)/genmacro',250 '<(outfile)', '<(varname)', '<(infile)',251 ],252 # Not a direct source because this is #included by253 # source/patched-yasm/modules/preprocs/nasm/nasm-preproc.c254 'process_outputs_as_sources': 0,255 'message': 'yasm genmacro for <(infile)',256 },257 {258 'action_name': 'generate_win64_gas',259 'variables': {260 'infile': 'source/patched-yasm/modules/objfmts/coff/win64-gas.mac',261 'varname': 'win64_gas_stdmac',262 'outfile': '<(generated_dir)/win64-gas.c',263 },264 'inputs': [ '<(PRODUCT_DIR)/'265 '<(EXECUTABLE_PREFIX)genmacro<(EXECUTABLE_SUFFIX)',266 '<(infile)', ],267 'outputs': [ '<(outfile)', ],268 'action': ['<(PRODUCT_DIR)/genmacro',269 '<(outfile)', '<(varname)', '<(infile)',270 ],271 # Not a direct source because this is #included by272 # source/patched-yasm/modules/objfmts/coff/coff-objfmt.c273 'process_outputs_as_sources': 0,274 'message': 'yasm genmacro for <(infile)',275 },276 {277 'action_name': 'generate_win64_nasm',278 'variables': {279 'infile': 'source/patched-yasm/modules/objfmts/coff/win64-nasm.mac',280 'varname': 'win64_nasm_stdmac',281 'outfile': '<(generated_dir)/win64-nasm.c',282 },283 'inputs': [ '<(PRODUCT_DIR)/'284 '<(EXECUTABLE_PREFIX)genmacro<(EXECUTABLE_SUFFIX)',285 '<(infile)', ],286 'outputs': [ '<(outfile)', ],287 'action': ['<(PRODUCT_DIR)/genmacro',288 '<(outfile)',289 '<(varname)',290 '<(infile)',291 ],292 # Not a direct source because this is #included by293 # source/patched-yasm/modules/objfmts/coff/coff-objfmt.c294 'process_outputs_as_sources': 0,295 'message': 'yasm genmacro for <(infile)',296 },297 ###298 ### genstring call.299 ###300 {301 'action_name': 'generate_license',302 'variables': {303 'infile': 'source/patched-yasm/COPYING',304 'varname': 'license_msg',305 'outfile': '<(generated_dir)/license.c',306 },307 'inputs': [ '<(PRODUCT_DIR)/'308 '<(EXECUTABLE_PREFIX)genstring<(EXECUTABLE_SUFFIX)',309 '<(infile)', ],310 'outputs': [ '<(outfile)', ],311 'action': ['<(PRODUCT_DIR)/genstring',312 '<(varname)',313 '<(outfile)',314 '<(infile)',315 ],316 # Not a direct source because this is #included by317 # source/patched-yasm/frontends/yasm/yasm.c318 'process_outputs_as_sources': 0,319 'message': 'Generating yasm embeddable license',320 },321 ###322 ### A re2c call that doesn't fit into the rule below.323 ###324 {325 'action_name': 'generate_lc3b_token',326 'variables': {327 'infile': 'source/patched-yasm/modules/arch/lc3b/lc3bid.re',328 # The license file is #included by yasm.c.329 'outfile': '<(generated_dir)/lc3bid.c',330 },331 'inputs': [ '<(PRODUCT_DIR)/'332 '<(EXECUTABLE_PREFIX)re2c<(EXECUTABLE_SUFFIX)',333 '<(infile)', ],334 'outputs': [ '<(outfile)', ],335 'action': [336 '<(PRODUCT_DIR)/re2c',337 '-s',338 '-o', '<(outfile)',339 '<(infile)'340 ],341 'process_outputs_as_sources': 1,342 'message': 'Generating yasm tokens for lc3b',343 },344 ###345 ### genmodule call.346 ###347 {348 'action_name': 'generate_module',349 'variables': {350 'makefile': 'source/config/<(OS)/Makefile',351 'module_in': 'source/patched-yasm/libyasm/module.in',352 'outfile': '<(generated_dir)/module.c',353 },354 'inputs': [355 '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)genmodule<(EXECUTABLE_SUFFIX)',356 '<(module_in)',357 '<(makefile)'358 ],359 'outputs': [ '<(generated_dir)/module.c' ],360 'action': [361 '<(PRODUCT_DIR)/genmodule',362 '<(module_in)',363 '<(makefile)',364 '<(outfile)'365 ],366 'process_outputs_as_sources': 1,367 'message': 'Generating yasm module information',368 },369 ],370 },371 {372 'target_name': 'config_sources',373 'type': 'none',374 'toolsets': ['host'],375 'sources': [376 'source/config/<(OS)/Makefile',377 'source/config/<(OS)/config.h',378 'source/config/<(OS)/libyasm-stdint.h',379 ],380 },381 {382 'target_name': 'generate_files',383 'type': 'none',384 'toolsets': ['host'],385 'dependencies': [386 'genperf',387 'genversion',388 ],389 'sources': [390 'source/patched-yasm/modules/arch/x86/x86cpu.gperf',391 'source/patched-yasm/modules/arch/x86/x86regtmod.gperf',392 ],393 'rules': [394 {395 'rule_name': 'generate_gperf',396 'extension': 'gperf',397 'inputs': [ '<(PRODUCT_DIR)/'398 '<(EXECUTABLE_PREFIX)genperf<(EXECUTABLE_SUFFIX)' ],399 'outputs': [ '<(shared_generated_dir)/<(RULE_INPUT_ROOT).c', ],400 'action': [401 '<(PRODUCT_DIR)/genperf',402 '<(RULE_INPUT_PATH)',403 '<(shared_generated_dir)/<(RULE_INPUT_ROOT).c',404 ],405 'process_outputs_as_sources': 0,406 'message': 'yasm genperf for <(RULE_INPUT_PATH)',407 },408 ],409 'actions': [410 {411 'action_name': 'generate_x86_insn',412 'variables': {413 'gen_insn_path':414 'source/patched-yasm/modules/arch/x86/gen_x86_insn.py',415 },416 'inputs': [ '<(gen_insn_path)', ],417 'outputs': [418 '<(shared_generated_dir)/x86insns.c',419 '<(shared_generated_dir)/x86insn_gas.gperf',420 '<(shared_generated_dir)/x86insn_nasm.gperf',421 ],422 'action': [423 'python',424 '<(gen_insn_path)',425 '<(shared_generated_dir)',426 ],427 'message': 'Running <(gen_insn_path)',428 'process_outputs_as_sources': 0,429 },430 {431 'action_name': 'generate_version',432 'inputs': [ '<(PRODUCT_DIR)/'433 '<(EXECUTABLE_PREFIX)genversion<(EXECUTABLE_SUFFIX)' ],434 'outputs': [ '<(shared_generated_dir)/<(version_file)', ],435 'action': [436 '<(PRODUCT_DIR)/genversion',437 '<(shared_generated_dir)/<(version_file)'438 ],439 'message': 'Generating yasm version file: '440 '<(shared_generated_dir)/<(version_file)',441 'process_outputs_as_sources': 0,442 },443 ],444 },445 {446 'target_name': 'genperf_libs',447 'type': 'static_library',448 'toolsets': ['host'],449 'dependencies': [ 'config_sources', ],450 'sources': [451 'source/patched-yasm/libyasm/phash.c',452 'source/patched-yasm/libyasm/xmalloc.c',453 'source/patched-yasm/libyasm/xstrdup.c',454 ],455 'include_dirs': [456 '<@(yasm_include_dirs)',457 ],458 'defines': [ '<@(yasm_defines)' ],459 'cflags': [460 '<@(yasm_cflags)',461 ],462 },463 {464 'target_name': 'genstring',465 'type': 'executable',466 'toolsets': ['host'],467 'dependencies': [ 'config_sources', ],468 'sources': [469 'source/patched-yasm/genstring.c',470 ],471 'include_dirs': [472 '<@(yasm_include_dirs)',473 ],474 'cflags': [475 '-std=gnu99',476 ],477 },478 {479 'target_name': 'genperf',480 'type': 'executable',481 'toolsets': ['host'],482 'dependencies': [483 'genperf_libs',484 ],485 'sources': [486 'source/patched-yasm/tools/genperf/genperf.c',487 'source/patched-yasm/tools/genperf/perfect.c',488 ],489 'include_dirs': [490 '<@(yasm_include_dirs)',491 ],492 'cflags': [493 '-std=gnu99',494 ],495 },496 {497 'target_name': 'genmacro',498 'type': 'executable',499 'toolsets': ['host'],500 'dependencies': [ 'config_sources', ],501 'sources': [502 'source/patched-yasm/tools/genmacro/genmacro.c',503 ],504 'include_dirs': [505 '<@(yasm_include_dirs)',506 ],507 'cflags': [508 '-std=gnu99',509 ],510 },511 {512 'target_name': 'genversion',513 'type': 'executable',514 'toolsets': ['host'],515 'dependencies': [ 'config_sources', ],516 'sources': [517 'source/patched-yasm/modules/preprocs/nasm/genversion.c',518 ],519 'include_dirs': [520 '<@(yasm_include_dirs)',521 ],522 'cflags': [523 '-std=gnu99',524 ],525 },526 {527 'target_name': 're2c',528 'type': 'executable',529 'toolsets': ['host'],530 'dependencies': [ 'config_sources', ],531 'sources': [532 'source/patched-yasm/tools/re2c/main.c',533 'source/patched-yasm/tools/re2c/code.c',534 'source/patched-yasm/tools/re2c/dfa.c',535 'source/patched-yasm/tools/re2c/parser.c',536 'source/patched-yasm/tools/re2c/actions.c',537 'source/patched-yasm/tools/re2c/scanner.c',538 'source/patched-yasm/tools/re2c/mbo_getopt.c',539 'source/patched-yasm/tools/re2c/substr.c',540 'source/patched-yasm/tools/re2c/translate.c',541 ],542 'include_dirs': [543 '<@(yasm_include_dirs)',544 ],545 'cflags': [546 '-std=gnu99',547 ],548 'variables': {549 # re2c is missing CLOSEVOP from one switch.550 'clang_warning_flags': [ '-Wno-switch' ],551 },552 'msvs_disabled_warnings': [ 4267 ],553 },554 {555 'target_name': 'genmodule',556 'type': 'executable',557 'toolsets': ['host'],558 'dependencies': [559 'config_sources',560 ],561 'sources': [562 'source/patched-yasm/libyasm/genmodule.c',563 ],564 'include_dirs': [565 '<@(yasm_include_dirs)',566 ],567 'cflags': [568 '-std=gnu99',569 ],570 },571 ],...

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 autotest 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