Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
if: needs.changes.outputs.csharp == 'true'
runs-on: ubuntu-latest
env:
VS_VERSION: "1.21.7"
VS_VERSION: "1.22.2"
steps:
- uses: actions/checkout@v6
- uses: actions/setup-dotnet@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
env:
VS_VERSION: "1.21.7"
VS_VERSION: "1.22.2"

steps:
- uses: actions/configure-pages@v6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
vs_version:
description: "VintageStory version (for core/cake builds)"
required: false
default: "1.21.7"
default: "1.22.2"

jobs:
pack:
Expand Down
1 change: 1 addition & 0 deletions .mdformat.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
exclude = [
"docs/api/**",
"vscode-ext/node_modules/**",
"README.md",
]
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# VinTest — in-game testing framework for Vintage Story mods

![Demo](demo.png)

VinTest lets you write automated tests for your Vintage Story mod that run inside the actual game.
Instead of guessing whether your code works, you launch VS with a companion test mod loaded alongside
your real mod, and the framework verifies your logic, then exits and reports the results.
| ![Demo](/docs/img/demo.png) | Make a mod for your mod that will test your mod while you mod it. |
| --- | --- |

**Documentation: https://artalus.github.io/vintest/**

Expand Down
11 changes: 9 additions & 2 deletions VinTest.Cake/VinTest.Cake.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<!-- NuGet package metadata -->
<PackageId>VinTest.Cake</PackageId>
<Version>0.0.0</Version>
<Version>0.1.0</Version>
<Description>Cake tasks for automating VintageStory mod game tests with VinTest.</Description>
<PackageTags>VintageStory modding testing cake</PackageTags>
<RepositoryType>git</RepositoryType>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
<None Include="../LICENSE" Pack="true" PackagePath="" />
<None Include="../README.md" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Cake.Common" Version="6.1.0" />
<PackageReference Include="Cake.Frosting" Version="6.1.0" />
Expand Down
16 changes: 14 additions & 2 deletions VinTest/VinTest.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<!-- NuGet package metadata -->
<PackageId>VinTest</PackageId>
<Version>0.0.0</Version>
<Version>0.1.0</Version>
<Description>Create autotests for your Vintage Story mods.</Description>
<PackageTags>VintageStory modding testing</PackageTags>
<RepositoryType>git</RepositoryType>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
<None Include="../LICENSE" Pack="true" PackagePath="" />
<None Include="../README.md" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup>
<Reference Include="VintagestoryAPI">
<HintPath>$(VINTAGE_STORY)/VintagestoryAPI.dll</HintPath>
Expand All @@ -21,4 +28,9 @@
<Private>false</Private>
</Reference>
</ItemGroup>

