@@ -5,7 +5,8 @@ use std::path::PathBuf;
55use std:: { fs, path:: Path } ;
66use walkdir:: WalkDir ;
77
8- use crate :: commands:: { run, BuildArgs , Logging , RunArgs } ;
8+ use crate :: commands:: run:: run_inner;
9+ use crate :: commands:: { BuildArgs , Logging , RunArgs } ;
910
1011// Colors for output
1112const GREEN : & str = "\x1b [0;32m" ;
@@ -25,6 +26,7 @@ pub struct TestArgs {
2526#[ derive( Debug ) ]
2627struct TestResult {
2728 name : String ,
29+ message : String ,
2830 success : bool ,
2931 error_message : Option < String > ,
3032}
@@ -54,7 +56,7 @@ pub fn test(args: TestArgs) -> Result<()> {
5456 let result = run_single_test ( & file_path, & test_func, & test_name, & args) ?;
5557
5658 if result. success {
57- println ! ( "{}ok{}" , GREEN , NC ) ;
59+ println ! ( "{}ok{} ({}) " , GREEN , NC , result . message ) ;
5860 passed_tests += 1 ;
5961 } else {
6062 println ! ( "{}err{}" , RED , NC ) ;
@@ -210,14 +212,16 @@ fn run_single_test(
210212 run_args. build . entrypoint = temp_file;
211213
212214 // Call run function directly
213- match run ( run_args) {
214- Ok ( _ ) => Ok ( TestResult {
215+ match run_inner ( run_args) {
216+ Ok ( res ) => Ok ( TestResult {
215217 name : test_name. to_string ( ) ,
218+ message : res. to_lowercase ( ) ,
216219 success : true ,
217220 error_message : None ,
218221 } ) ,
219222 Err ( e) => Ok ( TestResult {
220223 name : test_name. to_string ( ) ,
224+ message : e. to_string ( ) ,
221225 success : false ,
222226 // Use pretty Display with full context chain
223227 error_message : Some ( format ! ( "{:#}" , e) ) ,
0 commit comments