Jean-Alexandre Barszcz pushed to branch dev/errors at Stefan / Typer
Commits: f23283c3 by Jean-Alexandre Barszcz at 2019-08-22T18:13:46Z Print test messages instead of logging them
- - - - -
2 changed files:
- src/eval.ml - src/log.ml
Changes:
===================================== src/eval.ml ===================================== @@ -908,19 +908,27 @@ let array_empty loc depth args_val = match args_val with
let test_fatal loc depth args_val = match args_val with | [Vstring section; Vstring msg] -> - Vcommand (fun () -> Log.log_user_fatal section loc msg) + Vcommand (fun () -> + Log.print_entry + (Log.mkEntry Log.Fatal ~kind:"(Unit test fatal)" ~loc ~section msg); + Log.user_error msg + ) | _ -> error loc "Test.fatal takes two String as argument"
let test_warning loc depth args_val = match args_val with | [Vstring section; Vstring msg] -> - Vcommand (fun () -> Log.log_user_warning section loc msg; - tunit) + Vcommand (fun () -> + Log.print_entry + (Log.mkEntry Log.Warning ~kind:"(Unit test warning)" ~loc ~section msg); + tunit) | _ -> error loc "Test.warning takes two String as argument"
let test_info loc depth args_val = match args_val with | [Vstring section; Vstring msg] -> - Vcommand (fun () -> Log.log_user_info section loc msg; - tunit) + Vcommand (fun () -> + Log.print_entry + (Log.mkEntry Log.Info ~kind:"(Unit test Info)" ~loc ~section msg); + tunit) | _ -> error loc "Test.info takes two String as argument"
let test_location loc depth args_val = match args_val with
===================================== src/log.ml ===================================== @@ -214,11 +214,3 @@ let debug_msg expr = if Debug <= typer_log_config.level then (print_string expr; flush stdout)
let not_implemented_error () = internal_error "not implemented" - -let log_user_fatal section loc msg = - log_msg Fatal ~kind:"(Unit test fatal)" ~section ~loc msg; - user_error msg -let log_user_warning section loc msg = - log_msg Warning ~kind:"(Unit test warning)" ~section ~loc msg -let log_user_info section loc msg = - log_msg Info ~kind:"(Unit test info)" ~section ~loc msg
View it on GitLab: https://gitlab.com/monnier/typer/commit/f23283c36f16d75a505e4cffcb137ababff6...
Afficher les réponses par date