mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 04:04:19 +00:00
* ENABLE_SPAN_T doesn't require UNSAFE_BYTEBUFFER. Change to ENABLE_SPAN_T that doesn't require UNSAFE_BYTEBUFFER. * Selectable framework. Changed target framework to allow selection of 2.0 or 2.1 (or higher) * Added target framework version check. * Add core test project. * Added run on .Net Core.
55 lines
1.5 KiB
Bash
Executable File
55 lines
1.5 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
PROJ_FILE=FlatBuffers.Test.csproj
|
|
CORE_PROJ_FILE=FlatBuffers.Core.Test.csproj
|
|
|
|
TEMP_DOTNET_DIR=.dotnet_tmp
|
|
TEMP_BIN=.tmp
|
|
|
|
[ -d $TEMP_DOTNET_DIR ] || mkdir $TEMP_DOTNET_DIR
|
|
|
|
[ -f dotnet-install.sh ] || curl -OL https://dot.net/v1/dotnet-install.sh
|
|
|
|
./dotnet-install.sh --version latest --install-dir $TEMP_DOTNET_DIR
|
|
|
|
DOTNET=$TEMP_DOTNET_DIR/dotnet
|
|
|
|
$DOTNET new sln
|
|
$DOTNET sln add $PROJ_FILE
|
|
$DOTNET restore -r linux-x64 $PROJ_FILE
|
|
|
|
# Testing C# on Linux using Mono.
|
|
msbuild -property:Configuration=Release,OutputPath=$TEMP_BIN -verbosity:minimal $PROJ_FILE
|
|
mono $TEMP_BIN/FlatBuffers.Test.exe
|
|
rm -fr $TEMP_BIN
|
|
|
|
# Repeat with unsafe versions
|
|
msbuild -property:Configuration=Release,UnsafeByteBuffer=true,OutputPath=$TEMP_BIN -verbosity:minimal $PROJ_FILE
|
|
mono $TEMP_BIN/FlatBuffers.Test.exe
|
|
rm -fr $TEMP_BIN
|
|
|
|
rm FlatBuffers.Test.sln
|
|
rm -rf obj
|
|
|
|
$DOTNET new sln
|
|
$DOTNET sln add $CORE_PROJ_FILE
|
|
$DOTNET restore -r linux-x64 $CORE_PROJ_FILE
|
|
|
|
# Testing C# on Linux using .Net Core.
|
|
msbuild -property:Configuration=Release,OutputPath=$TEMP_BIN -verbosity:minimal $CORE_PROJ_FILE
|
|
$TEMP_BIN/FlatBuffers.Core.Test.exe
|
|
rm -fr $TEMP_BIN
|
|
|
|
# Repeat with unsafe versions
|
|
msbuild -property:Configuration=Release,UnsafeByteBuffer=true,OutputPath=$TEMP_BIN -verbosity:minimal $CORE_PROJ_FILE
|
|
$TEMP_BIN/FlatBuffers.Core.Test.exe
|
|
rm -fr $TEMP_BIN
|
|
|
|
# Repeat with SpanT versions
|
|
msbuild -property:Configuration=Release,EnableSpanT=true,OutputPath=$TEMP_BIN -verbosity:minimal $CORE_PROJ_FILE
|
|
$TEMP_BIN/FlatBuffers.Core.Test.exe
|
|
rm -fr $TEMP_BIN
|
|
|
|
rm FlatBuffers.Core.Test.sln
|
|
rm -rf obj
|