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

Side by Side Diff: test/linux/ldflags-duplicates/check-ldflags.py

Issue 1454433002: Python 3 compatibility Base URL: https://chromium.googlesource.com/external/gyp.git@master
Patch Set: Rebase with master (4ec6c4e3a94bd04a6da2858163d40b2429b8aad1) Created 4 years, 8 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
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 # Copyright (c) 2015 Google Inc. All rights reserved. 3 # Copyright (c) 2015 Google Inc. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """ 7 """
8 Verifies duplicate ldflags are not removed. 8 Verifies duplicate ldflags are not removed.
9 """ 9 """
10 10
11 from __future__ import print_function
12
11 import sys 13 import sys
12 14
13 def CheckContainsFlags(args, substring): 15 def CheckContainsFlags(args, substring):
14 if args.find(substring) is -1: 16 if args.find(substring) is -1:
15 print 'ERROR: Linker arguments "%s" are missing in "%s"' % (substring, args) 17 print('ERROR: Linker arguments "%s" are missing in "%s"' % (substring, args) )
16 return False; 18 return False;
17 return True; 19 return True;
18 20
19 if __name__ == '__main__': 21 if __name__ == '__main__':
20 args = " ".join(sys.argv) 22 args = " ".join(sys.argv)
21 print "args = " +args 23 print("args = " +args)
22 if not CheckContainsFlags(args, 'lib1.a -Wl,--no-whole-archive') \ 24 if not CheckContainsFlags(args, 'lib1.a -Wl,--no-whole-archive') \
23 or not CheckContainsFlags(args, 'lib2.a -Wl,--no-whole-archive'): 25 or not CheckContainsFlags(args, 'lib2.a -Wl,--no-whole-archive'):
24 sys.exit(1); 26 sys.exit(1);
25 sys.exit(0) 27 sys.exit(0)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698