| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 # Copyright (c) 2012 Google Inc. All rights reserved. | 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 | 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 Verify the settings that cause a set of programs to be created in | 8 Verify the settings that cause a set of programs to be created in |
| 9 a specific build directory, and that no intermediate built files | 9 a specific build directory, and that no intermediate built files |
| 10 get created outside of that build directory hierarchy even when | 10 get created outside of that build directory hierarchy even when |
| 11 referred to with deeply-nested ../../.. paths. | 11 referred to with deeply-nested ../../.. paths. |
| 12 """ | 12 """ |
| 13 | 13 |
| 14 import TestGyp | 14 import TestGyp |
| 15 | 15 |
| 16 # TODO(mmoss): Make only supports (theoretically) a single, global build | 16 # TODO(mmoss): Make only supports (theoretically) a single, global build |
| 17 # directory (through GYP_GENERATOR_FLAGS 'output_dir'), rather than | 17 # directory (through GYP_GENERATOR_FLAGS 'output_dir'), rather than |
| 18 # gyp-file-specific settings (e.g. the stuff in builddir.gypi) that the other | 18 # gyp-file-specific settings (e.g. the stuff in builddir.gypi) that the other |
| 19 # generators support, so this doesn't work yet for make. | 19 # generators support, so this doesn't work yet for make. |
| 20 # TODO(mmoss) Make also has the issue that the top-level Makefile is written to | 20 # TODO(mmoss) Make also has the issue that the top-level Makefile is written to |
| 21 # the "--depth" location, which is one level above 'src', but then this test | 21 # the "--depth" location, which is one level above 'src', but then this test |
| 22 # moves 'src' somewhere else, leaving the Makefile behind, so make can't find | 22 # moves 'src' somewhere else, leaving the Makefile behind, so make can't find |
| 23 # its sources. I'm not sure if make is wrong for writing outside the current | 23 # its sources. I'm not sure if make is wrong for writing outside the current |
| 24 # directory, or if the test is wrong for assuming everything generated is under | 24 # directory, or if the test is wrong for assuming everything generated is under |
| 25 # the current directory. | 25 # the current directory. |
| 26 # Android does not support setting the build directory. | 26 # Android, Ninja, and CMake do not support setting the build directory. |
| 27 # Ninja does not support relocation. | 27 test = TestGyp.TestGyp(formats=['!make', '!ninja', '!android', '!cmake']) |
| 28 test = TestGyp.TestGyp(formats=['!make', '!ninja', '!android']) | |
| 29 | 28 |
| 30 test.run_gyp('prog1.gyp', '--depth=..', chdir='src') | 29 test.run_gyp('prog1.gyp', '--depth=..', chdir='src') |
| 31 if test.format == 'msvs': | 30 if test.format == 'msvs': |
| 32 if test.uses_msbuild: | 31 if test.uses_msbuild: |
| 33 test.must_contain('src/prog1.vcxproj', | 32 test.must_contain('src/prog1.vcxproj', |
| 34 '<OutDir>..\\builddir\\Default\\</OutDir>') | 33 '<OutDir>..\\builddir\\Default\\</OutDir>') |
| 35 else: | 34 else: |
| 36 test.must_contain('src/prog1.vcproj', | 35 test.must_contain('src/prog1.vcproj', |
| 37 'OutputDirectory="..\\builddir\\Default\\"') | 36 'OutputDirectory="..\\builddir\\Default\\"') |
| 38 | 37 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 dir = 'relocate/builddir/Default/' | 76 dir = 'relocate/builddir/Default/' |
| 78 test.run(program=test.workpath(dir + prog), stdout=expect) | 77 test.run(program=test.workpath(dir + prog), stdout=expect) |
| 79 | 78 |
| 80 run_builddir('prog1', expect1) | 79 run_builddir('prog1', expect1) |
| 81 run_builddir('prog2', expect2) | 80 run_builddir('prog2', expect2) |
| 82 run_builddir('prog3', expect3) | 81 run_builddir('prog3', expect3) |
| 83 run_builddir('prog4', expect4) | 82 run_builddir('prog4', expect4) |
| 84 run_builddir('prog5', expect5) | 83 run_builddir('prog5', expect5) |
| 85 | 84 |
| 86 test.pass_test() | 85 test.pass_test() |
| OLD | NEW |