gyptest-restat.py 914 B

12345678910111213141516171819202122232425262728293031
  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. Verify that dependent rules are executed iff a dependency action modifies its
  7. outputs.
  8. """
  9. import TestGyp
  10. import os
  11. test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode'])
  12. test.run_gyp('restat.gyp', chdir='src')
  13. chdir = 'relocate/src'
  14. test.relocate('src', chdir)
  15. # Building 'dependent' the first time generates 'side_effect', but building it
  16. # the second time doesn't, because 'create_intermediate' doesn't update its
  17. # output.
  18. test.build('restat.gyp', 'dependent', chdir=chdir)
  19. test.built_file_must_exist('side_effect', chdir=chdir)
  20. os.remove(test.built_file_path('side_effect', chdir=chdir))
  21. test.build('restat.gyp', 'dependent', chdir=chdir)
  22. test.built_file_must_not_exist('side_effect', chdir=chdir)
  23. test.pass_test()