Skip to content

Commit e8cf3a1

Browse files
authored
gh-91048: Refactor _testexternalinspection and add Windows support (#132852)
1 parent f6fb498 commit e8cf3a1

8 files changed

+1337
-1481
lines changed

Lib/test/test_external_inspection.py

+153-84
Large diffs are not rendered by default.

Modules/_testexternalinspection.c

+216-653
Large diffs are not rendered by default.
+114
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|ARM">
5+
<Configuration>Debug</Configuration>
6+
<Platform>ARM</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Debug|ARM64">
9+
<Configuration>Debug</Configuration>
10+
<Platform>ARM64</Platform>
11+
</ProjectConfiguration>
12+
<ProjectConfiguration Include="Debug|Win32">
13+
<Configuration>Debug</Configuration>
14+
<Platform>Win32</Platform>
15+
</ProjectConfiguration>
16+
<ProjectConfiguration Include="Debug|x64">
17+
<Configuration>Debug</Configuration>
18+
<Platform>x64</Platform>
19+
</ProjectConfiguration>
20+
<ProjectConfiguration Include="PGInstrument|ARM">
21+
<Configuration>PGInstrument</Configuration>
22+
<Platform>ARM</Platform>
23+
</ProjectConfiguration>
24+
<ProjectConfiguration Include="PGInstrument|ARM64">
25+
<Configuration>PGInstrument</Configuration>
26+
<Platform>ARM64</Platform>
27+
</ProjectConfiguration>
28+
<ProjectConfiguration Include="PGInstrument|Win32">
29+
<Configuration>PGInstrument</Configuration>
30+
<Platform>Win32</Platform>
31+
</ProjectConfiguration>
32+
<ProjectConfiguration Include="PGInstrument|x64">
33+
<Configuration>PGInstrument</Configuration>
34+
<Platform>x64</Platform>
35+
</ProjectConfiguration>
36+
<ProjectConfiguration Include="PGUpdate|ARM">
37+
<Configuration>PGUpdate</Configuration>
38+
<Platform>ARM</Platform>
39+
</ProjectConfiguration>
40+
<ProjectConfiguration Include="PGUpdate|ARM64">
41+
<Configuration>PGUpdate</Configuration>
42+
<Platform>ARM64</Platform>
43+
</ProjectConfiguration>
44+
<ProjectConfiguration Include="PGUpdate|Win32">
45+
<Configuration>PGUpdate</Configuration>
46+
<Platform>Win32</Platform>
47+
</ProjectConfiguration>
48+
<ProjectConfiguration Include="PGUpdate|x64">
49+
<Configuration>PGUpdate</Configuration>
50+
<Platform>x64</Platform>
51+
</ProjectConfiguration>
52+
<ProjectConfiguration Include="Release|ARM">
53+
<Configuration>Release</Configuration>
54+
<Platform>ARM</Platform>
55+
</ProjectConfiguration>
56+
<ProjectConfiguration Include="Release|ARM64">
57+
<Configuration>Release</Configuration>
58+
<Platform>ARM64</Platform>
59+
</ProjectConfiguration>
60+
<ProjectConfiguration Include="Release|Win32">
61+
<Configuration>Release</Configuration>
62+
<Platform>Win32</Platform>
63+
</ProjectConfiguration>
64+
<ProjectConfiguration Include="Release|x64">
65+
<Configuration>Release</Configuration>
66+
<Platform>x64</Platform>
67+
</ProjectConfiguration>
68+
</ItemGroup>
69+
<PropertyGroup Label="Globals">
70+
<ProjectGuid>{4D7C112F-3083-4D9E-9754-9341C14D9B39}</ProjectGuid>
71+
<RootNamespace>_testexternalinspection</RootNamespace>
72+
<Keyword>Win32Proj</Keyword>
73+
<SupportPGO>false</SupportPGO>
74+
</PropertyGroup>
75+
<Import Project="python.props" />
76+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
77+
<PropertyGroup Label="Configuration">
78+
<ConfigurationType>DynamicLibrary</ConfigurationType>
79+
<CharacterSet>NotSet</CharacterSet>
80+
</PropertyGroup>
81+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
82+
<PropertyGroup>
83+
<TargetExt>$(PyStdlibPydExt)</TargetExt>
84+
</PropertyGroup>
85+
<ImportGroup Label="ExtensionSettings">
86+
</ImportGroup>
87+
<ImportGroup Label="PropertySheets">
88+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
89+
<Import Project="pyproject.props" />
90+
</ImportGroup>
91+
<PropertyGroup Label="UserMacros" />
92+
<PropertyGroup>
93+
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
94+
</PropertyGroup>
95+
<ItemGroup>
96+
<ClCompile Include="..\Modules\_testexternalinspection.c" />
97+
</ItemGroup>
98+
<ItemGroup>
99+
<ResourceCompile Include="..\PC\python_nt.rc" />
100+
</ItemGroup>
101+
<ItemGroup>
102+
<ProjectReference Include="pythoncore.vcxproj">
103+
<Project>{cf7ac3d1-e2df-41d2-bea6-1e2556cdea26}</Project>
104+
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
105+
</ProjectReference>
106+
<ProjectReference Include="python3dll.vcxproj">
107+
<Project>{885d4898-d08d-4091-9c40-c700cfe3fc5a}</Project>
108+
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
109+
</ProjectReference>
110+
</ItemGroup>
111+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
112+
<ImportGroup Label="ExtensionTargets">
113+
</ImportGroup>
114+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<Filter Include="Source Files">
5+
<UniqueIdentifier>{6d101329-41df-49a0-8639-f35408ad7c6d}</UniqueIdentifier>
6+
</Filter>
7+
<Filter Include="Resource Files">
8+
<UniqueIdentifier>{711941d1-269c-49cb-a733-759b2b91fc61}</UniqueIdentifier>
9+
</Filter>
10+
</ItemGroup>
11+
<ItemGroup>
12+
<ClCompile Include="..\Modules\_testexternalinspection.c" />
13+
</ItemGroup>
14+
<ItemGroup>
15+
<ResourceCompile Include="..\PC\python_nt.rc">
16+
<Filter>Resource Files</Filter>
17+
</ResourceCompile>
18+
</ItemGroup>
19+
</Project>
20+

PCbuild/pcbuild.proj

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
<ExtensionModules Include="@(ExternalModules->'%(Identity)')" Condition="$(IncludeExternals)" />
8080
<Projects Include="@(ExtensionModules->'%(Identity).vcxproj')" Condition="$(IncludeExtensions)" />
8181
<!-- Test modules -->
82-
<TestModules Include="_ctypes_test;_testbuffer;_testcapi;_testlimitedcapi;_testinternalcapi;_testembed;_testimportmultiple;_testmultiphase;_testsinglephase;_testconsole;_testclinic;_testclinic_limited" />
82+
<TestModules Include="_ctypes_test;_testbuffer;_testcapi;_testlimitedcapi;_testexternalinspection;_testinternalcapi;_testembed;_testimportmultiple;_testmultiphase;_testsinglephase;_testconsole;_testclinic;_testclinic_limited" />
8383
<TestModules Include="xxlimited" Condition="'$(Configuration)' == 'Release'" />
8484
<TestModules Include="xxlimited_35" Condition="'$(Configuration)' == 'Release'" />
8585
<Projects Include="@(TestModules->'%(Identity).vcxproj')" Condition="$(IncludeTests)">

PCbuild/pcbuild.sln

+34
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testclinic", "_testclinic.
8181
EndProject
8282
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testinternalcapi", "_testinternalcapi.vcxproj", "{900342D7-516A-4469-B1AD-59A66E49A25F}"
8383
EndProject
84+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testexternalinspection", "_testexternalinspection.vcxproj", "{4D7C112F-3083-4D9E-9754-9341C14D9B39}"
85+
EndProject
8486
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testimportmultiple", "_testimportmultiple.vcxproj", "{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}"
8587
EndProject
8688
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_tkinter", "_tkinter.vcxproj", "{4946ECAC-2E69-4BF8-A90A-F5136F5094DF}"
@@ -1716,6 +1718,38 @@ Global
17161718
{FB91C8B2-6FBC-3A01-B644-1637111F902D}.Release|Win32.Build.0 = Release|Win32
17171719
{FB91C8B2-6FBC-3A01-B644-1637111F902D}.Release|x64.ActiveCfg = Release|x64
17181720
{FB91C8B2-6FBC-3A01-B644-1637111F902D}.Release|x64.Build.0 = Release|x64
1721+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.Debug|ARM.ActiveCfg = Debug|ARM
1722+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.Debug|ARM.Build.0 = Debug|ARM
1723+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.Debug|ARM64.ActiveCfg = Debug|ARM64
1724+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.Debug|ARM64.Build.0 = Debug|ARM64
1725+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.Debug|Win32.ActiveCfg = Debug|Win32
1726+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.Debug|Win32.Build.0 = Debug|Win32
1727+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.Debug|x64.ActiveCfg = Debug|x64
1728+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.Debug|x64.Build.0 = Debug|x64
1729+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.PGInstrument|ARM.ActiveCfg = PGInstrument|ARM
1730+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.PGInstrument|ARM.Build.0 = PGInstrument|ARM
1731+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.PGInstrument|ARM64.ActiveCfg = PGInstrument|ARM64
1732+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.PGInstrument|ARM64.Build.0 = PGInstrument|ARM64
1733+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.PGInstrument|Win32.ActiveCfg = PGInstrument|Win32
1734+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.PGInstrument|Win32.Build.0 = PGInstrument|Win32
1735+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.PGInstrument|x64.ActiveCfg = PGInstrument|x64
1736+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.PGInstrument|x64.Build.0 = PGInstrument|x64
1737+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.PGUpdate|ARM.ActiveCfg = PGUpdate|ARM
1738+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.PGUpdate|ARM.Build.0 = PGUpdate|ARM
1739+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.PGUpdate|ARM64.ActiveCfg = PGUpdate|ARM64
1740+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.PGUpdate|ARM64.Build.0 = PGUpdate|ARM64
1741+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.PGUpdate|Win32.ActiveCfg = PGUpdate|Win32
1742+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.PGUpdate|Win32.Build.0 = PGUpdate|Win32
1743+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.PGUpdate|x64.ActiveCfg = PGUpdate|x64
1744+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.PGUpdate|x64.Build.0 = PGUpdate|x64
1745+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.Release|ARM.ActiveCfg = Release|ARM
1746+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.Release|ARM.Build.0 = Release|ARM
1747+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.Release|ARM64.ActiveCfg = Release|ARM64
1748+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.Release|ARM64.Build.0 = Release|ARM64
1749+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.Release|Win32.ActiveCfg = Release|Win32
1750+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.Release|Win32.Build.0 = Release|Win32
1751+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.Release|x64.ActiveCfg = Release|x64
1752+
{4D7C112F-3083-4D9E-9754-9341C14D9B39}.Release|x64.Build.0 = Release|x64
17191753
EndGlobalSection
17201754
GlobalSection(SolutionProperties) = preSolution
17211755
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)