gyptest-action-envvars.py 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/bin/env python
  2. # Copyright (c) 2012 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 that env vars work with actions, with relative directory paths.
  7. """
  8. import TestGyp
  9. import sys
  10. if sys.platform == 'darwin':
  11. test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode'])
  12. # The xcode-ninja generator handles gypfiles which are not at the
  13. # project root incorrectly.
  14. # cf. https://code.google.com/p/gyp/issues/detail?id=460
  15. if test.format == 'xcode-ninja':
  16. test.skip_test()
  17. CHDIR = 'action-envvars'
  18. test.run_gyp('action/action.gyp', chdir=CHDIR)
  19. test.build('action/action.gyp', 'action', chdir=CHDIR, SYMROOT='../build')
  20. result_file = test.built_file_path('result', chdir=CHDIR)
  21. test.must_exist(result_file)
  22. test.must_contain(result_file, 'Test output')
  23. other_result_file = test.built_file_path('other_result', chdir=CHDIR)
  24. test.must_exist(other_result_file)
  25. test.must_contain(other_result_file, 'Other output')
  26. test.pass_test()