Home | History | Annotate | Download | only in restat
      1 #!/usr/bin/env python
      2 
      3 # Copyright (c) 2012 Google Inc. All rights reserved.
      4 # Use of this source code is governed by a BSD-style license that can be
      5 # found in the LICENSE file.
      6 
      7 """
      8 Verify that dependent rules are executed iff a dependency action modifies its
      9 outputs.
     10 """
     11 
     12 import TestGyp
     13 import os
     14 
     15 test = TestGyp.TestGyp(formats=['ninja', 'make', 'xcode'])
     16 
     17 test.run_gyp('restat.gyp', chdir='src')
     18 
     19 chdir = 'relocate/src'
     20 test.relocate('src', chdir)
     21 
     22 # Building 'dependent' the first time generates 'side_effect', but building it
     23 # the second time doesn't, because 'create_intermediate' doesn't update its
     24 # output.
     25 test.build('restat.gyp', 'dependent', chdir=chdir)
     26 test.built_file_must_exist('side_effect', chdir=chdir)
     27 os.remove(test.built_file_path('side_effect', chdir=chdir))
     28 test.build('restat.gyp', 'dependent', chdir=chdir)
     29 test.built_file_must_not_exist('side_effect', chdir=chdir)
     30 
     31 test.pass_test()
     32