88
99def include_libft_bonuses (root_path : str ):
1010 """
11- This method removes the `.exclude` extention to the libft bonuses files.
11+ This function removes the `.exclude` extention to the libft bonuses files.
1212 """
1313 moulitest_libft_tests_path = root_path + "/testing_suites/moulitest/libft_tests/tests"
1414 files = os .listdir (moulitest_libft_tests_path )
@@ -21,7 +21,7 @@ def include_libft_bonuses(root_path: str):
2121
2222def exclude_libft_bonuses (root_path : str ):
2323 """
24- This method Adds the `.exclude` extention to the libft bonuses files.
24+ This function Adds the `.exclude` extention to the libft bonuses files.
2525 """
2626 moulitest_libft_tests_path = root_path + "/testing_suites/moulitest/libft_tests/tests"
2727 files = os .listdir (moulitest_libft_tests_path )
@@ -32,22 +32,25 @@ def exclude_libft_bonuses(root_path: str):
3232
3333
3434def execute_test (test_name : str , root_path : str ):
35- available_tests = ['libft_part1' , 'libft_part2' , 'libft_bonus' , 'get_next_line' , 'gnl' , 'ft_ls' , 'ft_printf' ]
35+ available_tests = ['libft_part1' , 'libft_part2' , 'libft_bonus' ,
36+ 'get_next_line' , 'gnl' , 'ft_ls' , 'ft_printf' ]
3637 if test_name not in available_tests :
3738 raise ValueError ("Given test not in moulitest available tests." )
39+
3840 with open (root_path + "/.mymoulitest" , 'w+' ) as file :
3941 file .write ("*------------------------------------------------------*\n " )
4042 file .write ("MOULITEST\n " )
4143 file .write ("Warning: This file contains escape sequences. Please use"
4244 " `cat' to view it properly.\n " )
4345 file .write ("*------------------------------------------------------*\n " )
44- # @todo: Get the result line of moulitest and parse it.
46+ # Run moulitest
4547 result = subprocess .run ('make ' + test_name + ' -C ' + root_path +
4648 '/testing_suites/moulitest' , shell = True ,
4749 stdout = subprocess .PIPE ,
4850 stderr = subprocess .STDOUT ).stdout .decode ('utf-8' )
4951 file .write (result + '\n ' )
5052 print (result )
53+ # Parse the result
5154 with open (root_path + "/.mymoulitest" , 'r' ) as file :
5255 for line in file :
5356 if "(dots)." in line :
@@ -60,9 +63,11 @@ def run(project_path: str, has_libft_bonuses: bool, project: str, root_path: str
6063 print ("*--------------------------Moulitest----------------------------*" )
6164 print ("*---------------------------------------------------------------*" )
6265 available_projects = ['ft_ls' , 'ft_printf' , 'gnl' , 'libft' , 'libftasm' ]
66+
6367 # Available projects checks if the given project corresponds to one the moulitest tests.
6468 if project not in available_projects :
6569 raise ValueError ("given project not in moulitest available projects." )
70+
6671 if project == "libft" :
6772 with open (root_path + "/testing_suites/moulitest/config.ini" , 'w+' ) as file :
6873 file .write ("LIBFT_PATH = " + project_path )
0 commit comments