Home | History | Annotate | Download | only in manifest
      1 # -*- python -*-
      2 # Copyright (c) 2012 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('env')
      7 
      8 # TODO(robertm): those should not be necessary once we go -std=c99
      9 env.FilterOut(CFLAGS=['-pedantic'])
     10 env.FilterOut(CCFLAGS=['-pedantic'])
     11 env.Replace(TEST_DIR='${SOURCE_ROOT}/ppapi/native_client/tests/ppapi_browser/' +
     12                      'manifest')
     13 
     14 manifest_good_sources = env.ComponentObject('manifest_good.cc'),
     15 
     16 manifest_good_target = env.ProgramNameForNmf('manifest_good')
     17 env.ComponentProgram(manifest_good_target,
     18                      [manifest_good_sources],
     19                      EXTRA_LIBS=['ppapi',
     20                                  'ppapi_test_lib',
     21                                  'pthread',
     22                                  'platform',
     23                                  'gio'])
     24 
     25 manifest_bad_sources = env.ComponentObject('manifest_bad.cc'),
     26 
     27 manifest_bad_target = env.ProgramNameForNmf('manifest_bad')
     28 env.ComponentProgram(manifest_bad_target,
     29                      [manifest_bad_sources],
     30                      EXTRA_LIBS=['ppapi',
     31                                  'ppapi_test_lib',
     32                                  'pthread',
     33                                  'platform',
     34                                  'gio'])
     35 
     36 env.Publish(manifest_good_target, 'run', [
     37     'manifest.html',
     38     manifest_bad_target,
     39     '${SCONSTRUCT_DIR}/tests/ppapi_browser/progress_event_listener.js',
     40     '${SCONSTRUCT_DIR}/tools/browser_tester/browserdata/nacltest.js',
     41 ])
     42 
     43 file_mapping = []
     44 if env.Bit('nacl_glibc'):
     45   file_mapping.append(
     46       ('subdir/runnable-ld.so',env.File('${NACL_SDK_LIB}/runnable-ld.so')))
     47 file_mapping += [
     48     ('subdir/manifest_subdir.nmf',
     49     env.File('${STAGING_DIR}/manifest_subdir.nmf')),
     50     # the 'good' nexe in the root directory will fail.
     51     (manifest_good_target + env['PROGSUFFIX'],
     52     env.File('${STAGING_DIR}/%s${PROGSUFFIX}' % manifest_bad_target)),
     53     # the 'good' nexe in the subdirectory will succeed.
     54     ('subdir/' + manifest_good_target + env['PROGSUFFIX'],
     55     env.File('${STAGING_DIR}/%s${PROGSUFFIX}' % manifest_good_target))]
     56 
     57 node = env.PPAPIBrowserTester(
     58     'manifest_browser_test.out',
     59     url='manifest.html',
     60     nmfs=['${TEST_DIR}/manifest_top.nmf',
     61           '${TEST_DIR}/manifest_subdir.nmf',
     62           '${TEST_DIR}/manifest_arch_specific.nmf'],
     63     files=env.ExtractPublishedFiles(manifest_good_target),
     64     map_files=file_mapping)
     65 
     66 env.AddNodeToTestSuite(node,
     67                        ['chrome_browser_tests'],
     68                        'run_manifest_browser_test',
     69                        is_broken=env.PPAPIBrowserTesterIsBroken())
     70