From: Jean Privat Date: Wed, 21 Oct 2015 01:10:02 +0000 (-0400) Subject: Merge: loader: print error if bad files given to `scan_full` or `parse_full` X-Git-Tag: v0.7.9~20 X-Git-Url: http://nitlanguage.org?hp=f5dc56a0d56abd7bd690eb3db8d50bbde1053228 Merge: loader: print error if bad files given to `scan_full` or `parse_full` The last series (#1750 ) removed then silently. A test is also added to avoid regression. Pull-Request: #1773 Reviewed-by: Alexis Laferrière --- diff --git a/src/loader.nit b/src/loader.nit index aa88cdc..9b79c62 100644 --- a/src/loader.nit +++ b/src/loader.nit @@ -152,6 +152,11 @@ redef class ModelBuilder var mmodule = identify_module(a) if mmodule == null then + if a.file_exists then + toolcontext.error(null, "Error: `{a}` is not a Nit source file.") + else + toolcontext.error(null, "Error: cannot find module `{a}`.") + end continue end diff --git a/tests/sav/test_test_phase_args2.res b/tests/sav/test_test_phase_args2.res new file mode 100644 index 0000000..729ac10 --- /dev/null +++ b/tests/sav/test_test_phase_args2.res @@ -0,0 +1,3 @@ +Error: cannot find module `fail.nit`. +Error: `README.md` is not a Nit source file. +Errors: 2. Warnings: 0. diff --git a/tests/test_test_phase.args b/tests/test_test_phase.args index 5f3aa2c..7409ad5 100644 --- a/tests/test_test_phase.args +++ b/tests/test_test_phase.args @@ -1 +1,2 @@ base_simple3.nit +fail.nit base_simple3.nit README.md