Skip to content

Commit

Permalink
[unity]试下先移除Nunit然后重新安装
Browse files Browse the repository at this point in the history
  • Loading branch information
chexiongsheng committed Nov 27, 2024
1 parent a71949b commit 4a99eeb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion unity/cli/test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ async function runTest(cwd, copyConfig, runInReflection, filter = '') {

mkdir("-p", workdir);
exec(`dotnet new nunit`, { cwd: workdir });
assert.equal(0, exec(`dotnet remove package NUnit`, { cwd: workdir }).code);
assert.equal(0, exec(`dotnet remove package NUnit3TestAdapter`, { cwd: workdir }).code);
assert.equal(0, exec(`dotnet add package NUnit --version 3.14.0`, { cwd: workdir }).code);
assert.equal(0, exec(`dotnet add package NUnit3TestAdapter --version 4.5.0`, { cwd: workdir }).code);
assert.equal(0, exec(`dotnet restore`, { cwd: workdir }).code);
rm('-rf', join(workdir, 'UnitTest1.cs'));
rm('-rf', join(workdir, 'Usings.cs'));

Expand Down Expand Up @@ -127,7 +132,6 @@ async function runTest(cwd, copyConfig, runInReflection, filter = '') {

// 运行测试
assert.equal(0, exec(`dotnet build ${testProjectName}.csproj -p:StartupObject=PuertsTest -v quiet`, { cwd: workdir }).code);
assert.equal(0, exec(`dotnet add package NUnit --version 3.14.0`, { cwd: workdir }).code);
assert.equal(0, exec(`dotnet test ${testProjectName}.csproj --blame-hang-timeout 10000ms ${filter ? `--filter ${filter}` : ''}`, { cwd: workdir }).code);
}

Expand Down

0 comments on commit 4a99eeb

Please sign in to comment.