media/webrtc/trunk/tools/gyp/test/intermediate_dir/gyptest-intermediate-dir.py

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/media/webrtc/trunk/tools/gyp/test/intermediate_dir/gyptest-intermediate-dir.py	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,42 @@
     1.4 +#!/usr/bin/env python
     1.5 +
     1.6 +# Copyright (c) 2012 Google Inc. All rights reserved.
     1.7 +# Use of this source code is governed by a BSD-style license that can be
     1.8 +# found in the LICENSE file.
     1.9 +
    1.10 +"""
    1.11 +Verifies that targets have independent INTERMEDIATE_DIRs.
    1.12 +"""
    1.13 +
    1.14 +import TestGyp
    1.15 +
    1.16 +test = TestGyp.TestGyp()
    1.17 +
    1.18 +test.run_gyp('test.gyp', chdir='src')
    1.19 +test.build('test.gyp', 'target1', chdir='src')
    1.20 +# Check stuff exists.
    1.21 +intermediate_file1 = test.read('src/outfile.txt')
    1.22 +test.must_contain(intermediate_file1, 'target1')
    1.23 +
    1.24 +shared_intermediate_file1 = test.read('src/shared_outfile.txt')
    1.25 +test.must_contain(shared_intermediate_file1, 'shared_target1')
    1.26 +
    1.27 +test.run_gyp('test2.gyp', chdir='src')
    1.28 +# Force the shared intermediate to be rebuilt.
    1.29 +test.sleep()
    1.30 +test.touch('src/shared_infile.txt')
    1.31 +test.build('test2.gyp', 'target2', chdir='src')
    1.32 +# Check INTERMEDIATE_DIR file didn't get overwritten but SHARED_INTERMEDIATE_DIR
    1.33 +# file did.
    1.34 +intermediate_file2 = test.read('src/outfile.txt')
    1.35 +test.must_contain(intermediate_file1, 'target1')
    1.36 +test.must_contain(intermediate_file2, 'target2')
    1.37 +
    1.38 +shared_intermediate_file2 = test.read('src/shared_outfile.txt')
    1.39 +if shared_intermediate_file1 != shared_intermediate_file2:
    1.40 +  test.fail_test(shared_intermediate_file1 + ' != ' + shared_intermediate_file2)
    1.41 +
    1.42 +test.must_contain(shared_intermediate_file1, 'shared_target2')
    1.43 +test.must_contain(shared_intermediate_file2, 'shared_target2')
    1.44 +
    1.45 +test.pass_test()

mercurial