Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / native_client / src / shared / gio / build.scons
1 # -*- python -*-
2 # Copyright (c) 2011 The Native Client Authors. 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 import os
7
8 Import('env')
9
10 env.DualLibrary('gio',
11                 ['gio.c',
12                  'gio_mem.c',
13                  'gprintf.c',
14                  'gio_mem_snapshot.c',
15                  'gio_pio.c',
16                  ])
17
18
19 gtest_env = env.MakeGTestEnv()
20
21 gtest_env.DualLibrary('gio_test', ['gio_test_base.cc'])
22
23 gio_mem_test_exe = gtest_env.ComponentProgram(
24     'gio_mem_test',
25     ['gio_mem_test.cc'],
26     EXTRA_LIBS=['gio', 'gio_test'])
27
28 node = gtest_env.CommandTest(
29     'gio_mem_test_output.xml.out',
30     command=[gio_mem_test_exe, '--gtest_output=xml:${TARGET}'])
31 gtest_env.AddNodeToTestSuite(node, ['small_tests'],
32     'run_gio_mem_test')
33
34 gio_test_exe = gtest_env.ComponentProgram(
35     'gio_test',
36     ['gio_test.cc'],
37     EXTRA_LIBS=['gio', 'platform', 'gio_test'])
38
39 # temp file will be removed by gio_test (if it compiles and test completes).
40 temp_path = env.MakeEmptyFile(prefix='tmp_gio', suffix='.tmp')
41
42 node = gtest_env.CommandTest(
43     'gio_test_output.xml.out',
44     command=[gio_test_exe,
45              '--gtest_output=xml:${TARGET}',
46              '-t', temp_path,
47    # Note: to regenerate the premade_text/binary_file, use "make_premade.py"
48              '-x', env.File('premade_text_file'),
49              '-b', env.File('premade_binary_file'),
50              ],
51     )
52 gtest_env.AddNodeToTestSuite(node, ['small_tests'],
53     'run_gio_test')
54
55 gio_test_exe = gtest_env.ComponentProgram(
56     'gio_pio_test',
57     ['gio_pio_test.cc'],
58     EXTRA_LIBS=['gio', 'platform', 'gio_test'])
59
60 # temp file will be removed by gio_pio_test (if it compiles and completes).
61 temp_path = env.MakeEmptyFile(prefix='tmp_gio_pio', suffix='.tmp')
62
63 node = gtest_env.CommandTest(
64     'gio_pio_test_output.xml.out',
65     command=[gio_test_exe,
66              '--gtest_output=xml:${TARGET}',
67              '-t', temp_path,
68    # Note: to regenerate the premade_text/binary_file, use "make_premade.py"
69              '-x', env.File('premade_text_file'),
70              '-b', env.File('premade_binary_file'),
71              ],
72     )
73 gtest_env.AddNodeToTestSuite(node, ['small_tests'],
74     'run_gio_pio_test')
75
76 gprintf_test_exe = env.ComponentProgram(
77     'gprintf_test',
78     ['gprintf_test.c'],
79     EXTRA_LIBS=['gio'])
80
81 node = env.CommandTest(
82     'gprintf_test.out',
83     command=[gprintf_test_exe],
84     stdout_golden=env.File('testdata/gprintf_test.stdout'))
85
86 env.AddNodeToTestSuite(node, ['small_tests'], 'run_gprintf_test')