Skip to content

Commit

Permalink
add test scripts and edit README
Browse files Browse the repository at this point in the history
  • Loading branch information
DEATHB4DEFEAT committed Oct 29, 2023
1 parent 56920ce commit 9be5804
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 23 deletions.
21 changes: 21 additions & 0 deletions Scripts/bat/!README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
buildAllDebug
Builds all projects with debug configuration
buildAllRelease
Builds all projects with release configuration

The debug vs release build is simply what people develop in vs the actual server.
The release build contains various optimizations, while the debug build contains debugging tools.
If you're mapping, use the release build as it will run smoother with less crashes.


runQuickAll
Runs the client and server without building
runQuickClient
Runs the client without building
runQuickServer
Runs the server without building

runTestsIntegration
Runs the integration tests, makes sure various C# systems work as intended
runTestsYAML
Runs the YAML linter and finds issues with the YAML files that you probably wouldn't otherwise
10 changes: 0 additions & 10 deletions Scripts/bat/readme.txt

This file was deleted.

5 changes: 5 additions & 0 deletions Scripts/bat/runTestsIntegration.bat
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
cd ..\..\

dotnet restore
dotnet build --configuration DebugOpt --no-restore /p:WarningsAsErrors=nullable /m

mkdir Scripts\logs

del Scripts\logs\Content.Tests.log
dotnet test --no-build --configuration DebugOpt Content.Tests/Content.Tests.csproj -- NUnit.ConsoleOut=0 > Scripts\logs\Content.Tests.log

del Scripts\logs\Content.IntegrationTests.log
dotnet test --no-build --configuration DebugOpt Content.IntegrationTests/Content.IntegrationTests.csproj -- NUnit.ConsoleOut=0 NUnit.MapWarningTo=Failed > Scripts\logs\Content.IntegrationTests.log

pause
3 changes: 3 additions & 0 deletions Scripts/bat/runTestsYAML.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
cd ..\..\

dotnet restore
dotnet build --configuration DebugOpt --no-restore /p:WarningsAsErrors=nullable /m

mkdir Scripts\logs
del Scripts\logs\Content.YAMLLinter.log
dotnet run --project Content.YAMLLinter/Content.YAMLLinter.csproj --no-build -- NUnit.ConsoleOut=0 > Scripts\logs\Content.YAMLLinter.log

pause
21 changes: 21 additions & 0 deletions Scripts/sh/!README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
buildAllDebug
Builds all projects with debug configuration
buildAllRelease
Builds all projects with release configuration

The debug vs release build is simply what people develop in vs the actual server.
The release build contains various optimizations, while the debug build contains debugging tools.
If you're mapping, use the release build as it will run smoother with less crashes.


runQuickAll
Runs the client and server without building
runQuickClient
Runs the client without building
runQuickServer
Runs the server without building

runTestsIntegration
Runs the integration tests, makes sure various C# systems work as intended
runTestsYAML
Runs the YAML linter and finds issues with the YAML files that you probably wouldn't otherwise
10 changes: 0 additions & 10 deletions Scripts/sh/readme.txt

This file was deleted.

3 changes: 0 additions & 3 deletions Scripts/sh/runQuickAll.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ if [ "$(dirname $0)" != "." ]; then
cd "$(dirname $0)"
fi

echo "will run both server and client in the same terminal so will give you both outputs at once"
echo "dont mind fatl error relating to port 1212 does not seem to change anything"

sh -e runQuickServer.sh &
sh -e runQuickClient.sh

Expand Down
15 changes: 15 additions & 0 deletions Scripts/sh/runTestsIntegration.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cd ../../

dotnet restore
dotnet build --configuration DebugOpt --no-restore /p:WarningsAsErrors=nullable /m

mkdir Scripts/logs

rm Scripts/logs/Content.Tests.log
dotnet test --no-build --configuration DebugOpt Content.Tests/Content.Tests.csproj -- NUnit.ConsoleOut=0 > Scripts/logs/Content.Tests.log

rm Scripts/logs/Content.IntegrationTests.log
dotnet test --no-build --configuration DebugOpt Content.IntegrationTests/Content.IntegrationTests.csproj -- NUnit.ConsoleOut=0 NUnit.MapWarningTo=Failed > Scripts/logs/Content.IntegrationTests.log

echo "Tests complete. Press enter to continue."
read
11 changes: 11 additions & 0 deletions Scripts/sh/runTestsYAML.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cd ../../

dotnet restore
dotnet build --configuration DebugOpt --no-restore /p:WarningsAsErrors=nullable /m

mkdir Scripts/logs
rm Scripts/logs/Content.YAMLLinter.log
dotnet run --project Content.YAMLLinter/Content.YAMLLinter.csproj --no-build -- NUnit.ConsoleOut=0 > Scripts/logs/Content.YAMLLinter.log

echo "Tests complete. Press enter to continue."
read

0 comments on commit 9be5804

Please sign in to comment.