OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 2 |
| 3 # Copyright (c) 2012 Google Inc. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. |
| 6 |
| 7 """ |
| 8 Make sure optimization settings are extracted properly. |
| 9 """ |
| 10 |
| 11 import TestGyp |
| 12 |
| 13 import subprocess |
| 14 import sys |
| 15 |
| 16 if sys.platform == 'win32': |
| 17 test = TestGyp.TestGyp(formats=['ninja']) |
| 18 |
| 19 CHDIR = 'compiler_flags' |
| 20 test.run_gyp('optimizations.gyp', chdir=CHDIR) |
| 21 |
| 22 ninja_file = test.built_file_path('obj/test_opt_off.ninja', chdir=CHDIR) |
| 23 test.must_contain(ninja_file, 'cflags = /Od') |
| 24 |
| 25 ninja_file = test.built_file_path('obj/test_opt_level_s.ninja', chdir=CHDIR) |
| 26 test.must_contain(ninja_file, 'cflags = /Os') |
| 27 |
| 28 ninja_file = test.built_file_path('obj/test_opt_unset.ninja', chdir=CHDIR) |
| 29 test.must_not_contain(ninja_file, '/Os') |
| 30 test.must_not_contain(ninja_file, '/Ox') |
| 31 test.must_not_contain(ninja_file, '/Od') |
| 32 |
| 33 ninja_file = test.built_file_path('obj/test_opt_fpo.ninja', chdir=CHDIR) |
| 34 test.must_contain(ninja_file, '/Oy') |
| 35 test.must_not_contain(ninja_file, '/Oy-') |
| 36 |
| 37 ninja_file = test.built_file_path('obj/test_opt_fpo_off.ninja', chdir=CHDIR) |
| 38 test.must_contain(ninja_file, '/Oy-') |
| 39 |
| 40 ninja_file = test.built_file_path('obj/test_opt_inline_off.ninja', |
| 41 chdir=CHDIR) |
| 42 test.must_contain(ninja_file, '/Ob0') |
| 43 |
| 44 ninja_file = test.built_file_path('obj/test_opt_inline_manual.ninja', |
| 45 chdir=CHDIR) |
| 46 test.must_contain(ninja_file, '/Ob1') |
| 47 |
| 48 ninja_file = test.built_file_path('obj/test_opt_inline_auto.ninja', |
| 49 chdir=CHDIR) |
| 50 test.must_contain(ninja_file, '/Ob2') |
| 51 |
| 52 ninja_file = test.built_file_path('obj/test_opt_size.ninja', |
| 53 chdir=CHDIR) |
| 54 test.must_contain(ninja_file, '/Os') |
| 55 |
| 56 ninja_file = test.built_file_path('obj/test_opt_speed.ninja', |
| 57 chdir=CHDIR) |
| 58 test.must_contain(ninja_file, '/Ot') |
| 59 |
| 60 ninja_file = test.built_file_path('obj/test_opt_wpo.ninja', |
| 61 chdir=CHDIR) |
| 62 test.must_contain(ninja_file, '/GL') |
| 63 |
| 64 test.pass_test() |
OLD | NEW |