File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change 3
3
"""
4
4
function make_epiaware_suite (model; check = true ,
5
5
adbackends = [:forwarddiff , :reversediff , :reversediff_compiled ])
6
- suite = TuringBenchmarking. make_turing_suite (
7
- model; check = check, adbackends = adbackends)
6
+ suite = prefix_warnings (
7
+ () -> TuringBenchmarking. make_turing_suite (
8
+ model; check = check, adbackends = adbackends),
9
+ model
10
+ )
8
11
return suite
9
12
end
13
+
14
+ function prefix_warnings (f, g)
15
+ original_stderr = stderr
16
+ (read_pipe, write_pipe) = redirect_stderr ()
17
+ result = nothing
18
+ try
19
+ result = f ()
20
+ finally
21
+ redirect_stderr (original_stderr)
22
+ close (write_pipe)
23
+ output = String (read (read_pipe))
24
+ if ! isempty (output)
25
+ println (stderr , " \n Warnings from $(g) :" )
26
+ println (stderr , output)
27
+ end
28
+ end
29
+ return result
30
+ end
You can’t perform that action at this time.
0 commit comments