@@ -2030,8 +2030,6 @@ pub mod test {
2030
2030
}
2031
2031
2032
2032
#[ test]
2033
- // doesn't work in the rust-lang/rust repo, enable on CI
2034
- #[ cfg_attr( not( enable_tooltip_tests) , ignore) ]
2035
2033
fn test_tooltip ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
2036
2034
use self :: test:: { LineOutput , Test , TooltipTestHarness } ;
2037
2035
use std:: env;
@@ -2090,6 +2088,43 @@ pub mod test {
2090
2088
Test :: new( "test_tooltip_mod_use_external.rs" , 12 , 12 ) ,
2091
2089
Test :: new( "test_tooltip_mod_use_external.rs" , 14 , 12 ) ,
2092
2090
Test :: new( "test_tooltip_mod_use_external.rs" , 15 , 12 ) ,
2091
+ ] ;
2092
+
2093
+ let cwd = env:: current_dir ( ) ?;
2094
+ let out = LineOutput :: default ( ) ;
2095
+ let proj_dir = cwd. join ( "test_data" ) . join ( "hover" ) ;
2096
+ let save_dir = cwd
2097
+ . join ( "target" )
2098
+ . join ( "tests" )
2099
+ . join ( "hover" )
2100
+ . join ( "save_data" ) ;
2101
+ let load_dir = proj_dir. join ( "save_data" ) ;
2102
+
2103
+ let harness = TooltipTestHarness :: new ( proj_dir, & out) ;
2104
+
2105
+ out. reset ( ) ;
2106
+
2107
+ let failures = harness. run_tests ( & tests, load_dir, save_dir) ?;
2108
+
2109
+ if failures. is_empty ( ) {
2110
+ Ok ( ( ) )
2111
+ } else {
2112
+ eprintln ! ( "{}\n \n " , out. reset( ) . join( "\n " ) ) ;
2113
+ eprintln ! ( "{:#?}\n \n " , failures) ;
2114
+ Err ( format ! ( "{} of {} tooltip tests failed" , failures. len( ) , tests. len( ) ) . into ( ) )
2115
+ }
2116
+ }
2117
+
2118
+ /// Note: This test is ignored as it doesn't work in the rust-lang/rust repo.
2119
+ /// It is enabled on CI.
2120
+ /// Run with `cargo test test_tooltip_std -- --ignored`
2121
+ #[ test]
2122
+ #[ ignore]
2123
+ fn test_tooltip_std ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
2124
+ use self :: test:: { LineOutput , Test , TooltipTestHarness } ;
2125
+ use std:: env;
2126
+
2127
+ let tests = vec ! [
2093
2128
Test :: new( "test_tooltip_std.rs" , 18 , 15 ) ,
2094
2129
Test :: new( "test_tooltip_std.rs" , 18 , 27 ) ,
2095
2130
Test :: new( "test_tooltip_std.rs" , 19 , 7 ) ,
0 commit comments