Esempio n. 1
0
def _generate_jemalloc_integration_tests():
    paths = build_common.find_all_files(
        'android/external/jemalloc/test/integration', ['.c'],
        include_tests=True)

    # Disable some multi-threaded tests flaky under ARM qemu.
    if OPTIONS.is_arm():
        paths.remove(
            'android/external/jemalloc/test/integration/MALLOCX_ARENA.c')
        paths.remove(
            'android/external/jemalloc/test/integration/thread_arena.c')

    for path in paths:
        name = os.path.splitext(os.path.basename(path))[0]
        n = ninja_generator.TestNinjaGenerator('jemalloc_integartion_test_' +
                                               name)
        n.add_include_paths('android/external/jemalloc/include',
                            'android/external/jemalloc/test/include')
        n.add_c_flags('-Werror')
        n.add_c_flags('-DJEMALLOC_INTEGRATION_TEST')
        if OPTIONS.enable_jemalloc_debug():
            n.add_c_flags('-DJEMALLOC_DEBUG')
        # Needs C99 for "restrict" keyword.
        n.add_c_flags('-std=gnu99')
        n.add_library_deps('libjemalloc.a')
        n.add_library_deps('libjemalloc_integrationtest.a')
        n.build_default([path])
        n.run(n.link(),
              enable_valgrind=OPTIONS.enable_valgrind(),
              rule='run_test')
Esempio n. 2
0
def _generate_jemalloc_integration_tests():
  paths = build_common.find_all_files(
      'android/external/jemalloc/test/integration', ['.c'], include_tests=True)

  # Disable some multi-threaded tests flaky under ARM qemu.
  if OPTIONS.is_arm():
    paths.remove('android/external/jemalloc/test/integration/MALLOCX_ARENA.c')
    paths.remove('android/external/jemalloc/test/integration/thread_arena.c')

  for path in paths:
    name = os.path.splitext(os.path.basename(path))[0]
    n = ninja_generator.TestNinjaGenerator('jemalloc_integartion_test_' + name)
    n.add_include_paths(
        'android/external/jemalloc/include',
        'android/external/jemalloc/test/include')
    n.add_c_flags('-Werror')
    n.add_c_flags('-DJEMALLOC_INTEGRATION_TEST')
    if OPTIONS.enable_jemalloc_debug():
      n.add_c_flags('-DJEMALLOC_DEBUG')
    # Needs C99 for "restrict" keyword.
    n.add_c_flags('-std=gnu99')
    n.add_library_deps('libjemalloc.a')
    n.add_library_deps('libjemalloc_integrationtest.a')
    n.build_default([path])
    n.run(n.link(), enable_valgrind=OPTIONS.enable_valgrind(), rule='run_test')
Esempio n. 3
0
def _generate_jemalloc_unit_tests():
    paths = build_common.find_all_files('android/external/jemalloc/test/unit',
                                        ['.c'],
                                        include_tests=True)

    # These tests need -DJEMALLOC_PROF which we do not enable.
    paths.remove('android/external/jemalloc/test/unit/prof_accum.c')
    paths.remove('android/external/jemalloc/test/unit/prof_accum_a.c')
    paths.remove('android/external/jemalloc/test/unit/prof_accum_b.c')
    paths.remove('android/external/jemalloc/test/unit/prof_gdump.c')
    paths.remove('android/external/jemalloc/test/unit/prof_idump.c')

    # Disable some multi-threaded tests flaky under ARM qemu.
    if OPTIONS.is_arm():
        paths.remove('android/external/jemalloc/test/unit/mq.c')
        paths.remove('android/external/jemalloc/test/unit/mtx.c')

    for path in paths:
        name = os.path.splitext(os.path.basename(path))[0]
        n = ninja_generator.TestNinjaGenerator('jemalloc_unit_test_' + name)
        n.add_include_paths('android/external/jemalloc/include',
                            'android/external/jemalloc/test/include')
        n.add_c_flags('-Werror')
        n.add_c_flags('-DJEMALLOC_UNIT_TEST')
        if OPTIONS.enable_jemalloc_debug():
            n.add_c_flags('-DJEMALLOC_DEBUG')
        # Needs C99 for "restrict" keyword.
        n.add_c_flags('-std=gnu99')
        n.add_library_deps('libjemalloc_jet.a')
        n.add_library_deps('libjemalloc_unittest.a')
        n.build_default([path])
        n.run(n.link(),
              enable_valgrind=OPTIONS.enable_valgrind(),
              rule='run_test')
