Пример #1
0
def GenerateTests():
    cover_mods = []
    for mod_dir_base in recipe_util.MODULE_DIRS():
        if os.path.isdir(mod_dir_base):
            cover_mods.append(os.path.join(mod_dir_base, '*', '*api.py'))

    for recipe_path, recipe_name in recipe_loader.loop_over_recipes():
        recipe = recipe_loader.load_recipe(recipe_name)
        test_api = recipe_loader.create_test_api(recipe.DEPS)

        covers = cover_mods + [recipe_path]

        for test_data in recipe.GenTests(test_api):
            root, name = os.path.split(recipe_path)
            name = os.path.splitext(name)[0]
            expect_path = os.path.join(root, '%s.expected' % name)

            test_data.properties['recipe'] = recipe_name.replace('\\', '/')
            yield expect_tests.Test('%s.%s' % (recipe_name, test_data.name),
                                    expect_tests.FuncCall(
                                        RunRecipe, test_data),
                                    expect_dir=expect_path,
                                    expect_base=test_data.name,
                                    covers=covers,
                                    break_funcs=(recipe.GenSteps, ))
Пример #2
0
def GenTests():
  for test_name, test in gsubmodd_test_definitions.GSUBMODD_TESTS.iteritems():
    yield expect_tests.Test(
        '%s.%s' % (__package__, test_name),
        expect_tests.FuncCall(RunTest, test_name),
        expect_base=test_name, break_funcs=[test],
        covers=(
            expect_tests.Test.covers_obj(RunTest) +
            expect_tests.Test.covers_obj(gsubmodd_test_definitions)))
Пример #3
0
def GenTests():
    for test_name, test in gnumbd_test_definitions.GNUMBD_TESTS.iteritems():
        yield expect_tests.Test(
            __package__ + '.' + test_name,
            expect_tests.FuncCall(RunTest, test_name),
            expect_base=test_name,
            ext='yaml',
            break_funcs=[test],
            covers=(expect_tests.Test.covers_obj(RunTest) +
                    expect_tests.Test.covers_obj(gnumbd_test_definitions)))
Пример #4
0
def GenerateTests():
  for recipe_path, recipe_name in recipe_loader.loop_over_recipes():
    recipe = recipe_loader.load_recipe(recipe_name)
    test_api = recipe_loader.create_test_api(recipe.DEPS)
    for test_data in recipe.GenTests(test_api):
      root, name = os.path.split(recipe_path)
      name = os.path.splitext(name)[0]
      expect_path = os.path.join(root, '%s.expected' % name)

      test_data.properties['recipe'] = recipe_name.replace('\\', '/')
      yield expect_tests.Test(
          '%s.%s' % (recipe_name, test_data.name),
          RunRecipe, args=(test_data,),
          expect_dir=expect_path,
          expect_base=test_data.name,
          break_funcs=(recipe.GenSteps,)
      )