gyptest-target.py 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/usr/bin/env python
  2. # Copyright (c) 2009 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 simplest-possible build of a "Hello, world!" program
  7. using non-default extension. In particular, verifies how
  8. target_extension is used to avoid MSB8012 for msvs.
  9. """
  10. import sys
  11. import TestGyp
  12. if sys.platform in ('win32', 'cygwin'):
  13. test = TestGyp.TestGyp()
  14. test.run_gyp('target.gyp')
  15. test.build('target.gyp')
  16. # executables
  17. test.built_file_must_exist('hello1.stuff', test.EXECUTABLE, bare=True)
  18. test.built_file_must_exist('hello2.exe', test.EXECUTABLE, bare=True)
  19. test.built_file_must_not_exist('hello2.stuff', test.EXECUTABLE, bare=True)
  20. # check msvs log for errors
  21. if test.format == "msvs":
  22. log_file = "obj\\hello1\\hello1.log"
  23. test.built_file_must_exist(log_file)
  24. test.built_file_must_not_contain(log_file, "MSB8012")
  25. log_file = "obj\\hello2\\hello2.log"
  26. test.built_file_must_exist(log_file)
  27. test.built_file_must_not_contain(log_file, "MSB8012")
  28. test.pass_test()