@@ -11,25 +11,33 @@ use std::fmt;
11
11
12
12
use anyhow:: { Context , bail, ensure} ;
13
13
14
- use crate :: { Float , Int , MaybeOverride , SpecialCase , TestResult } ;
14
+ use crate :: { BaseName , Float , Identifier , Int , MaybeOverride , SpecialCase , TestResult } ;
15
15
16
16
/// Context passed to [`CheckOutput`].
17
17
#[ derive( Clone , Debug , PartialEq , Eq ) ]
18
18
pub struct CheckCtx {
19
19
/// Allowed ULP deviation
20
20
pub ulp : u32 ,
21
+ pub fn_ident : Identifier ,
22
+ pub base_name : BaseName ,
21
23
/// Function name.
22
24
pub fn_name : & ' static str ,
23
25
/// Return the unsuffixed version of the function name.
24
- pub base_name : & ' static str ,
26
+ pub base_name_str : & ' static str ,
25
27
/// Source of truth for tests.
26
28
pub basis : CheckBasis ,
27
29
}
28
30
29
31
impl CheckCtx {
30
- pub fn new ( ulp : u32 , fname : & ' static str , basis : CheckBasis ) -> Self {
31
- let base_name = crate :: base_name ( fname) ;
32
- Self { ulp, fn_name : fname, base_name, basis }
32
+ pub fn new ( ulp : u32 , fn_ident : Identifier , basis : CheckBasis ) -> Self {
33
+ Self {
34
+ ulp,
35
+ fn_ident,
36
+ fn_name : fn_ident. as_str ( ) ,
37
+ base_name : fn_ident. base_name ( ) ,
38
+ base_name_str : fn_ident. base_name ( ) . as_str ( ) ,
39
+ basis,
40
+ }
33
41
}
34
42
}
35
43
0 commit comments