Give an error message when a JS file does not exist.
authorErik Verbruggen <erik.verbruggen@digia.com>
Tue, 13 Nov 2012 12:44:16 +0000 (13:44 +0100)
committerSimon Hausmann <simon.hausmann@digia.com>
Wed, 14 Nov 2012 07:44:51 +0000 (08:44 +0100)
Instead of silently failing, which is a bit ambiguous in case of test262.

Change-Id: I8b8dc066df63f93273ccc6c27547edfcd1a68cb7
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
main.cpp

index 530757e..8b1b0ac 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -198,6 +198,9 @@ int compileFiles(const QStringList &files, QQmlJS::LLVMOutputType outputType)
             int result = compile(fileName, source, outputType);
             if (result != EXIT_SUCCESS)
                 return result;
+        } else {
+            std::cerr << "Error: cannot open file " << fileName.toUtf8().constData() << std::endl;
+            return EXIT_FAILURE;
         }
     }
     return EXIT_SUCCESS;
@@ -417,6 +420,9 @@ int main(int argc, char *argv[])
                     return exitCode;
                 if (errorInTestHarness)
                     return EXIT_FAILURE;
+            } else {
+                std::cerr << "Error: cannot open file " << fn.toUtf8().constData() << std::endl;
+                return EXIT_FAILURE;
             }
         }
     } return EXIT_SUCCESS;