Skip to content

Commit 34c2744

Browse files
authored
Merge branch 'master' into losttech-perf-interop
2 parents 3ecccf3 + 770fc01 commit 34c2744

23 files changed

+180
-35
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ install:
4444

4545
script:
4646
- python -m pytest
47-
- $RUN_TESTS src/embed_tests/bin/$EMBED_TESTS_PATH/Python.EmbeddingTest.dll
47+
- $RUN_TESTS src/embed_tests/bin/$EMBED_TESTS_PATH/Python.EmbeddingTest.dll --labels=All
4848
# does not work on Linux, because NuGet package for 2.3 is Windows only
4949
# - "if [[ $TRAVIS_PYTHON_VERSION == '3.5' && $PERF_TESTS_PATH != '' ]]; then mono $NUNIT_PATH src/perf_tests/bin/$PERF_TESTS_PATH/Python.PerformanceTests.dll; fi"
5050

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
- Alex Earl ([@slide](https://github.com/slide))
1616
- Alex Helms ([@alexhelms](https://github.com/alexhelms))
1717
- Alexandre Catarino([@AlexCatarino](https://github.com/AlexCatarino))
18+
- Andrey Sant'Anna ([@andreydani](https://github.com/andreydani))
1819
- Arvid JB ([@ArvidJB](https://github.com/ArvidJB))
1920
- Benoît Hudson ([@benoithudson](https://github.com/benoithudson))
2021
- Bradley Friedman ([@leith-bartrich](https://github.com/leith-bartrich))

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
3030
together with Nuitka
3131
- Fixes bug where delegates get casts (dotnetcore)
3232
- Determine size of interpreter longs at runtime
33+
- Handling exceptions ocurred in ModuleObject's getattribute
3334

3435
## [2.4.0][]
3536

ci/appveyor_run_tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ if ($PYTHON_STATUS -ne 0) {
5555
# Run Embedded tests with C# coverage
5656
Write-Host ("Starting embedded tests") -ForegroundColor "Green"
5757
.$OPENCOVER -register:user -searchdirs:"$RUNTIME_DIR" -output:cs.coverage `
58-
-target:"$CS_RUNNER" -targetargs:"$CS_TESTS" `
58+
-target:"$CS_RUNNER" -targetargs:"$CS_TESTS --labels=All" `
5959
-filter:"+[*]Python.Runtime*" `
6060
-returntargetcode
6161
$CS_STATUS = $LastExitCode

src/embed_tests/Python.EmbeddingTest.15.csproj

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,16 @@
7777

7878

7979
<ItemGroup>
80-
<PackageReference Include="NUnit" Version="3.7.1" />
81-
<PackageReference Include="NUnit.ConsoleRunner" Version="3.7.0" />
82-
<PackageReference Include="NUnit3TestAdapter" Version="3.8.0" />
83-
<PackageReference Include="NUnitLite" Version="3.7.2" />
80+
<PackageReference Include="NUnit" Version="3.12.0" />
81+
<PackageReference Include="NUnit.ConsoleRunner" Version="3.11.1" />
82+
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1">
83+
<PrivateAssets>all</PrivateAssets>
84+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
85+
</PackageReference>
86+
<PackageReference Include="NUnitLite" Version="3.12.0" />
8487
</ItemGroup>
8588
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
86-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
89+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
8790
</ItemGroup>
8891
<ItemGroup>
8992
<ProjectReference Include="..\runtime\Python.Runtime.15.csproj" />

src/embed_tests/Python.EmbeddingTest.csproj

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@
7070
</PropertyGroup>
7171
<ItemGroup>
7272
<Reference Include="Microsoft.CSharp" />
73-
<Reference Include="nunit.framework, Version=3.7.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
74-
<HintPath>..\..\packages\NUnit.3.7.1\lib\net40\nunit.framework.dll</HintPath>
73+
<Reference Include="nunit.framework, Version=3.12.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
74+
<HintPath>..\..\packages\NUnit.3.12.0\lib\net40\nunit.framework.dll</HintPath>
7575
</Reference>
7676
<Reference Include="System" />
7777
</ItemGroup>
@@ -126,4 +126,10 @@
126126
<Copy SourceFiles="$(TargetAssembly)" DestinationFolder="$(PythonBuildDir)" />
127127
<!--Copy SourceFiles="$(TargetAssemblyPdb)" Condition="Exists('$(TargetAssemblyPdb)')" DestinationFolder="$(PythonBuildDir)" /-->
128128
</Target>
129+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
130+
<PropertyGroup>
131+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
132+
</PropertyGroup>
133+
<Error Condition="!Exists('..\..\packages\NUnit.3.12.0\build\NUnit.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\NUnit.3.12.0\build\NUnit.props'))" />
134+
</Target>
129135
</Project>

src/embed_tests/TestRuntime.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections.Generic;
23
using NUnit.Framework;
34
using Python.Runtime;
45
using Python.Runtime.Platform;
@@ -110,9 +111,15 @@ public static void PyCheck_Iter_PyObject_IsIterable_ThreadingLock_Test()
110111
// Create an instance of threading.Lock, which is one of the very few types that does not have the
111112
// TypeFlags.HaveIter set in Python 2. This tests a different code path in PyObject_IsIterable and PyIter_Check.
112113
var threading = Runtime.Runtime.PyImport_ImportModule("threading");
114+
Exceptions.ErrorCheck(threading);
113115
var threadingDict = Runtime.Runtime.PyModule_GetDict(threading);
116+
Exceptions.ErrorCheck(threadingDict);
114117
var lockType = Runtime.Runtime.PyDict_GetItemString(threadingDict, "Lock");
118+
if (lockType == IntPtr.Zero)
119+
throw new KeyNotFoundException("class 'Lock' was not found in 'threading'");
120+
115121
var lockInstance = Runtime.Runtime.PyObject_CallObject(lockType, Runtime.Runtime.PyTuple_New(0));
122+
Exceptions.ErrorCheck(lockInstance);
116123

117124
Assert.IsFalse(Runtime.Runtime.PyObject_IsIterable(lockInstance));
118125
Assert.IsFalse(Runtime.Runtime.PyIter_Check(lockInstance));

src/embed_tests/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="NUnit" version="3.7.1" targetFramework="net40" />
4-
<package id="NUnit.ConsoleRunner" version="3.7.0" targetFramework="net40" />
3+
<package id="NUnit" version="3.12.0" targetFramework="net40" />
4+
<package id="NUnit.ConsoleRunner" version="3.11.1" targetFramework="net40" />
55
</packages>

src/perf_tests/BaselineComparisonConfig.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
using BenchmarkDotNet.Configs;
77
using BenchmarkDotNet.Jobs;
8+
using BenchmarkDotNet.Horology;
89

910
namespace Python.PerformanceTests
1011
{
@@ -18,7 +19,11 @@ public BaselineComparisonConfig()
1819

1920
string deploymentRoot = BenchmarkTests.DeploymentRoot;
2021

21-
var baseJob = Job.Default;
22+
var baseJob = Job.Default
23+
.WithLaunchCount(1)
24+
.WithWarmupCount(3)
25+
.WithMaxIterationCount(100)
26+
.WithIterationTime(TimeInterval.FromMilliseconds(100));
2227
this.Add(baseJob
2328
.WithId("baseline")
2429
.WithEnvironmentVariable(EnvironmentVariableName,

src/perf_tests/Python.PerformanceTests.csproj

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,17 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="BenchmarkDotNet" Version="0.11.5" />
14+
<PackageReference Include="BenchmarkDotNet" Version="0.12.0" />
1515
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0">
1616
<PrivateAssets>all</PrivateAssets>
1717
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1818
</PackageReference>
1919
<PackageReference Include="nunit" Version="3.12.0" />
20-
<PackageReference Include="NUnit3TestAdapter" Version="3.13.0" />
21-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
20+
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1">
21+
<PrivateAssets>all</PrivateAssets>
22+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
23+
</PackageReference>
24+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
2225
<PackageReference Include="pythonnet" Version="2.3.0" GeneratePathProperty="true">
2326
<IncludeAssets>compile</IncludeAssets>
2427
</PackageReference>

0 commit comments

Comments
 (0)