Skip to content

Commit f59e5d0

Browse files
committed
Added LoadNativeTypeOffsetClass
1 parent f82d963 commit f59e5d0

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

src/embed_tests/Python.EmbeddingTest.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
<None Include="fixtures/**/*.py" CopyToOutputDirectory="PreserveNewest" />
1313
</ItemGroup>
1414

15+
<PropertyGroup>
16+
<DefineConstants>$(DefineConstants);$(ConfiguredConstants)</DefineConstants>
17+
</PropertyGroup>
18+
1519
<ItemGroup>
1620
<PackageReference Include="NUnit" Version="3.*" />
1721
<PackageReference Include="NUnit3TestAdapter" Version="3.*">
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Reflection;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
8+
using NUnit.Framework;
9+
10+
namespace Python.EmbeddingPythonTest
11+
{
12+
public class TestNativeTypeOffset
13+
{
14+
#if WINDOWS
15+
// The code for NativeTypeOffset is not generated under Windows because sys.abiflags does not exist (see setup.py)
16+
#else
17+
/// <summary>
18+
/// Tests that installation has generated code for NativeTypeOffset and that it can be loaded.
19+
/// </summary>
20+
[Test]
21+
public void LoadNativeTypeOffsetClass()
22+
{
23+
new Python.Runtime.NativeTypeOffset();
24+
}
25+
#endif
26+
}
27+
}

0 commit comments

Comments
 (0)