OLD | NEW |
| (Empty) |
1 #! -*- python -*- | |
2 # Copyright 2011 The Native Client Authors. All rights reserved. | |
3 # Use of this source code is governed by a BSD-style license that can | |
4 # be found in the LICENSE file. | |
5 | |
6 import os | |
7 import subprocess | |
8 from build_tools import build_utils | |
9 | |
10 Import('env') | |
11 | |
12 # ---------------------------------------------------------------------------- | |
13 # Add a builder for the WebGTT test. This adds an Alias() node named | |
14 # 'webgtt_test' that is always built. There is some special handling for the | |
15 # clean mode, since SCons relies on actual build products for its clean | |
16 # processing and will not run Alias() actions during clean unless they actually | |
17 # produce something. | |
18 | |
19 | |
20 def BuildWebGTTTest(env, target, source): | |
21 '''Build the WebGTT test. | |
22 | |
23 This builds the nexes for the WebGTT test. | |
24 | |
25 Args: | |
26 env: The construction Environment() that is building the test. | |
27 target: The target that triggered this build. Not used. | |
28 source: The sources used for this build. Not used. | |
29 ''' | |
30 env.BuildNaClTest(os.path.join('experimental', 'webgtt', 'tests', 'nacltest')) | |
31 | |
32 | |
33 def CleanWebGTTTest(env, target, source): | |
34 '''Clean the WebGTT test. | |
35 | |
36 This cleans the WebGTT test. | |
37 | |
38 Args: | |
39 env: The construction Environment() that is building the test. | |
40 target: The target that triggered this build. Not used. | |
41 source: The sources used for this build. Not used. | |
42 ''' | |
43 env.CleanNaClTest() | |
44 | |
45 webgtt_test_builder = env.Alias('webgtt_test', [env.GetToolchainNode()], | |
46 BuildWebGTTTest) | |
47 env.AlwaysBuild(webgtt_test_builder) | |
48 env.AddCleanAction(['.'], CleanWebGTTTest, ['bot'], webgtt_test_builder) | |
49 | |
50 # Create the test node | |
51 | |
52 webgtt_files = ['webgtt_test.html', 'webgtt_test.js', 'webgtt.nmf', | |
53 'webgtt_x86_32.nexe', 'webgtt_x86_64.nexe'] | |
54 | |
55 webgtt_staging_files = [os.path.join('$STAGING_DIR', x) for x in webgtt_files] | |
56 | |
57 node = env.PPAPIBrowserTester('webgtt_test.out', | |
58 url='webgtt_test.html', | |
59 files=webgtt_staging_files) | |
60 | |
61 env.AddNodeToTestSuite(node, | |
62 ['bot'], | |
63 'run_webgtt_test') | |
64 | |
65 # Make sure the test is built and nexes are available before it is run. | |
66 env.Depends(node, webgtt_test_builder) | |
OLD | NEW |