gyptest-standalone.py 869 B

123456789101112131415161718192021222324252627282930313233
  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 a project hierarchy created with the --generator-output=
  7. option can be built even when it's relocated to a different path.
  8. """
  9. import TestGyp
  10. import os
  11. test = TestGyp.TestGyp()
  12. test.run_gyp('standalone.gyp', '-Gstandalone')
  13. # Look at all the files in the tree to make sure none
  14. # of them reference the gyp file.
  15. for root, dirs, files in os.walk("."):
  16. for file in files:
  17. # ignore ourself
  18. if os.path.splitext(__file__)[0] in file:
  19. continue
  20. file = os.path.join(root, file)
  21. contents = open(file).read()
  22. if 'standalone.gyp' in contents:
  23. print 'gyp file referenced in generated output: %s' % file
  24. test.fail_test()
  25. test.pass_test()