Skip to content

Commit fa4a368

Browse files
committed
forgot tests
1 parent 12f8efa commit fa4a368

98 files changed

Lines changed: 2448 additions & 29 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

test/cli/props-dirs/ProjA/ProjA.vcxproj

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<ItemGroup Label="ProjectConfigurations">
4-
<ProjectConfiguration Include="Debug|x64">
5-
<Configuration>Debug</Configuration>
6-
<Platform>x64</Platform>
7-
</ProjectConfiguration>
8-
</ItemGroup>
93
<PropertyGroup Label="Globals">
104
<ProjectGuid>{a1a1a1a1-a1a1-a1a1-a1a1-a1a1a1a1a1a1}</ProjectGuid>
115
<RootNamespace>ProjA</RootNamespace>
@@ -19,6 +13,7 @@
1913
<!-- Pulls in shared/shared.props, which itself pulls in common/common.props -->
2014
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
2115
<Import Project="$(MSBuildThisFileDirectory)..\shared\shared.props" />
16+
<Import Project="..\shared\shared2.props" />
2217
</ImportGroup>
2318
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
2419
<ClCompile>

test/cli/props-dirs/ProjA/a.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
#include "common.h"
2+
#include "common2.h"
23

34
#ifndef COMMON_H_INCLUDED_MARKER
45
#error "common.h was not found - AdditionalIncludeDirectories from common.props did not resolve"
56
#endif
7+
#ifndef COMMON2_H_INCLUDED_MARKER
8+
#error "common2.h was not found - AdditionalIncludeDirectories from common.props did not resolve"
9+
#endif
610

