def GenerateTestList(sourceFile, rootDir):
    tests = []
    fileName, fileExtension = os.path.splitext(sourceFile)
    if fileExtension == ".run":
        lines = ReadFileAsLines(sourceFile)
        for line in lines:
            tests += GenerateTestList(os.path.join(os.path.dirname(sourceFile), line), rootDir)
    elif fileExtension == ".test":
        tests.append(os.path.relpath(os.path.realpath(sourceFile), rootDir).replace("\\", "/"))
    return tests