| OLD | NEW |
| 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 that LTO flags work. | 8 Verifies that LTO flags work. |
| 9 """ | 9 """ |
| 10 | 10 |
| 11 import TestGyp | 11 import TestGyp |
| 12 | 12 |
| 13 import os | 13 import os |
| 14 import re | 14 import re |
| 15 import subprocess | 15 import subprocess |
| 16 import sys | 16 import sys |
| 17 | 17 |
| 18 if sys.platform == 'darwin': | 18 if sys.platform == 'darwin': |
| 19 test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode']) | 19 test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode']) |
| 20 #if test.format == 'xcode-ninja': | |
| 21 # test.skip_test() | |
| 22 CHDIR = 'lto' | 20 CHDIR = 'lto' |
| 23 test.run_gyp('test.gyp', chdir=CHDIR) | 21 test.run_gyp('test.gyp', chdir=CHDIR) |
| 24 | 22 |
| 25 test.build('test.gyp', test.ALL, chdir=CHDIR) | 23 test.build('test.gyp', test.ALL, chdir=CHDIR) |
| 26 | 24 |
| 27 def ObjPath(srcpath, target): | 25 def ObjPath(srcpath, target): |
| 28 # TODO: Move this into TestGyp if it's needed elsewhere. | 26 # TODO: Move this into TestGyp if it's needed elsewhere. |
| 29 if test.format == 'xcode': | 27 if test.format == 'xcode': |
| 30 return os.path.join(CHDIR, 'build', 'test.build', 'Default', | 28 return os.path.join(CHDIR, 'build', 'test.build', 'Default', |
| 31 target + '.build', 'Objects-normal', 'x86_64', | 29 target + '.build', 'Objects-normal', 'x86_64', |
| (...skipping 26 matching lines...) Expand all Loading... |
| 58 ObjType(ObjPath('cfile', 'lto_static'), 'llvm') | 56 ObjType(ObjPath('cfile', 'lto_static'), 'llvm') |
| 59 ObjType(ObjPath('ccfile', 'lto_static'), 'llvm') | 57 ObjType(ObjPath('ccfile', 'lto_static'), 'llvm') |
| 60 ObjType(ObjPath('mfile', 'lto_static'), 'llvm') | 58 ObjType(ObjPath('mfile', 'lto_static'), 'llvm') |
| 61 ObjType(ObjPath('mmfile', 'lto_static'), 'llvm') | 59 ObjType(ObjPath('mmfile', 'lto_static'), 'llvm') |
| 62 ObjType(ObjPath('asmfile', 'lto_static'), 'mach-o') | 60 ObjType(ObjPath('asmfile', 'lto_static'), 'mach-o') |
| 63 | 61 |
| 64 test.pass_test() | 62 test.pass_test() |
| 65 | 63 |
| 66 # TODO: Probably test for -object_path_lto too, else dsymutil won't be | 64 # TODO: Probably test for -object_path_lto too, else dsymutil won't be |
| 67 # useful maybe? | 65 # useful maybe? |
| OLD | NEW |