711
int main()
812
{

test/cli/props-dirs/ProjB/ProjB.vcxproj

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<ItemGroup Label="ProjectConfigurations">
4-
<ProjectConfiguration Include="Debug|x64">
5-
<Configuration>Debug</Configuration>
6-
<Platform>x64</Platform>
7-
</ProjectConfiguration>
8-
</ItemGroup>
93
<PropertyGroup Label="Globals">
104
<ProjectGuid>{b2b2b2b2-b2b2-b2b2-b2b2-b2b2b2b2b2b2}</ProjectGuid>
115
<RootNamespace>ProjB</RootNamespace>
@@ -21,6 +15,7 @@
2115
in the same solution (regression coverage for the mVariables cross-project leak). -->
2216
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
2317
<Import Project="$(MSBuildThisFileDirectory)..\common\common.props" />
18+
<Import Project="..\common\common2.props" />
2419
</ImportGroup>
2520
<ItemGroup>
2621
<ClCompile Include="b.cpp" />

test/cli/props-dirs/ProjB/b.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
#include "common.h"
2+
#include "common2.h"
23

34
#ifndef COMMON_H_INCLUDED_MARKER
45
#error "common.h was not found - AdditionalIncludeDirectories from common.props did not resolve"
56
#endif
7+
#ifndef COMMON2_H_INCLUDED_MARKER
8+
#error "common2.h was not found - AdditionalIncludeDirectories from common.props did not resolve"
9+
#endif
610

711
int main()
812
{
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#ifndef COMMON2_H_INCLUDED_MARKER
2+
#define COMMON2_H_INCLUDED_MARKER
3+
#endif
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<!-- Imported from both ProjA (indirectly, via shared/shared.props) and ProjB (directly).
4+
AdditionalIncludeDirectories uses $(MSBuildThisFileDirectory) to prove it resolves to
5+
this file's own directory (common/) rather than to whichever project imported it. -->
6+
<ItemDefinitionGroup>
7+
<ClCompile>
8+
<PreprocessorDefinitions>COMMON2_DEFINE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
9+
<AdditionalIncludeDirectories>$(MSBuildThisFileDirectory);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
10+
<LanguageStandard>stdcpp17</LanguageStandard>
11+
</ClCompile>
12+
</ItemDefinitionGroup>
13+
</Project>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<!-- Only imported by ProjA. Chains into common/common.props via a relative,
4+
$(MSBuildThisFileDirectory)-based path - this is the cross-directory nested
5+
props-importing-props case (ProjA/ -> shared/ -> common/). -->
6+
<ImportGroup Label="PropertySheets">
7+
<Import Project="$(MSBuildThisFileDirectory)..\common\common2.props" />
8+
</ImportGroup>
9+
<ItemDefinitionGroup>
10+
<ClCompile>
11+
<PreprocessorDefinitions>SHARED2_DEFINE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
12+
</ClCompile>
13+
</ItemDefinitionGroup>
14+
</Project>

test/cli/props_dirs_test.py

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818

1919
__script_dir = os.path.dirname(os.path.abspath(__file__))
2020

21-
__ERR_A = ('%s:10:14: error: Division by zero. [zerodiv]\n'
21+
__ERR_A = ('%s:14:14: error: Division by zero. [zerodiv]\n'
2222
' return x / 0;\n'
2323
' ^\n') % os.path.join('props-dirs', 'ProjA', 'a.cpp')
24-
__ERR_B = ('%s:10:14: error: Division by zero. [zerodiv]\n'
24+
__ERR_B = ('%s:14:14: error: Division by zero. [zerodiv]\n'
2525
' return y / 0;\n'
2626
' ^\n') % os.path.join('props-dirs', 'ProjB', 'b.cpp')
2727

@@ -65,14 +65,29 @@ def test_props_dirs_defines_and_standard():
6565
with open(dump_b, 'rt') as f:
6666
dump_b_content = f.read()
6767

68-
# ProjA imports shared/shared.props (which itself imports common/common.props), and
69-
# also sets its own PROJA_DEFINE - all three must be present, most specific first
70-
assert 'cfg="_WIN32=1;_WIN64=1;PROJA_DEFINE=1;SHARED_DEFINE=1;COMMON_DEFINE=1;_MSC_VER=1900"' in dump_a_content
68+
# ProjA imports shared/shared.props (-> common/common.props) and shared/shared2.props
69+
# (-> common/common2.props), and sets its own PROJA_DEFINE.
70+
# v143 toolset -> _MSC_VER=1930/_MSC_FULL_VER=193000000; common.props sets stdcpp17
71+
# -> _MSVC_LANG=201703L.
72+
assert '_WIN32=1' in dump_a_content
73+
assert '_WIN64=1' in dump_a_content
74+
assert '_M_X64=100' in dump_a_content
75+
assert '_MSC_VER=1930' in dump_a_content
76+
assert '_MSC_FULL_VER=193000000' in dump_a_content
77+
assert '_MSVC_LANG=201703L' in dump_a_content
78+
assert 'PROJA_DEFINE=1' in dump_a_content
79+
assert 'SHARED_DEFINE=1' in dump_a_content
80+
assert 'COMMON_DEFINE=1' in dump_a_content
7181
assert '<cpp version="c++17"/>' in dump_a_content
7282

73-
# ProjB imports common/common.props directly - it must see COMMON_DEFINE, but neither
74-
# PROJA_DEFINE nor SHARED_DEFINE, which only ever applied to ProjA
75-
assert 'cfg="_WIN32=1;_WIN64=1;COMMON_DEFINE=1;_MSC_VER=1900"' in dump_b_content
83+
# ProjB imports common/common.props and common/common2.props directly - it must see
84+
# COMMON2_DEFINE and COMMON_DEFINE, but none of ProjA's or shared's defines.
85+
assert '_MSC_VER=1930' in dump_b_content
86+
assert '_MSC_FULL_VER=193000000' in dump_b_content
87+
assert '_MSVC_LANG=201703L' in dump_b_content
88+
assert 'COMMON2_DEFINE=1' in dump_b_content
89+
assert 'COMMON_DEFINE=1' in dump_b_content
7690
assert '<cpp version="c++17"/>' in dump_b_content
7791
assert 'PROJA_DEFINE' not in dump_b_content
7892
assert 'SHARED_DEFINE' not in dump_b_content
93+
assert 'SHARED2_DEFINE' not in dump_b_content

test/cli/slnx-folders/slnx-folders.slnx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
<Configurations>
33
<Platform Name="x64" />
44
</Configurations>
5-
<Folder Name="/Lib/">
6-
<File Path="lib/lib.h" />
7-
<Project Path="lib\lib.vcxproj" />
8-
</Folder>
9-
<Folder Name="/App/">
10-
<Project Path="app\app.vcxproj" Id="0de77c38-881a-4f9f-bdfa-2c429968985e" />
5+
<Folder Name="ParentFolder">
6+
<Folder Name="/Lib/">
7+
<File Path="lib/lib.h" />
8+
<Project Path="lib\lib.vcxproj" />
9+
</Folder>
10+
<Folder Name="/App/">
11+
<Project Path="app\app.vcxproj" Id="0de77c38-881a-4f9f-bdfa-2c429968985e" />
12+
</Folder>
1113
</Folder>
1214
</Solution>

test/cli/vcxproj-unicode/vcxproj_unicode.vcxproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
<Configuration>Release</Configuration>
1010
<Platform>Win32</Platform>
1111
</ProjectConfiguration>
12+
<ProjectConfiguration Include="MultiByte|Win32">
13+
<Configuration>MultiByte</Configuration>
14+
<Platform>Win32</Platform>
15+
</ProjectConfiguration>
1216
</ItemGroup>
1317
<PropertyGroup Label="Configuration">
1418
<!-- Only to test that the last configuration entry overwrites this -->
@@ -27,6 +31,12 @@
2731
<CharacterSet>NotSet</CharacterSet>
2832
<UseOfMfc>Static</UseOfMfc>
2933
</PropertyGroup>
34+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MultiByte|Win32'" Label="Configuration">
35+
<ConfigurationType>Application</ConfigurationType>
36+
<UseDebugLibraries>false</UseDebugLibraries>
37+
<PlatformToolset>v143</PlatformToolset>
38+
<CharacterSet>MultiByte</CharacterSet>
39+
</PropertyGroup>
3040
<ItemGroup>
3141
<ClCompile Include="main.cpp" />
3242
</ItemGroup>

0 commit comments

Comments
 (0)