summaryrefslogtreecommitdiffstats
path: root/ppapi/native_client/tests/earth/nacl.scons
blob: bc98cfe4f5be6f42fee235effd2d0b3167c015cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# -*- python -*-
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

Import('env')

if (not env.Bit('bitcode')):
  flags = ['-mfpmath=sse', '-msse2', '-O3', '-ffast-math',
           '-fomit-frame-pointer']
  env.Append(CCFLAGS=flags)
  env.Append(CXXFLAGS=flags)

earthlib = env.ComponentLibrary('earthlib', ['earth.cc'])

# build, C then C++
cobj=['pepper_c.c']
c_nexe_name = env.ProgramNameForNmf('earth_c')
cnexe = env.ComponentProgram(c_nexe_name, cobj,
                            EXTRA_LIBS=['earthlib',
                                        '${PPAPI_LIBS}',
                                        'm', 'pthread'])
env.Publish(c_nexe_name, 'run', ['earth_c.html'])

node = env.DemoSelLdrNacl('demo_earth_c', cnexe, args=[])
# Note: Make this available from top level
Alias('demo_earth_c', node)

ccobj=['pepper_cc.cc']
cc_nexe_name = env.ProgramNameForNmf('earth_cc')
ccnexe = env.ComponentProgram(cc_nexe_name, ccobj,
                            EXTRA_LIBS=['earthlib',
                                        '${PPAPI_LIBS}',
                                        'ppapi_cpp',
                                        'm', 'pthread'])
env.Publish(cc_nexe_name, 'run', ['earth_cc.html'])

node = env.DemoSelLdrNacl('demo_earth_cc', ccnexe, args=[])
# Note: Make this available from top level
Alias('demo_earth_cc', node)


# Validator tests, C then C++, but not for glibc
# TODO(bradchen): enable these tests when ncval works with glibc DSOs
if not env.Bit('nacl_glibc'):
  node = env.CommandValidatorTestNacl(
    'earth_test_val_c.out',
    image=[cnexe],
    )
  env.AddNodeToTestSuite(node, ['validator_tests', 'small_tests'],
                         'run_earth_c')
  node = env.CommandValidatorTestNacl(
    'earth_test_val_cc.out',
    image=[ccnexe],
    )
  env.AddNodeToTestSuite(node, ['validator_tests', 'small_tests'],
                         'run_earth_cc')


# browser tests, C then C++

node = env.PPAPIBrowserTester(
    'earth_browser_test_c.out',
    url='earth_c.html',
    nmf_names=['earth_c'],
    files=env.ExtractPublishedFiles(c_nexe_name),
    is_broken=env.PPAPIBrowserTesterIsBroken())

env.AddNodeToTestSuite(node, ['chrome_browser_tests'], 'earth_browser_test_c')

node = env.PPAPIBrowserTester(
    'earth_browser_test_cc.out',
    url='earth_cc.html',
    nmf_names=['earth_cc'],
    files=env.ExtractPublishedFiles(cc_nexe_name),
    is_broken=env.PPAPIBrowserTesterIsBroken())

env.AddNodeToTestSuite(node, ['chrome_browser_tests'], 'earth_browser_test_cc')