Esempio n. 4
0
def _generate_jemalloc_unit_tests():
  paths = build_common.find_all_files(
      'android/external/jemalloc/test/unit', ['.c'], include_tests=True)

  # These tests need -DJEMALLOC_PROF which we do not enable.
  paths.remove('android/external/jemalloc/test/unit/prof_accum.c')
  paths.remove('android/external/jemalloc/test/unit/prof_accum_a.c')
  paths.remove('android/external/jemalloc/test/unit/prof_accum_b.c')
  paths.remove('android/external/jemalloc/test/unit/prof_gdump.c')
  paths.remove('android/external/jemalloc/test/unit/prof_idump.c')

  # Disable some multi-threaded tests flaky under ARM qemu.
  if OPTIONS.is_arm():
    paths.remove('android/external/jemalloc/test/unit/mq.c')
    paths.remove('android/external/jemalloc/test/unit/mtx.c')

  for path in paths:
    name = os.path.splitext(os.path.basename(path))[0]
    n = ninja_generator.TestNinjaGenerator('jemalloc_unit_test_' + name)
    n.add_include_paths(
        'android/external/jemalloc/include',
        'android/external/jemalloc/test/include')
    n.add_c_flags('-Werror')
    n.add_c_flags('-DJEMALLOC_UNIT_TEST')
    if OPTIONS.enable_jemalloc_debug():
      n.add_c_flags('-DJEMALLOC_DEBUG')
    # Needs C99 for "restrict" keyword.
    n.add_c_flags('-std=gnu99')
    n.add_library_deps('libjemalloc_jet.a')
    n.add_library_deps('libjemalloc_unittest.a')
    n.build_default([path])
    n.run(n.link(), enable_valgrind=OPTIONS.enable_valgrind(), rule='run_test')
Esempio n. 5
0
def generate_test_ninjas():
    n = ninja_generator.TestNinjaGenerator('stlport_unittest',
                                           base_path=_STLPORT_ROOT +
                                           '/test/unit')

    n.add_c_flags('-Werror')
    n.add_cxx_flags('-Werror')

    # For avoiding compile failure on min_test.cpp.
    n.add_cxx_flags('-Wno-sequence-point')

    # For avoiding compile failure on sstream_test.cpp and time_facets_test.cpp.
    n.add_cxx_flags('-Wno-uninitialized')

    if n.is_clang_enabled():
        # For avoiding compile failure on string_test.cpp.
        n.add_cxx_flags('-Wno-unused-comparison')

        # For avoiding compile failure on resolve_name.cpp.
        n.add_cxx_flags('-Wno-unused-function')

        # For avoiding compile failure on fstream_test.cpp and sstream_test.cpp.
        n.add_cxx_flags('-Wno-unused-private-field')

        # For avoiding compile failure on slist_test.cpp, list_test.cpp and
        # type_traits_test.cpp.
        n.add_cxx_flags('-Wno-unused-variable')
    else:
        # For avoiding compile failure on --disable-debug-code.
        n.add_cxx_flags('-Wno-maybe-uninitialized')

    # Define STLPORT so that cppunit_proxy.h does not define
    # CPPUNIT_MINI_USE_EXCEPTIONS
    n.add_cxx_flags('-DSTLPORT')

    n.build_default(n.find_all_files(_STLPORT_ROOT + '/test/unit',
                                     ['.cpp', '.c'],
                                     include_tests=True,
                                     exclude=_EXCLUDE_FILES),
                    base_path=None)

    argv = '-x=%s' % ','.join(_EXCLUDE_TESTS)
    n.run(n.link(),
          argv=argv,
          enable_valgrind=OPTIONS.enable_valgrind(),
          rule='run_test')
Esempio n. 6
0
def generate_test_ninjas():
  n = ninja_generator.TestNinjaGenerator(
      'stlport_unittest',
      base_path=_STLPORT_ROOT + '/test/unit')

  n.add_c_flags('-Werror')
  n.add_cxx_flags('-Werror')

  # For avoiding compile failure on min_test.cpp.
  n.add_cxx_flags('-Wno-sequence-point')

  # For avoiding compile failure on sstream_test.cpp and time_facets_test.cpp.
  n.add_cxx_flags('-Wno-uninitialized')

  if n.is_clang_enabled():
    # For avoiding compile failure on string_test.cpp.
    n.add_cxx_flags('-Wno-unused-comparison')

    # For avoiding compile failure on resolve_name.cpp.
    n.add_cxx_flags('-Wno-unused-function')

    # For avoiding compile failure on fstream_test.cpp and sstream_test.cpp.
    n.add_cxx_flags('-Wno-unused-private-field')

    # For avoiding compile failure on slist_test.cpp, list_test.cpp and
    # type_traits_test.cpp.
    n.add_cxx_flags('-Wno-unused-variable')
  else:
    # For avoiding compile failure on --disable-debug-code.
    n.add_cxx_flags('-Wno-maybe-uninitialized')

  # Define STLPORT so that cppunit_proxy.h does not define
  # CPPUNIT_MINI_USE_EXCEPTIONS
  n.add_cxx_flags('-DSTLPORT')

  n.build_default(
      n.find_all_files(_STLPORT_ROOT + '/test/unit',
                       ['.cpp', '.c'],
                       include_tests=True,
                       exclude=_EXCLUDE_FILES),
      base_path=None)

  argv = '-x=%s' % ','.join(_EXCLUDE_TESTS)
  n.run(n.link(), argv=argv, enable_valgrind=OPTIONS.enable_valgrind(),
        rule='run_test')
Esempio n. 7
0
def _validate_valgrind(parser, args):
  if OPTIONS.enable_valgrind():
    parser.error("You cannot run ARC with binaries built for Valgrind "
                 "because Valgrind build uses runnable-ld.so with a "
                 "special hack for Valgrind.")
Esempio n. 8
0
def _validate_valgrind(parser, args):
    if OPTIONS.enable_valgrind():
        parser.error("You cannot run ARC with binaries built for Valgrind "
                     "because Valgrind build uses runnable-ld.so with a "
                     "special hack for Valgrind.")