1#!/usr/bin/env python
2
3# Copyright (c) 2009 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"""
8Verifies file copies using an explicit build target of 'all'.
9"""
10
11import TestGyp
12
13test = TestGyp.TestGyp()
14
15test.run_gyp('copies.gyp',
16             '-G', 'xcode_ninja_target_pattern=^(?!copies_null)',
17             chdir='src')
18
19test.relocate('src', 'relocate/src')
20
21test.build('copies.gyp', test.ALL, chdir='relocate/src')
22
23test.must_match(['relocate', 'src', 'copies-out', 'file1'], 'file1 contents\n')
24
25test.built_file_must_match('copies-out/file2',
26                           'file2 contents\n',
27                           chdir='relocate/src')
28
29test.built_file_must_match('copies-out/directory/file3',
30                           'file3 contents\n',
31                           chdir='relocate/src')
32test.built_file_must_match('copies-out/directory/file4',
33                           'file4 contents\n',
34                           chdir='relocate/src')
35test.built_file_must_match('copies-out/directory/subdir/file5',
36                           'file5 contents\n',
37                           chdir='relocate/src')
38test.built_file_must_match('copies-out/subdir/file6',
39                           'file6 contents\n',
40                           chdir='relocate/src')
41
42test.pass_test()
43