summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/cmListFileCache.cxx3
-rw-r--r--Tests/RunCMake/Syntax/CommandEOF-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/CommandEOF-stderr.txt6
-rw-r--r--Tests/RunCMake/Syntax/CommandEOF.cmake1
-rw-r--r--Tests/RunCMake/Syntax/RunCMakeTest.cmake1
5 files changed, 10 insertions, 2 deletions
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index 3c5e33328c..aad538ca6c 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -163,8 +163,7 @@ bool cmListFileParser::ParseFunction(const char* name, long line)
if (!token) {
std::ostringstream error;
/* clang-format off */
- error << "Error in cmake code at\n" << this->FileName << ":"
- << cmListFileLexer_GetCurrentLine(this->Lexer) << ":\n"
+ error << "Unexpected end of file.\n"
<< "Parse error. Function missing opening \"(\".";
/* clang-format on */
this->IssueError(error.str());
diff --git a/Tests/RunCMake/Syntax/CommandEOF-result.txt b/Tests/RunCMake/Syntax/CommandEOF-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CommandEOF-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/CommandEOF-stderr.txt b/Tests/RunCMake/Syntax/CommandEOF-stderr.txt
new file mode 100644
index 0000000000..31cbc08d71
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CommandEOF-stderr.txt
@@ -0,0 +1,6 @@
+^CMake Error in CommandEOF.cmake:
+ Unexpected end of file.
+
+ Parse error. Function missing opening "\(".
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/Syntax/CommandEOF.cmake b/Tests/RunCMake/Syntax/CommandEOF.cmake
new file mode 100644
index 0000000000..36ebb02949
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CommandEOF.cmake
@@ -0,0 +1 @@
+message \ No newline at end of file
diff --git a/Tests/RunCMake/Syntax/RunCMakeTest.cmake b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
index fd012b9c46..d1fbb16aa5 100644
--- a/Tests/RunCMake/Syntax/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
@@ -17,6 +17,7 @@ run_cmake(CommandSpaces)
run_cmake(CommandTabs)
run_cmake(CommandNewlines)
run_cmake(CommandComments)
+run_cmake(CommandEOF)
run_cmake(CommandError0)
run_cmake(CommandError1)
run_cmake(CommandError2)