# Copyright 2019-2020 Katy Coe - http://www.djkaty.com - https://github.com/djkaty # All rights reserved. # Generate Tests.cs $testGen = "$PSScriptRoot/Tests.cs" $bin = "$PSScriptRoot/TestBinaries" echo @" // THIS FILE IS AUTO-GENERATED BY GENERATE-TESTS.PS1 // DO NOT EDIT using System.Threading.Tasks; using NUnit.Framework; namespace Il2CppInspector { [Parallelizable(ParallelScope.All)] public partial class TestRunner { "@ > $testGen gci -Directory $bin | % { $loadOptionsFile = "$($_.FullName)\loadoptions.txt" $loadOptions = "" if (Test-Path $loadOptionsFile -PathType Leaf) { $loadOptions = cat $loadOptionsFile } $pluginsPath = "$($_.FullName)\plugins" $attributes = "" if (Test-Path $pluginsPath -PathType Container) { $attributes = "[NonParallelizable]" } echo @" [Test] $attributes public async Task $($_.Name -Replace '\W','_')() { await runTest(@"$($_.FullName)", new LoadOptions { $loadOptions }); } "@ >> $testGen } echo @" } } "@ >> $testGen