gyptest-macro-targetfilename.py 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env python
  2. # Copyright (c) 2014 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. Make sure macro expansion of $(TargetFileName) is handled.
  7. """
  8. import TestGyp
  9. import os
  10. import sys
  11. if sys.platform == 'win32':
  12. test = TestGyp.TestGyp(formats=['msvs', 'ninja'])
  13. if not (test.format == 'msvs' and
  14. int(os.environ.get('GYP_MSVS_VERSION', 0)) == 2013):
  15. CHDIR = 'vs-macros'
  16. test.run_gyp('targetfilename.gyp', chdir=CHDIR)
  17. test.build('targetfilename.gyp', test.ALL, chdir=CHDIR)
  18. test.built_file_must_exist('test_targetfilename_executable.exe', chdir=CHDIR)
  19. test.built_file_must_exist('test_targetfilename_loadable_module.dll',
  20. chdir=CHDIR)
  21. test.built_file_must_exist('test_targetfilename_shared_library.dll',
  22. chdir=CHDIR)
  23. test.built_file_must_exist('test_targetfilename_static_library.lib',
  24. chdir=CHDIR)
  25. test.built_file_must_exist('test_targetfilename_product_extension.foo',
  26. chdir=CHDIR)
  27. test.pass_test()