From: Jean Privat Date: Tue, 20 Oct 2015 00:44:25 +0000 (-0400) Subject: loader: print error if bad files given to `scan_full` or `parse_full` X-Git-Tag: v0.7.9~20^2 X-Git-Url: http://nitlanguage.org loader: print error if bad files given to `scan_full` or `parse_full` Signed-off-by: Jean Privat --- 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