Commit caf82b03 authored by Giuseppe Tropea's avatar Giuseppe Tropea
Browse files

added flag to skip try/catch

parent f6334b2d
Loading
Loading
Loading
Loading
+16 −10
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ from os.path import dirname, exists
from os import makedirs, walk


def create_json_of_robotfile(robot_file_to_be_processed: str):
def create_json_of_robotfile(robot_file_to_be_processed: str, computestatistics: bool=False):
    folder_test_suites = dirname(dirname(__file__))

    folder_result_path = f'{folder_test_suites}/doc/results'
@@ -17,6 +17,7 @@ def create_json_of_robotfile(robot_file_to_be_processed: str):
    if not exists(folder_result_path):
        makedirs(folder_result_path)

    if computestatistics:
        try:
            data = GenerateRobotData(robot_file=robot_file, execdir=folder_test_suites)
            data.parse_robot()
@@ -29,6 +30,11 @@ def create_json_of_robotfile(robot_file_to_be_processed: str):
            if(robot_path_to_be_processed.startswith("/")):
                robot_path_to_be_processed = robot_path_to_be_processed[1:]
            info["robotpath"] = robot_path_to_be_processed
    else:
        data = GenerateRobotData(robot_file=robot_file, execdir=folder_test_suites)
        data.parse_robot()
        info = data.get_info()


    with open(result_file, 'w') as fp:
        dump(obj=info, indent=2, fp=fp)
+2 −2
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ if __name__ == "__main__":
            if filename.endswith(".robot"):
                number_of_testcases += 1
                name_of_test_case = filename[:-6]
                json_of_test_case = create_json_of_robotfile(name_of_test_case)
                json_of_test_case = create_json_of_robotfile(name_of_test_case, True)
                statistics[name_of_test_case] = dict()
                strippedpath = root[len(fullpath)+1:]
                statistics[name_of_test_case]["path"] = strippedpath