From 7f1d78f30479170baa749e179c70e85a62250b0f Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Mon, 17 Feb 2020 00:42:08 +0530 Subject: tests: Ensure that executable and library are named differently On Windows, the basename is used to determine the name of the PDB file. So for a project called myproject, we will create myproject.dll and myproject.exe, both of which will have myproject.pdb. This is a file collision. Instead, append `_test`, similar to the C# template. Fixes AllPlatformTest.test_templates on MSVC. This became a hard error when we started listing PDBs in the implicit outputs list of ninja targets. Do the same for a test that was making the same mistake. --- mesonbuild/templates/objctemplates.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mesonbuild/templates/objctemplates.py') diff --git a/mesonbuild/templates/objctemplates.py b/mesonbuild/templates/objctemplates.py index db89c28..73791f5 100644 --- a/mesonbuild/templates/objctemplates.py +++ b/mesonbuild/templates/objctemplates.py @@ -134,6 +134,7 @@ def create_lib_objc_sample(project_name, version): lowercase_token = re.sub(r'[^a-z0-9]', '_', project_name.lower()) uppercase_token = lowercase_token.upper() function_name = lowercase_token[0:3] + '_func' + test_exe_name = lowercase_token + '_test' lib_h_name = lowercase_token + '.h' lib_objc_name = lowercase_token + '.m' test_objc_name = lowercase_token + '_test.m' @@ -144,7 +145,7 @@ def create_lib_objc_sample(project_name, version): 'header_file': lib_h_name, 'source_file': lib_objc_name, 'test_source_file': test_objc_name, - 'test_exe_name': lowercase_token, + 'test_exe_name': test_exe_name, 'project_name': project_name, 'lib_name': lowercase_token, 'test_name': lowercase_token, -- cgit v1.1