<!-- Ensure that our consumers will copy VinTest.dll to mod output -->
<ItemGroup>
<None Include="build\VinTest.targets" Pack="true" PackagePath="build\VinTest.targets" />
</ItemGroup>
</Project>
13 changes: 13 additions & 0 deletions VinTest/build/VinTest.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project>
<!--
This targets file is included when VinTest is consumed as a NuGet package.
It copies the VinTest.dll runtime to the output directory of projects that reference it.
-->
<Target Name="CopyVinTestDll" AfterTargets="Build">
<Copy
SourceFiles="$(MSBuildThisFileDirectory)..\lib\net10.0\VinTest.dll"
DestinationFolder="$(OutDir)"
SkipUnchangedFiles="true"
/>
</Target>
</Project>
4 changes: 2 additions & 2 deletions docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ def main(args: Args) -> None:
out = "dedo-out"
shutil.rmtree(out, ignore_errors=True)
if args.target == "core":
dll = "VinTest/bin/Release/net8.0/VinTest.dll"
dll = "VinTest/bin/Release/net10.0/VinTest.dll"
elif args.target == "cake":
dll = "VinTest.Cake/bin/Release/net8.0/VinTest.Cake.dll"
dll = "VinTest.Cake/bin/Release/net10.0/VinTest.Cake.dll"
elif args.target == "vintage":
e = os.getenv("VINTAGE_STORY")
if not e:
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/local-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Vintage Story installation directory (the one that contains `VintagestoryAPI.dll

```xml
<Reference Include="VintagestoryAPI">
<!-- BAD: expects people to have disk E:, have exactly VS 1.21.7, have it installed exactly there -->
<HintPath>E:/Games/VintageStoryManaged/1.21.7/VintagestoryAPI.dll</HintPath>
<!-- BAD: expects people to have disk E:, have exactly VS 1.22.2, have it installed exactly there -->
<HintPath>E:/Games/VintageStoryManaged/1.22.2/VintagestoryAPI.dll</HintPath>
<!-- BAD: expects to have VS exactly three directories above the mod workspace -->
<HintPath>../../../VintageStory/VintagestoryAPI.dll</HintPath>
<!-- GOOD: everyone decide for themselves where their VS is -->
Expand Down
8 changes: 4 additions & 4 deletions docs/quickstart/cake-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ Update your `CakeBuild.csproj` C# project to use the [`VinTest.Cake`](/vintest/a
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory> <!-- (1)! -->
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Cake.Frosting" Version="6.1.0" />
<PackageReference Include="VinTest.Cake" Version="0.0.0" />
<PackageReference Include="VinTest.Cake" Version="0.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -131,7 +131,7 @@ dotnet run `
--project ./CakeBuild `
--target RunGameTests `
-- `
--vs-path "D:/VintageStory/1.21.7" `
--vs-path "D:/VintageStory/1.22.2" `
--data-path "../gamedata" `
--test-world "autotest" `
--manual-mode true
Expand Down Expand Up @@ -166,7 +166,7 @@ dotnet run `
--project ./CakeBuild `
--target RunGameTests `
-- `
--vs-path "D:/VintageStory/1.21.7" `
--vs-path "D:/VintageStory/1.22.2" `
--data-path "../gamedata" `
--test-world "autotest" `
# (1)!
Expand Down
4 changes: 2 additions & 2 deletions docs/quickstart/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Add a new C# project to your solution. By convention it is named `<YourMod>.game
```xml title="YourMod.gametests/YourMod.gametests.csproj" linenums="1" hl_lines="9-21"
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<OutputPath>bin\$(Configuration)\Mods\mod</OutputPath>
<Nullable>enable</Nullable>
Expand All @@ -53,7 +53,7 @@ Add a new C# project to your solution. By convention it is named `<YourMod>.game
</ItemGroup>

<ItemGroup>
<PackageReference Include="VinTest" Version="0.0.0" /> <!-- (4)! -->
<PackageReference Include="VinTest" Version="0.1.0" /> <!-- (4)! -->
<ProjectReference Include="../YourMod/YourMod.csproj"> <!-- (5)! -->
<Private>false</Private> <!-- (6)! -->
</ProjectReference>
Expand Down
4 changes: 2 additions & 2 deletions example/CakeBuild/CakeBuild.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<!-- this setting is important so `dotnet run` would always change directory internally -->
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory>
Expand All @@ -17,7 +17,7 @@
Usually you'd want to alwas get a pinned VinTest version from NuGet.
But you can use a local copy via Directory.Build.targets file.
-->
<PackageReference Include="VinTest.Cake" Version="0.0.0" />
<PackageReference Include="VinTest.Cake" Version="0.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions example/MyMod.gametests/MyMod.gametests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<OutputPath>bin\$(Configuration)\Mods\mod</OutputPath>
<Nullable>enable</Nullable>
Expand All @@ -24,7 +24,7 @@
Usually you'd want to always get a pinned VinTest version from NuGet.
But you can use a local copy via Directory.Build.targets file.
-->
<PackageReference Include="VinTest" Version="0.0.0" />
<PackageReference Include="VinTest" Version="0.1.0" />

<!-- Gametests need the main mod DLLs to be built - but they should not be copied, since
the mod will already be loaded by VS itself. -->
Expand Down
2 changes: 1 addition & 1 deletion example/MyMod.unittests/MyMod.unittests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ implemented unit tests will run faster than gametests.

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion example/MyMod/MyMod.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<OutputPath>bin\$(Configuration)\Mods\mod</OutputPath>
<Nullable>enable</Nullable>
Expand Down
2 changes: 1 addition & 1 deletion vscode-ext/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vintest-adapter",
"displayName": "VinTest Testing Adapter",
"description": "Discovers and runs VinTest game tests via the VS Code Testing panel",
"version": "0.0.0",
"version": "0.1.0",
"publisher": "Artalus",
"repository": {
"type": "git",
Expand Down