Skip to content

Commit

Permalink
Merge branch 'alpha' of github.com:Wandalen/wTools into alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
Wandalen committed Mar 20, 2024
2 parents 7c9de94 + 67c7755 commit 6b98e67
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// xxx : need to fix
// #[ derive( Former ) ]
// struct Foo
// {
// #[ cfg( feature = "baz" ) ]
// bar : i32,
// }

// error => Unknown attribute #[cfg(feature = "baz")]
29 changes: 24 additions & 5 deletions module/move/willbe/src/entity/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ mod private
// qqq : for Petro : don't do micro imports
#[ cfg( feature = "progress_bar" ) ]
use indicatif::{ MultiProgress, ProgressBar, ProgressStyle };
use prettytable::format::{ FormatBuilder, TableFormat };
use rayon::ThreadPoolBuilder;
use process_tools::process::*;
use wtools::error::anyhow::{ Error, format_err };
Expand Down Expand Up @@ -146,14 +147,15 @@ mod private
{
writeln!( f, "Package : {}\nThe tests will be executed using the following configurations :", self.package.file_name().unwrap().to_string_lossy() )?;
let mut table = Table::new();
table.set_format( *prettytable::format::consts::FORMAT_NO_BORDER );
let format = format();
table.set_format( format );
let mut all_features = BTreeSet::new();
for variant in &self.test_variants
{
let features = variant.features.iter().cloned();
if features.len() == 0
{
all_features.extend( [ "[ ]".to_string() ] );
all_features.extend( [ "[]".to_string() ] );
}
all_features.extend( features );
}
Expand All @@ -164,7 +166,7 @@ mod private
{
header_row.add_cell( Cell::new( feature ) );
}
table.add_row( header_row );
table.set_titles( header_row );

for variant in &self.test_variants
{
Expand Down Expand Up @@ -268,6 +270,21 @@ mod private
}
}

fn format() -> TableFormat
{
let format = FormatBuilder::new()
.column_separator( ' ' )
.borders( ' ' )
.separators
(
&[ prettytable::format::LinePosition::Title ],
prettytable::format::LineSeparator::new( '-', '+', '+', '+' )
)
.padding( 1, 1 )
.build();
format
}

#[ derive( Debug, Former ) ]
pub struct PackageTestOptions< 'a >
{
Expand Down Expand Up @@ -490,14 +507,16 @@ mod private
return Ok( () )
}
let mut table = Table::new();
let format = format();
table.set_format( format );
table.set_format( *prettytable::format::consts::FORMAT_NO_BORDER );
let mut all_features = BTreeSet::new();
for variant in self.tests.keys()
{
let features = variant.features.iter().cloned();
if features.len() == 0
{
all_features.extend( [ "[ ]".to_string() ] );
all_features.extend( [ "[]".to_string() ] );
}
all_features.extend( features );
}
Expand All @@ -509,7 +528,7 @@ mod private
{
header_row.add_cell( Cell::new( feature ) );
}
table.add_row( header_row );
table.set_titles( header_row );

let mut failed = 0;
let mut success = 0;
Expand Down

0 comments on commit 6b98e67

Please sign in to comment.