コード例 #1
0
ファイル: common.py プロジェクト: HankFaan/maple
def is_package(suite):
    path = config.regression_home()
    for s in suite.split('.'):
        path = os.path.join(path, s)
    if os.path.exists(path) and os.path.isdir(path):
        return True
    return False
コード例 #2
0
ファイル: common.py プロジェクト: sljiaa/data-race-detectors
def is_package(suite):
    path = config.regression_home()
    for s in suite.split('.'):
        path = os.path.join(path, s)
    if os.path.exists(path) and os.path.isdir(path):
        return True
    return False
コード例 #3
0
ファイル: common.py プロジェクト: sljiaa/data-race-detectors
def script_path(suite):
    assert is_testcase(suite)
    path = config.regression_home()
    for s in suite.split('.'):
        path = os.path.join(path, s)
    python_path = path + python_ext()
    if os.path.exists(python_path) and os.path.isfile(python_path):
        return python_path
    return None
コード例 #4
0
ファイル: common.py プロジェクト: HankFaan/maple
def script_path(suite):
    assert is_testcase(suite)
    path = config.regression_home()
    for s in suite.split('.'):
        path = os.path.join(path, s)
    python_path = path + python_ext()
    if os.path.exists(python_path) and os.path.isfile(python_path):
        return python_path
    return None
コード例 #5
0
ファイル: common.py プロジェクト: sljiaa/data-race-detectors
def source_path(suite):
    assert is_testcase(suite)
    path = config.regression_home()
    for s in suite.split('.'):
        path = os.path.join(path, s)
    cxx_path = path + cxx_ext()
    if os.path.exists(cxx_path) and os.path.isfile(cxx_path):
        return cxx_path
    c_path = path + c_ext()
    if os.path.exists(c_path) and os.path.isfile(c_path):
        return c_path
    return None
コード例 #6
0
ファイル: common.py プロジェクト: HankFaan/maple
def source_path(suite):
    assert is_testcase(suite)
    path = config.regression_home()
    for s in suite.split('.'):
        path = os.path.join(path, s)
    cxx_path = path + cxx_ext()
    if os.path.exists(cxx_path) and os.path.isfile(cxx_path):
        return cxx_path
    c_path = path + c_ext()
    if os.path.exists(c_path) and os.path.isfile(c_path):
        return c_path
    return None
コード例 #7
0
ファイル: common.py プロジェクト: sljiaa/data-race-detectors
def is_testcase(suite):
    path = config.regression_home()
    for s in suite.split('.'):
        path = os.path.join(path, s)
    cxx_path = path + cxx_ext()
    c_path = path + c_ext()
    python_path = path + python_ext()
    source_exists = False
    script_exists = False
    if os.path.exists(cxx_path) and os.path.isfile(cxx_path):
        source_exists = True
    if os.path.exists(c_path) and os.path.isfile(c_path):
        source_exists = True
    if os.path.exists(python_path) and os.path.isfile(python_path):
        script_exists = True
    if source_exists and script_exists:
        return True
    else:
        return False
コード例 #8
0
ファイル: common.py プロジェクト: HankFaan/maple
def is_testcase(suite):
    path = config.regression_home()
    for s in suite.split('.'):
        path = os.path.join(path, s)
    cxx_path = path + cxx_ext()
    c_path = path + c_ext()
    python_path = path + python_ext()
    source_exists = False
    script_exists = False
    if os.path.exists(cxx_path) and os.path.isfile(cxx_path):
        source_exists = True
    if os.path.exists(c_path) and os.path.isfile(c_path):
        source_exists = True
    if os.path.exists(python_path) and os.path.isfile(python_path):
        script_exists = True
    if source_exists and script_exists:
        return True
    else:
        return False
コード例 #9
0
ファイル: common.py プロジェクト: sljiaa/data-race-detectors
def list_subsuites(suite):
    assert is_package(suite)
    subsuites = []
    path = config.regression_home()
    for s in suite.split('.'):
        path = os.path.join(path, s)
    assert os.path.isdir(path)
    for f in os.listdir(path):
        if f.startswith('.'):
            continue  # ignore hidden files and directories
        new_path = os.path.join(path, f)
        if os.path.isfile(new_path):
            name, ext = os.path.splitext(f)
            subsuite = suite + '.' + name
            if is_source(ext) and is_testcase(subsuite):
                subsuites.append(subsuite)
        if os.path.isdir(new_path):
            subsuite = suite + '.' + f
            subsuites.append(subsuite)
    return subsuites
コード例 #10
0
ファイル: common.py プロジェクト: HankFaan/maple
def list_subsuites(suite):
    assert is_package(suite)
    subsuites = []
    path = config.regression_home()
    for s in suite.split('.'):
        path = os.path.join(path, s)
    assert os.path.isdir(path)
    for f in os.listdir(path):
        if f.startswith('.'):
            continue # ignore hidden files and directories
        new_path = os.path.join(path, f)
        if os.path.isfile(new_path):
            name, ext = os.path.splitext(f)
            subsuite = suite + '.' + name
            if is_source(ext) and is_testcase(subsuite):
                subsuites.append(subsuite)
        if os.path.isdir(new_path):
            subsuite = suite + '.' + f
            subsuites.append(subsuite)
    return subsuites
コード例 #11
0
def valid_suite_set():
    base_dir = config.regression_home()
    return find_suites('', base_dir)