gyptest-postbuild.py 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 that postbuild steps work.
  7. """
  8. import TestGyp
  9. import sys
  10. if sys.platform == 'darwin':
  11. test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode'])
  12. test.run_gyp('test.gyp', chdir='postbuilds')
  13. test.build('test.gyp', test.ALL, chdir='postbuilds')
  14. # See comment in test/subdirectory/gyptest-subdir-default.py
  15. if test.format == 'xcode':
  16. chdir = 'postbuilds/subdirectory'
  17. else:
  18. chdir = 'postbuilds'
  19. # Created by the postbuild scripts
  20. test.built_file_must_exist('el.a_touch',
  21. type=test.STATIC_LIB,
  22. chdir='postbuilds')
  23. test.built_file_must_exist('el.a_gyp_touch',
  24. type=test.STATIC_LIB,
  25. chdir='postbuilds')
  26. test.built_file_must_exist('nest_el.a_touch',
  27. type=test.STATIC_LIB,
  28. chdir=chdir)
  29. test.built_file_must_exist(
  30. 'dyna.framework/Versions/A/dyna_touch',
  31. chdir='postbuilds')
  32. test.built_file_must_exist(
  33. 'dyna.framework/Versions/A/dyna_gyp_touch',
  34. chdir='postbuilds')
  35. test.built_file_must_exist(
  36. 'nest_dyna.framework/Versions/A/nest_dyna_touch',
  37. chdir=chdir)
  38. test.built_file_must_exist('dyna_standalone.dylib_gyp_touch',
  39. type=test.SHARED_LIB,
  40. chdir='postbuilds')
  41. test.built_file_must_exist('copied_file.txt', chdir='postbuilds')
  42. test.built_file_must_exist('copied_file_2.txt', chdir=chdir)
  43. test.pass_test()