Skip to content

Commit 5d12bda

Browse files
committed
add test for missing project file in folder
1 parent 65183fc commit 5d12bda

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

test/cli/project_test.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,26 @@ def test_slnx_project_file_not_found(tmpdir):
179179
__test_project_error(tmpdir, "slnx", content, expected)
180180

181181

182+
def test_slnx_project_file_in_folder_not_found(tmpdir):
183+
content = '<?xml version="1.0" encoding="UTF-8"?>\r\n' \
184+
"<Solution>\r\n" \
185+
" <Configurations>\r\n" \
186+
' <Platform Name="x64" />\r\n' \
187+
' <Platform Name="x86" />\r\n' \
188+
" </Configurations>\r\n" \
189+
' <Folder Name="/common/">\r\n' \
190+
' <Project Path="common/test.vcxproj" />\r\n' \
191+
' </Folder>\r\n' \
192+
"</Solution>\r\n"
193+
194+
expected = "Visual Studio project file is not a valid XML - XML_ERROR_FILE_NOT_FOUND\n" \
195+
"cppcheck: error: failed to load '{}' from Visual Studio solution".format(os.path.join(tmpdir, "common/test.vcxproj"))
196+
if sys.platform == "win32":
197+
expected = expected.replace('\\', '/')
198+
199+
__test_project_error(tmpdir, "slnx", content, expected)
200+
201+
182202
def test_vcxproj_no_xml_root(tmpdir):
183203
content = '<?xml version="1.0" encoding="utf-8"?>'
184204

0 commit comments

Comments
 (0)