Ejemplo n.º 1
0
def run_tests(tests, verbose, continue_failure, control):
    for test in test_generator(tests, util.get_arches(), verbose):
        try:
            test.config()
            test.build(force_build=False)
            test.run(control=control)
        except Exception as e:
            handle_failure(test, e)
            if not continue_failure:
                break
Ejemplo n.º 2
0
def run_tests(tests,
              verbose,
              continue_failure,
              control):
  for test in test_generator(tests, util.get_arches(), verbose):
    try:
      test.config()
      test.build(force_build=False)
      test.run(control=control)
    except Exception as e:
      handle_failure(test, e)
      if not continue_failure:
        break
Ejemplo n.º 3
0
def clean(tests, continue_failure, verbose, level):
    for test_suite in test_generator(tests, util.get_arches(), verbose):
        try:
            test_suite.clean(level)
        except Exception as e:
            handle_failure(test_suite, e)
            if not continue_failure:
                break
    if level != test.CACHE_CLEAN:
        # clean up pyc files, if they are there and the .py file is also there.
        for dir in clean_pyc_dirs:
            for file in dir:
                abs_file = os.path.join(os.path.abspath(os.curdir), dir, file)
                if os.path.isfile(abs_file):
                    (root, ext) = os.path.splitext(abs_file)
                    if ext == 'pyc':
                        py_file = root + '.py'
                        if os.path.exists(py_file) and os.path.isfile(py_file):
                            os.remove(abs_file)
    # finally make clean in the sub directory.
    util.make(os.path.join(os.path.abspath(os.curdir), 'test', 'unit'),
              'clean')
Ejemplo n.º 4
0
def clean(tests,
          continue_failure,
          verbose,
          level):
  for test_suite in test_generator(tests, util.get_arches(), verbose):
    try:
      test_suite.clean(level)
    except Exception as e:
      handle_failure(test_suite, e)
      if not continue_failure:
        break
  if level != test.CACHE_CLEAN:
# clean up pyc files, if they are there and the .py file is also there.
    for dir in clean_pyc_dirs:
      for file in dir:
        abs_file = os.path.join(os.path.abspath(os.curdir), dir, file)
        if os.path.isfile(abs_file):
          (root, ext) = os.path.splitext(abs_file)
          if ext == 'pyc':
            py_file = root + '.py'
            if os.path.exists(py_file) and os.path.isfile(py_file):
              os.remove(abs_file)
  # finally make clean in the sub directory.
  util.make(os.path.join(os.path.abspath(os.curdir), 'test', 'unit'), 'clean')