def package_into_path(path: str, layoutDict: dict): """ Follows the users provided configuration file to package all cases into the provided path. Delegates most functionality to other functions. Arguments: path: str - The path to package into layoutDict: dict - The dict provided by the user's configuration """ # Look through all cases... for problemNumber, caseList in case.get_all_cases().items(): # Make the directories for the problem numbers problemDirName = Definitions.get_value('solution_naming').format( **dict(problem=problemNumber)) problemPath = fileops.join_path(path, problemDirName) fileops.make(problemPath, FileType.DIRECTORY) # Go through each type in the config file and package it for packageTypeName, packageType in layoutDict[TYPES_KEY].items(): package_type(problemPath, caseList, packageType, _get_compression_from_layout_dict(layoutDict), packageTypeName)
def test(writerNames: list, languageNames: list, problemStrings: list, outputToStderr: bool, printPassingCases: bool, printDiff: bool): """ Tests solutions based on the arguments provided and outputs results to stdout. If all arguments are none, all solutions are tested Arguments: writerNames: list - The list of writer names to test solutions for languageNames: list - The list of language names to test solutions for problemStrings: list - The list of problem strings to test solutions for """ solutionsToTest = _get_filtered_solutions(writerNames, languageNames, problemStrings) # load all the cases cases = CaseManager.get_all_cases() # Now test all of the solutions for solution in solutionsToTest: _test_solution_against_cases(solution, cases[int(solution.problemNumber)], outputToStderr, printPassingCases, printDiff)