From 0dfcc0a378346810b6294c66dc738c21fb9b75e3 Mon Sep 17 00:00:00 2001 From: Derek Bailey Date: Tue, 27 Oct 2020 22:51:58 -0700 Subject: [PATCH] Adds NetTest.bat to run .NET Core tests on Windows (#6216) --- .gitignore | 3 ++- tests/FlatBuffers.Test/NetTest.bat | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 tests/FlatBuffers.Test/NetTest.bat diff --git a/.gitignore b/.gitignore index 1ff29a69b..e02f85499 100644 --- a/.gitignore +++ b/.gitignore @@ -135,4 +135,5 @@ js/**/*.d.ts mjs/**/*.js mjs/**/*.d.ts yarn-error.log -.cache/ \ No newline at end of file +.cache/ +.cmake/ \ No newline at end of file diff --git a/tests/FlatBuffers.Test/NetTest.bat b/tests/FlatBuffers.Test/NetTest.bat new file mode 100644 index 000000000..3b88b53ec --- /dev/null +++ b/tests/FlatBuffers.Test/NetTest.bat @@ -0,0 +1,20 @@ +@echo off +@REM Builds a .NET solution file, adds the project, builds it +@REM and executes it. Cleans up all generated files and directories. + +set TEMP_BIN=.tmp + +@REM Run the .NET Core tests +set CORE_FILE=FlatBuffers.Core.Test +set CORE_PROJ_FILE=%CORE_FILE%.csproj +set CORE_SLN_FILE=%CORE_FILE%.sln +dotnet new sln --force --name %CORE_FILE% +dotnet sln %CORE_SLN_FILE% add %CORE_PROJ_FILE% +dotnet build -c Release -o %TEMP_BIN% -v quiet %CORE_PROJ_FILE% +%TEMP_BIN%\%CORE_FILE%.exe +del /f %CORE_SLN_FILE% + +@REM TODO(dbaileychess): Support the other configurations in NetTest.sh + +@REM remove the temp bin directory, with files (/S) and quietly (/Q) +RD /S /Q %TEMP_BIN%