Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Side by Side Diff: testing/generate_gmock_mutant.py

Issue 12208028: Exclude duplicate gmock_mutant functor templates in WIN64 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | testing/gmock_mutant.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
DaleCurtis 2013/02/05 21:07:38 We don't update copyright date on changes anymore.
wolenetz 2013/02/05 21:38:46 Done.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import string 6 import string
7 import sys 7 import sys
8 8
9 HEADER = """\ 9 HEADER = """\
10 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 10 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
DaleCurtis 2013/02/05 21:07:38 This one is probably okay.
wolenetz 2013/02/05 21:38:46 Done.
11 // Use of this source code is governed by a BSD-style license that can be 11 // Use of this source code is governed by a BSD-style license that can be
12 // found in the LICENSE file. 12 // found in the LICENSE file.
13 13
14 // This file automatically generated by testing/generate_gmock_mutant.py. 14 // This file automatically generated by testing/generate_gmock_mutant.py.
15 // DO NOT EDIT. 15 // DO NOT EDIT.
16 16
17 #ifndef TESTING_GMOCK_MUTANT_H_ 17 #ifndef TESTING_GMOCK_MUTANT_H_
18 #define TESTING_GMOCK_MUTANT_H_ 18 #define TESTING_GMOCK_MUTANT_H_
19 19
20 // The intention of this file is to make possible using GMock actions in 20 // The intention of this file is to make possible using GMock actions in
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 410
411 # Functor with pointer to a pointer of the object. 411 # Functor with pointer to a pointer of the object.
412 print "\n#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING" 412 print "\n#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING"
413 mutant2 = mutant.replace("CreateFunctor(T* obj,", "CreateFunctor(T** obj,") 413 mutant2 = mutant.replace("CreateFunctor(T* obj,", "CreateFunctor(T** obj,")
414 mutant2 = mutant2.replace("new Mutant", "new MutantLateObjectBind") 414 mutant2 = mutant2.replace("new Mutant", "new MutantLateObjectBind")
415 mutant2 = mutant2.replace(" " * 17 + "Tuple", " " * 31 + "Tuple") 415 mutant2 = mutant2.replace(" " * 17 + "Tuple", " " * 31 + "Tuple")
416 print mutant2 416 print mutant2
417 print "#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING\n" 417 print "#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING\n"
418 418
419 # OS_WIN specific. Same functors but with stdcall calling conventions. 419 # OS_WIN specific. Same functors but with stdcall calling conventions.
420 # These are not for WIN64 (x86_64) because there is only one calling
421 # convention in WIN64.
420 # Functor for method with __stdcall calling conventions. 422 # Functor for method with __stdcall calling conventions.
421 print "#if defined (OS_WIN)" 423 print "#if defined (OS_WIN) and !defined (ARCH_CPU_X86_64)"
DaleCurtis 2013/02/05 21:07:38 s/and/&&/
wolenetz 2013/02/05 21:38:46 Whoops! Thanks for catching this.
422 stdcall_method = CREATE_METHOD_FUNCTOR_TEMPLATE 424 stdcall_method = CREATE_METHOD_FUNCTOR_TEMPLATE
423 stdcall_method = stdcall_method.replace("U::", "__stdcall U::") 425 stdcall_method = stdcall_method.replace("U::", "__stdcall U::")
424 stdcall_method = FixCode(stdcall_method % args) 426 stdcall_method = FixCode(stdcall_method % args)
425 print stdcall_method 427 print stdcall_method
426 # Functor for free function with __stdcall calling conventions. 428 # Functor for free function with __stdcall calling conventions.
427 stdcall_function = CREATE_FUNCTION_FUNCTOR_TEMPLATE 429 stdcall_function = CREATE_FUNCTION_FUNCTOR_TEMPLATE
428 stdcall_function = stdcall_function.replace("R (*", "R (__stdcall *") 430 stdcall_function = stdcall_function.replace("R (*", "R (__stdcall *")
429 print "\n", FixCode(stdcall_function % args) 431 print "\n", FixCode(stdcall_function % args)
430 432
431 print "#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING" 433 print "#ifdef GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING"
432 stdcall2 = stdcall_method 434 stdcall2 = stdcall_method
433 stdcall2 = stdcall2.replace("CreateFunctor(T* obj,", "CreateFunctor(T** obj,") 435 stdcall2 = stdcall2.replace("CreateFunctor(T* obj,", "CreateFunctor(T** obj,")
434 stdcall2 = stdcall2.replace("new Mutant", "new MutantLateObjectBind") 436 stdcall2 = stdcall2.replace("new Mutant", "new MutantLateObjectBind")
435 stdcall2 = stdcall2.replace(" " * 17 + "Tuple", " " * 31 + "Tuple") 437 stdcall2 = stdcall2.replace(" " * 17 + "Tuple", " " * 31 + "Tuple")
436 print stdcall2 438 print stdcall2
437 print "#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING" 439 print "#endif // GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING"
438 print "#endif // OS_WIN\n" 440 print "#endif // defined (OS_WIN) and !defined (ARCH_CPU_X86_64)\n"
DaleCurtis 2013/02/05 21:07:38 Ditto.
wolenetz 2013/02/05 21:38:46 Done.
439 441
440 442
441 def main(): 443 def main():
442 print HEADER 444 print HEADER
443 for prebound in xrange(0, 6 + 1): 445 for prebound in xrange(0, 6 + 1):
444 for args in xrange(0, 6 + 1): 446 for args in xrange(0, 6 + 1):
445 GenerateDispatch(prebound, args) 447 GenerateDispatch(prebound, args)
446 print MUTANT 448 print MUTANT
447 for prebound in xrange(0, 6 + 1): 449 for prebound in xrange(0, 6 + 1):
448 for args in xrange(0, 6 + 1): 450 for args in xrange(0, 6 + 1):
449 GenerateCreateFunctor(prebound, args) 451 GenerateCreateFunctor(prebound, args)
450 print FOOTER 452 print FOOTER
451 return 0 453 return 0
452 454
453 455
454 if __name__ == "__main__": 456 if __name__ == "__main__":
455 sys.exit(main()) 457 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | testing/gmock_mutant.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698