gyptest-dirname.py 868 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/bin/env python
  2. # Copyright (c) 2011 Google Inc. All rights reserved.
  3. # Use of this source code is governed by a BSD-style license that can be
  4. # found in the LICENSE file.
  5. """
  6. Verifies simple rules when using an explicit build target of 'all'.
  7. """
  8. import TestGyp
  9. import os
  10. test = TestGyp.TestGyp(formats=['make', 'ninja', 'xcode'])
  11. test.run_gyp('actions.gyp', chdir='src')
  12. test.relocate('src', 'relocate/src')
  13. test.build('actions.gyp', chdir='relocate/src')
  14. expect = """\
  15. hi c
  16. hello baz
  17. """
  18. if test.format == 'xcode':
  19. chdir = 'relocate/src/subdir'
  20. else:
  21. chdir = 'relocate/src'
  22. test.run_built_executable('gencc_int_output', chdir=chdir, stdout=expect)
  23. test.must_match('relocate/src/subdir/foo/bar/baz.printed',
  24. os.path.join('foo', 'bar'))
  25. test.must_match('relocate/src/subdir/a/b/c.printed', os.path.join('a', 'b'))
  26. test.pass_test()