def main(args):
    top = os.path.join(os.path.dirname(__file__), '..')
    os.chdir(top)

    verbose = True if len(args) > 0 and args[0] == '-v' else False

    top = os.getcwd()
    k_cp_build = os.path.join(top, 'build', 'lib',
                              'ardana_configurationprocessor')

    return_value = True

    num_pass = 0
    num_fail = 0

    for mp in inventory.getModulePaths():
        name = inventory.getModuleName(mp)
        if name and 'ardana' in name:
            os.chdir(mp)

            cur_build = os.path.join('.', 'build', 'lib',
                                     'ardana_configurationprocessor')

            if name != 'ardana_configurationprocessor':
                if os.path.exists(cur_build):
                    shutil.rmtree(cur_build)
                shutil.copytree(k_cp_build, cur_build)

            cur_test = os.path.join('.', 'build', 'lib', name, 'cp',
                                    'controller', 'test')
            if os.path.exists(cur_test):
                shutil.rmtree(cur_test)

            if os.path.exists('tox.ini'):
                print('@@@ Running tests in %s...' % mp),

                result, errors = _run_tox()

                if result:
                    print('[pass]')
                    num_pass += 1
                else:
                    print('[fail - %d error%s]' %
                          (len(errors), '' if len(errors) == 1 else 's'))
                    if verbose:
                        for e in errors:
                            print('----> %s' % e)
                        print('\n')

                    num_fail += 1
                    return_value = False

            os.chdir(top)

    num_test = num_pass + num_fail
    avg = float(num_pass) / float(num_test) * 100.0
    print('### %.0f%% Passing' % avg)

    return return_value
Example #2
0
    build_dir = os.path.join(module_path, 'build')
    if os.path.exists(build_dir):
        print('### Removing %s' % build_dir)
        shutil.rmtree(build_dir)

    dist_dir = os.path.join(module_path, 'dist')
    if os.path.exists(dist_dir):
        print('### Removing %s' % dist_dir)
        shutil.rmtree(dist_dir)

    egg_dir = os.path.join(module_path, '%s.egg-info' % name)
    if os.path.exists(egg_dir):
        print('### Removing %s' % egg_dir)
        shutil.rmtree(egg_dir)

    tox_dir = os.path.join(module_path, '.tox')
    if os.path.exists(tox_dir):
        print('### Removing %s' % tox_dir)
        shutil.rmtree(tox_dir)


# change to Scripts parent directory
os.chdir(os.path.join(os.path.dirname(__file__), '..'))

modulePaths = inventory.getModulePaths()
for modulePath in modulePaths:
    name = inventory.getModuleName(modulePath)
    if name:
        clean_module(name)
        clean_cur_path(modulePath, name)
def main(args):
    top = os.path.join(os.path.dirname(__file__), "..")
    os.chdir(top)

    verbose = True if len(args) > 0 and args[0] == "-v" else False

    top = os.getcwd()
    k_cp_build = os.path.join(top, "ConfigurationProcessor")
    k_cp_build = os.path.join(k_cp_build, "build")
    k_cp_build = os.path.join(k_cp_build, "lib")
    k_cp_build = os.path.join(k_cp_build, "helion_configurationprocessor")

    return_value = True

    num_pass = 0
    num_fail = 0

    for mp in inventory.getModulePaths():
        name = inventory.getModuleName(mp)
        if name and name.find("helion") != -1:
            os.chdir(mp)

            cur_build = os.path.join(".", "build")
            cur_build = os.path.join(cur_build, "lib")
            cur_build = os.path.join(cur_build, "helion_configurationprocessor")

            if name != "helion_configurationprocessor":
                if os.path.exists(cur_build):
                    shutil.rmtree(cur_build)
                shutil.copytree(k_cp_build, cur_build)

            cur_test = os.path.join(".", "build")
            cur_test = os.path.join(cur_test, "lib")
            cur_test = os.path.join(cur_test, name)
            cur_test = os.path.join(cur_test, "cp")
            cur_test = os.path.join(cur_test, "controller")
            cur_test = os.path.join(cur_test, "test")
            if os.path.exists(cur_test):
                shutil.rmtree(cur_test)

            if os.path.exists("tox.ini"):
                print("@@@ Running tests in %s..." % mp),

                result, errors = _run_tox()

                if result:
                    print("[pass]")
                    num_pass += 1
                else:
                    print("[fail - %d error%s]" % (len(errors), "" if len(errors) == 1 else "s"))
                    if verbose:
                        for e in errors:
                            print("----> %s" % e)
                        print("\n")

                    num_fail += 1
                    return_value = False

            os.chdir(top)

    num_test = num_pass + num_fail
    avg = float(num_pass) / float(num_test) * 100.0
    print("### %.0f%% Passing" % avg)

    return return_value