示例#1
0
def generateTestFunctions():
    testFunctions = []
    testPath = os.path.split(FORATestModule.__file__)[0]
    foraFiles = [x for x in os.listdir(testPath) if x.endswith(".fora")]

    foraModules = []
    for filename in foraFiles:
        foraModules.append(
            FORA.extractImplValContainer(
                FORA.importModule(
                    os.path.join(testPath, filename)
                    )
                )
            )

    for module in foraModules:
        for member in module.objectMembers:
            expr = module.getMemberDefinition(member)
            testFunctions.append(FORA.pythonToFORA(expr.toFunctionImplval(False)))

    return testFunctions