Skip to content

Commit 36c2e85

Browse files
author
dse
committed
DotNetCore + Windows x64 + Python 3.5 = all tests passed.
1 parent 26966d3 commit 36c2e85

File tree

4 files changed

+39
-5
lines changed

4 files changed

+39
-5
lines changed

src/embed_tests/Program.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System;
2+
using System.Reflection;
3+
using NUnit.Common;
4+
using NUnitLite;
5+
6+
namespace Python.EmbeddingTest
7+
{
8+
public class Program
9+
{
10+
public static int Main(string[] args)
11+
{
12+
////var example = new TestExample();
13+
////example.SetUp();
14+
////example.TestReadme();
15+
////example.Dispose();
16+
////return 0;
17+
return new AutoRun(typeof(Program).GetTypeInfo().Assembly)
18+
.Execute(args, new ExtendedTextWrapper(Console.Out), Console.In);
19+
}
20+
}
21+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"profiles": {
3+
"Python.EmbeddingTest.15": {
4+
"commandName": "Project"
5+
}
6+
}
7+
}

src/embed_tests/Python.EmbeddingTest.15.csproj

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net40;netstandard1.6</TargetFrameworks>
4-
<!--<PackageTargetFallback>net</PackageTarg0etFallback>-->
3+
<OutputType>exe</OutputType>
4+
<TargetFrameworks><!--net40;-->netcoreapp1.0</TargetFrameworks>
5+
<RuntimeIdentifiers>win7-x64;ubuntu.16.04-x64</RuntimeIdentifiers>
56
<RootNamespace>Python.EmbeddingTest</RootNamespace>
67
<AssemblyName>Python.EmbeddingTest</AssemblyName>
78
<PackageId>Python.EmbeddingTest</PackageId>
@@ -12,6 +13,7 @@
1213
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
1314
<!--<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>-->
1415
<NetStandardImplicitPackageVersion>1.6.0</NetStandardImplicitPackageVersion>
16+
<!--This is for NUnit Test Adaptor crash workaround.-->
1517
<DebugType>Full</DebugType>
1618
</PropertyGroup>
1719
<PropertyGroup Condition=" '$(Platform)' == 'x86'">
@@ -25,9 +27,9 @@
2527

2628
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net40|x64'" />
2729

28-
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netstandard1.6|x64'" />
30+
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|netcoreapp1.0|x64'" />
2931

30-
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netstandard1.6|x64'" />
32+
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netcoreapp1.0|x64'" />
3133

3234
<PropertyGroup>
3335
<DefineConstants>$(DefineConstants);XPLAT</DefineConstants>
@@ -37,6 +39,7 @@
3739
<PackageReference Include="NUnit">
3840
<Version>3.6.1</Version>
3941
</PackageReference>
42+
<PackageReference Include="NUnitLite" Version="3.6.1" />
4043
</ItemGroup>
4144

4245
<ItemGroup>

src/runtime/importhook.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Runtime.InteropServices;
33

44
namespace Python.Runtime
@@ -75,7 +75,10 @@ internal static void Shutdown()
7575
if (Runtime.Py_IsInitialized() != 0)
7676
{
7777
Runtime.XDecref(py_clr_module);
78+
// TODO: Very strange behavior under CoreCLR. System.ExecutionEngineException (Crash)
79+
#if !NETSTANDARD1_5
7880
Runtime.XDecref(root.pyHandle);
81+
#endif
7982
Runtime.XDecref(py_import);
8083
}
8184
}

0 commit comments

Comments
 (0)