Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## [8.1.0-beta] - 2026-03-20
- Add Windowed Rhino Option
- Add Support for Environment Variables in Paths
- Add Support for specifying Package Directories

## [8.0.28-beta] - 2025-05-12
- Resolver bug fixes

Expand Down
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,20 @@ Specify Legacy IronPython to be loaded:
<LoadLegacyIronPython>true</LoadLegacyIronPython>
```

Specify Rhino To Start in Windowed Mode (default is headless):
```xml
<WindowedMode>true</WindowedMode>
```
Important note: if you set `WindowedMode` to true, you must ensure that your tests are running in a static appartment:
To do that, add the following attribute to your setup fixture class `Apartment(ApartmentState.STA)`:
```csharp
[SetupFixture, Apartment(ApartmentState.STA)]
public sealed class SetupFixture : Rhino.Testing.Fixtures.RhinoSetupFixture
{
// your setup fixture implementation
}
```

Specify list of plugins to be loaded (These plugins are always loaded before Grasshopper)

```xml
Expand All @@ -71,6 +85,21 @@ Specify list of plugins to be loaded (These plugins are always loaded before Gra
</LoadPlugins>
```

Specify Directories to Load Packages from
```xml
<PackageDirectories>
<Directory Path="Example\Folder"/>
</PackageDirectories>
```

Use Environment Variables for Paths in the config file
```xml
<?xml version="1.0" encoding="utf-8"?>
<Settings>
<RhinoSystemDirectory>${env:ProgramFiles}\Rhino 8\System</RhinoSystemDirectory>
</Settings>
```

Specify Grasshopper to be loaded:

```xml
Expand Down
10 changes: 8 additions & 2 deletions Rhino.Testing.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34511.84
# Visual Studio Version 18
VisualStudioVersion = 18.0.11111.16
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Rhino.Testing", "src\Rhino.Testing\Rhino.Testing.csproj", "{EE10AB9B-51C3-4025-AA26-C4DD3517E04C}"
EndProject
Expand All @@ -13,6 +13,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Rhino.Testing.Tests.SetupFi
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Rhino.Testing.Tests.Utils", "src\Rhino.Testing.Tests.Utils\Rhino.Testing.Tests.Utils.csproj", "{A49EB5F1-7D83-4668-AF75-290BDCF350FA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rhino.Testing.Tests.WindowedSetup", "src\Rhino.Testing.Tests.WindowedSetup\Rhino.Testing.Tests.WindowedSetup.csproj", "{31DA1866-70AC-437B-8B97-169EDDFDE4B1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -39,6 +41,10 @@ Global
{A49EB5F1-7D83-4668-AF75-290BDCF350FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A49EB5F1-7D83-4668-AF75-290BDCF350FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A49EB5F1-7D83-4668-AF75-290BDCF350FA}.Release|Any CPU.Build.0 = Release|Any CPU
{31DA1866-70AC-437B-8B97-169EDDFDE4B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{31DA1866-70AC-437B-8B97-169EDDFDE4B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{31DA1866-70AC-437B-8B97-169EDDFDE4B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{31DA1866-70AC-437B-8B97-169EDDFDE4B1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
10 changes: 2 additions & 8 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</PropertyGroup>

<PropertyGroup>
<RhinoTestingVersion>8.0.28</RhinoTestingVersion>
<RhinoTestingVersion>8.1.0</RhinoTestingVersion>
<RhinoInsideVersion>8.0.6-beta</RhinoInsideVersion>
<RhinoAPIVersion>8.0.23304.9001</RhinoAPIVersion>
<SourceDir>$(MSBuildThisFileDirectory)src\</SourceDir>
Expand All @@ -33,11 +33,6 @@

<ItemGroup>
<PackageReference Include="NUnit" Version="3.*" />
<PackageReference Include="NUnit3TestAdapter" Version="4.*" />
<PackageReference Include="coverlet.collector" Version="3.*">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand All @@ -55,5 +50,4 @@
<IncludeAssets>compile; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net48;net7.0-windows;net8.0-windows</TargetFrameworks>
<TargetFrameworks>net48;net8.0-windows</TargetFrameworks>
<IsPackable>false</IsPackable>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand All @@ -9,12 +9,18 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="NUnit.Analyzers" Version="3.3.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.*" />
<PackageReference Include="coverlet.collector" Version="3.*">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Rhino.Testing\Rhino.Testing.csproj" />
</ItemGroup>


<ItemGroup>
<None Update="Rhino.Testing.Configs.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net48;net7.0-windows;net8.0-windows</TargetFrameworks>
<TargetFrameworks>net48;net8.0-windows</TargetFrameworks>
<IsPackable>false</IsPackable>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand All @@ -9,13 +9,19 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="NUnit.Analyzers" Version="3.3.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.*" />
<PackageReference Include="coverlet.collector" Version="3.*">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Rhino.Testing\Rhino.Testing.csproj" />
<ProjectReference Include="..\Rhino.Testing.Tests.Utils\Rhino.Testing.Tests.Utils.csproj" />
</ItemGroup>


<ItemGroup>
<None Update="Rhino.Testing.Configs.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
Expand Down
27 changes: 27 additions & 0 deletions src/Rhino.Testing.Tests.WindowedSetup/EventTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using Rhino.Testing.Fixtures;

namespace Rhino.Testing.Tests.WindowedSetup
{
internal class EventTest : RhinoTestFixture
{
[Test]
public void NewDocumentTest()
{
bool documentEventFired = false;

void LocalScopeNewDocument(object? sender, DocumentEventArgs e)
{
documentEventFired = true;
}

RhinoDoc.NewDocument += LocalScopeNewDocument;
using (var doc = RhinoDoc.Create(null))
{
Assert.That(documentEventFired, Is.True);
Assert.That(doc, Is.Not.Null);
}
RhinoDoc.NewDocument -= LocalScopeNewDocument;
}
}
}
11 changes: 11 additions & 0 deletions src/Rhino.Testing.Tests.WindowedSetup/Rhino.Testing.Configs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Settings>
<RhinoSystemDirectory>C:\Program Files\Rhino 8\System</RhinoSystemDirectory>
<CreateRhinoDoc>false</CreateRhinoDoc>
<CreateRhinoView>false</CreateRhinoView>
<LoadEto>false</LoadEto>
<LoadRDK>false</LoadRDK>
<LoadLegacyIronPython>false</LoadLegacyIronPython>
<LoadGrasshopper>false</LoadGrasshopper>
<WindowedRhino>true</WindowedRhino>
</Settings>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net48;net8.0-windows</TargetFrameworks>
<IsPackable>false</IsPackable>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="NUnit.Analyzers" Version="3.3.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.*" />
<PackageReference Include="coverlet.collector" Version="3.*">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Rhino.Testing\Rhino.Testing.csproj" />
</ItemGroup>


<ItemGroup>
<None Update="Rhino.Testing.Configs.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
10 changes: 10 additions & 0 deletions src/Rhino.Testing.Tests.WindowedSetup/SetupFixture.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Rhino.Testing.Tests
{
[SetUpFixture, Apartment(ApartmentState.STA)]
public sealed class SetupFixture : Rhino.Testing.Fixtures.RhinoSetupFixture
{
public override void OneTimeSetup() => base.OneTimeSetup();

public override void OneTimeTearDown() => base.OneTimeTearDown();
}
}
17 changes: 17 additions & 0 deletions src/Rhino.Testing.Tests.WindowedSetup/SimpleTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Rhino.Geometry;
using Rhino.Testing.Fixtures;

namespace Rhino.Testing.Tests
{
public class SimpleTest : RhinoTestFixture
{
[Test]
public void Test()
{
Point3d point = new(1, 2, 3);
Assert.That(point.X, Is.GreaterThan(0));
Assert.That(point.Y, Is.GreaterThan(0));
Assert.That(point.Z, Is.GreaterThan(0));
}
}
}
1 change: 1 addition & 0 deletions src/Rhino.Testing.Tests.WindowedSetup/Usings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global using NUnit.Framework;
3 changes: 3 additions & 0 deletions src/Rhino.Testing.Tests/Rhino.Testing.Configs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@
<LoadRDK>true</LoadRDK>
<LoadLegacyIronPython>false</LoadLegacyIronPython>
<LoadGrasshopper>false</LoadGrasshopper>
<PackageDirectories>
<Directory Path="${env:UserProfile}\Rhino 8\Plug-ins\"/>
</PackageDirectories>
</Settings>
7 changes: 6 additions & 1 deletion src/Rhino.Testing.Tests/Rhino.Testing.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net48;net7.0-windows;net8.0-windows</TargetFrameworks>
<TargetFrameworks>net48;net8.0-windows</TargetFrameworks>
<IsPackable>false</IsPackable>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand All @@ -9,6 +9,11 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="NUnit.Analyzers" Version="3.3.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.*" />
<PackageReference Include="coverlet.collector" Version="3.*">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
Loading