#[ allow( unused_imports ) ]
use super :: *;
#[ test_tools ::nightly ]
#[ test ]
fn trybuild_tests()
{
println!("current_dir: {:?}", std ::env ::current_dir().unwrap());
let t = test_tools ::compiletime ::TestCases ::new();
let current_dir_base = std ::env ::current_dir().expect("Could not get current directory");
fn find_workspace_root(start_path: &std ::path ::Path) -> Option< &std ::path ::Path >
{
start_path.ancestors().find(|path|
{
let cargo_toml = path.join("Cargo.toml");
if !cargo_toml.exists() { return false; }
if let Ok(contents) = std ::fs ::read_to_string(&cargo_toml)
{
contents.contains("[workspace]")
}
else
{
false
}
})
}
let workspace_root = find_workspace_root(¤t_dir_base).expect("Could not find workspace root");
let current_dir = workspace_root.join("module/core/mod_interface");
t.pass(current_dir.join("tests/inc/derive/micro_modules/trybuild.rs"));
t.pass(current_dir.join("tests/inc/derive/micro_modules_two/trybuild.rs"));
t.pass(current_dir.join("tests/inc/derive/micro_modules_two_joined/trybuild.rs"));
t.pass(current_dir.join("tests/inc/derive/layer/trybuild.rs"));
t.pass(current_dir.join("tests/inc/derive/layer_have_layer/trybuild.rs"));
t.pass(current_dir.join("tests/inc/derive/layer_have_layer_separate_use/trybuild.rs"));
t.pass(current_dir.join("tests/inc/derive/layer_have_layer_separate_use_two/trybuild.rs"));
t.pass(current_dir.join("tests/inc/derive/layer_have_layer_cfg/trybuild.rs"));
t.pass(current_dir.join("tests/inc/derive/layer_use_cfg/trybuild.rs"));
t.pass(current_dir.join("tests/inc/derive/layer_have_mod_cfg/trybuild.rs"));
t.pass(current_dir.join("tests/inc/derive/layer_use_macro/trybuild.rs"));
t.pass(current_dir.join("tests/inc/derive/use_basic/trybuild.rs"));
t.pass(current_dir.join("tests/inc/derive/use_layer/trybuild.rs"));
t.pass(current_dir.join("tests/inc/derive/use_as/trybuild.rs"));
t.pass(current_dir.join("tests/inc/derive/attr_debug/trybuild.rs"));
}
use crate ::only_for_terminal_module;
only_for_terminal_module! {
#[ test_tools ::nightly ]
#[ test ]
fn cta_trybuild_tests()
{
use test_tools ::dependency ::trybuild;
println!( "current_dir: {:?}", std ::env ::current_dir().unwrap() );
let t = test_tools ::compiletime ::TestCases ::new();
let current_dir_base = std ::env ::current_dir().expect( "Could not get current directory" );
fn find_workspace_root( start_path: &std ::path ::Path ) -> Option< &std ::path ::Path >
{
start_path.ancestors().find( |path|
{
let cargo_toml = path.join( "Cargo.toml" );
if !cargo_toml.exists() { return false; }
if let Ok( contents ) = std ::fs ::read_to_string( &cargo_toml )
{
contents.contains( "[workspace]" )
}
else
{
false
}
} )
}
let workspace_root = find_workspace_root( ¤t_dir_base ).expect( "Could not find workspace root" );
let current_dir = workspace_root.join( "module/core/mod_interface" );
t.compile_fail( current_dir.join( "tests/inc/derive/micro_modules_bad_vis/trybuild.rs" ) );
t.compile_fail( current_dir.join( "tests/inc/derive/micro_modules_unknown_vis/trybuild.rs" ) );
t.compile_fail( current_dir.join( "tests/inc/derive/layer_bad_vis/trybuild.rs" ) );
t.compile_fail( current_dir.join( "tests/inc/derive/layer_unknown_vis/trybuild.rs" ) );
t.compile_fail( current_dir.join( "tests/inc/derive/use_bad_vis/trybuild.rs" ) );
t.compile_fail( current_dir.join( "tests/inc/derive/use_unknown_vis/trybuild.rs" ) );
}
}