@@ -104,6 +104,16 @@ function generalize_file_paths(path::AbstractString)
104
104
end
105
105
end
106
106
107
+ # raw_file_path,line => file,location
108
+ location_cache = Dict {Tuple{Symbol,Int},Tuple{String,String}} ()
109
+ function get_location (file:: Symbol , line:: Int )
110
+ return get! (location_cache, (file, line)) do
111
+ _file = generalize_file_paths (string (file))
112
+ _location = string (_file, " :" , line)
113
+ return _file, _location
114
+ end
115
+ end
116
+
107
117
# passed, failed, skipped, or unknown
108
118
function get_status (result)
109
119
if result isa Test. Pass && result. test_type === :skipped
@@ -142,12 +152,11 @@ get_rid(rdata) = (rdata["location"], rdata["result"], haskey(rdata, "failure_exp
142
152
143
153
function result_dict (result:: Test.Result , result_counts:: Dict{Tuple{String,String,UInt64},Int} )
144
154
file, line = if ! hasproperty (result, :source ) || isnothing (result. source)
145
- " unknown" , 0
155
+ : unknown , 0
146
156
else
147
- something (result. source. file, " unknown" ), result. source. line
157
+ something (result. source. file, : unknown ), result. source. line
148
158
end
149
- file = generalize_file_paths (string (file))
150
- location = string (file, ' :' , line)
159
+ file, location = get_location (file, line)
151
160
status = get_status (result)
152
161
153
162
# Early exit for passed tests before more expensive operations
0 commit comments