@@ -61,8 +61,9 @@ def camel_to_snake(name):
61
61
return re .sub ('([a-z0-9])([A-Z])' , r'\1_\2' , s1 ).lower ()
62
62
63
63
def main ():
64
- api_directory_path = 'src/kubernetes_api_objects' # Update this path if needed
64
+ api_directory_path = 'src/kubernetes_api_objects/exec ' # Update this path if needed
65
65
test_directory_path = 'src/unit_tests/kubernetes_api_objects'
66
+ flag = True
66
67
for filename in sorted (os .listdir (api_directory_path )): # loop through all files in api_directory_path
67
68
if filename .endswith ('.rs' ):
68
69
file_path = os .path .join (api_directory_path , filename )
@@ -82,19 +83,15 @@ def main():
82
83
count_external_body , count_external_pub_fn , count_external_fn = count_functions (file_path )
83
84
total_count = count_external_body + count_external_pub_fn + count_external_fn
84
85
86
+
85
87
if total_count != test_count :
88
+ flag = False
86
89
print (f"{ filename } : Total Count = { total_count } " )
87
90
print ("Test Count = " , test_count )
88
91
print ("ERROR: Test Count != Total Count" )
89
92
print (struct_count )
90
93
print ("-------------------------------------------" )
91
- elif total_count == 0 :
92
- print (f"{ filename } : Total Count = { total_count } " )
93
- print ("-------------------------------------------" )
94
- else :
95
- print (f"{ filename } : Total Count = { total_count } " )
96
- print ("Test Count = " , test_count )
97
- print ("Test coverage:" , round (test_count / total_count * 100 , 2 ), "%" )
98
- print ("-------------------------------------------" )
94
+ if flag :
95
+ print ("All functions are covered!" )
99
96
if __name__ == "__main__" :
100
97
main ()
0 commit comments