@@ -7,7 +7,6 @@ import Standard.Base.Runtime.Ref.Ref
77from Standard.Base.Logging import all
88from Standard.Base.Runtime import assert
99
10- import project.Group.Group
1110import project.Internal.Stack_Trace_Helpers
1211import project.Spec_Result.Spec_Result
1312import project.Suite_Config.Suite_Config
@@ -64,8 +63,7 @@ maybe_grey_text (text : Text) (config : Suite_Config) =
6463 if config.use_ansi_colors then (grey text) else text
6564
6665## Print result for a single Spec run
67- print_single_result : Text -> Test_Result -> Suite_Config -> Nothing
68- print_single_result (group_name : Text) (test_result : Test_Result) (config : Suite_Config) =
66+ print_single_result (println:Text->Nothing) (group_name : Text) (test_result : Test_Result) (config : Suite_Config) =
6967 times_suffix =
7068 times = test_result.time_taken.total_milliseconds.to_text + "ms"
7169 "[" + times + "]"
@@ -78,29 +76,29 @@ print_single_result (group_name : Text) (test_result : Test_Result) (config : Su
7876 Spec_Result.Success ->
7977 if config.print_only_failures.not then
8078 txt = " - " + test_result.spec_name + " " + times_suffix
81- IO. println (maybe_green_text txt config)
79+ println (maybe_green_text txt config)
8280 Spec_Result.Failure msg details ->
83- report_github_error_message group_name+": "+test_result.spec_name msg
84- IO. println ""
81+ report_github_error_message println group_name+": "+test_result.spec_name msg
82+ println ""
8583 txt = " - [FAILED] " + test_result.spec_name + " " + times_suffix
86- IO. println (maybe_red_text txt config)
87- IO. println (" Reason: " + msg)
84+ println (maybe_red_text txt config)
85+ println (" Reason: " + msg)
8886 if details.is_nothing.not then
89- IO. println (decorate_stack_trace details)
90- IO. println ""
87+ println (decorate_stack_trace details)
88+ println ""
9189 Spec_Result.Pending reason ->
92- IO. println (maybe_grey_text (" - [PENDING] " + test_result.spec_name) config)
93- IO. println (" Reason: " + reason)
90+ println (maybe_grey_text (" - [PENDING] " + test_result.spec_name) config)
91+ println (" Reason: " + reason)
9492
9593## ---
9694 private: true
9795 ---
9896 Reports an error message to show up as a note in GitHub Actions, only if
9997 running in the GitHub Actions environment.
100- report_github_error_message (~title : Text) (~message : Text) =
98+ private report_github_error_message println (~title : Text) (~message : Text) =
10199 is_enabled = Environment.get "GITHUB_ACTIONS" == "true"
102100 if is_enabled then
103- IO. println (generate_github_error_annotation title message)
101+ println (generate_github_error_annotation title message)
104102
105103## ---
106104 private: true
@@ -142,20 +140,18 @@ generate_github_error_annotation (title : Text) (message : Text) =
142140 from multiple groups.
143141 - `builder`: StringBuilder or Nothing. If StringBuilder, then a jUnit XML
144142 format is appended to that StringBuilder.
145- print_report : Vector Test_Result -> Suite_Config -> (StringBuilder | Nothing) -> Nothing
146- print_report (test_results : Vector Test_Result) (config : Suite_Config) (builder : (StringBuilder | Nothing)) =
143+ private print_report (println:Text->Nothing) (test_results : Vector Test_Result) (config : Suite_Config) (builder : (StringBuilder | Nothing)) =
147144 distinct_group_names = test_results.map (_.group_name) . distinct
148145 results_per_group = distinct_group_names.fold Dictionary.empty acc-> group_name->
149146 group_results = test_results.filter res->
150147 res.group_name == group_name
151148 assert (group_results.length > 0)
152149 acc.insert group_name group_results
153150 results_per_group.each_with_key group_name-> group_results->
154- print_group_report group_name group_results config builder
151+ print_group_report println group_name group_results config builder
155152
156153## Prints a pending group, optionally writing it to a jUnit XML output.
157- print_pending_group : Group -> Suite_Config -> (StringBuilder | Nothing) -> Nothing
158- print_pending_group group config builder =
154+ private print_pending_group println group config builder =
159155 assert group.pending.is_nothing.not "Group in print_pending_group should be pending"
160156 if config.should_output_junit then
161157 assert builder.is_nothing.not "Builder must be specified when JUnit output is enabled"
@@ -165,15 +161,14 @@ print_pending_group group config builder =
165161 builder.append (' <skipped message="Reason: '+(escape_xml group.pending inside_attribute=True)+'"/>\n')
166162 builder.append (' </testcase>\n')
167163 builder.append ' </testsuite>\n'
168- IO. println <| maybe_grey_text ("[PENDING] " + group.name) config
169- IO. println (" Reason: " + group.pending)
164+ println <| maybe_grey_text ("[PENDING] " + group.name) config
165+ println (" Reason: " + group.pending)
170166
171167## Prints report for test_results from a single group.
172168
173169 ## Arguments
174170 - `test_results`: Test test_results from a single group
175- print_group_report : Text -> Vector Test_Result -> Suite_Config -> (StringBuilder|Nothing) -> Nothing
176- print_group_report group_name test_results config builder =
171+ private print_group_report (println:Text->Nothing) group_name test_results config builder =
177172 distinct_groups = test_results.distinct (res-> res.group_name)
178173 assert (distinct_groups.length == 1)
179174 total_time = test_results.fold Duration.zero acc-> res->
@@ -216,11 +211,11 @@ print_group_report group_name test_results config builder =
216211 counts = tests_succeeded.to_text + "/" + tests_executed.to_text
217212 times = total_time.total_milliseconds.to_text + "ms"
218213 group_name + ": " + "[" + counts + ", " + times + "]"
219- IO. println <| case some_test_failed of
214+ println <| case some_test_failed of
220215 True -> maybe_red_text ("[FAILED] " + group_description) config
221216 False -> maybe_green_text group_description config
222217 test_results.each result->
223- print_single_result group_name result config
218+ print_single_result println group_name result config
224219
225220## ---
226221 private: true
0 commit comments