Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
db1d4dc4
Unverified
Commit
db1d4dc4
authored
Mar 13, 2019
by
Jan Tattermusch
Committed by
GitHub
Mar 13, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5876 from jtattermusch/csharp_win_tests
C# testing improvements
parents
93533f78
60a889e0
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
52 additions
and
7 deletions
+52
-7
Makefile.am
Makefile.am
+1
-0
appveyor.bat
appveyor.bat
+1
-1
buildall.bat
csharp/buildall.bat
+13
-0
buildall.sh
csharp/buildall.sh
+3
-3
RepeatedFieldTest.cs
...src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs
+2
-1
EqualityTester.cs
csharp/src/Google.Protobuf.Test/EqualityTester.cs
+3
-2
build_nuget.bat
kokoro/release/csharp/windows/build_nuget.bat
+4
-0
build.bat
kokoro/windows/csharp/build.bat
+14
-0
continuous.cfg
kokoro/windows/csharp/continuous.cfg
+5
-0
tests.sh
tests.sh
+6
-0
No files found.
Makefile.am
View file @
db1d4dc4
...
...
@@ -57,6 +57,7 @@ csharp_EXTRA_DIST= \
csharp/README.md
\
csharp/build_packages.bat
\
csharp/build_tools.sh
\
csharp/buildall.bat
\
csharp/buildall.sh
\
csharp/generate_protos.sh
\
csharp/install_dotnet_sdk.ps1
\
...
...
appveyor.bat
View file @
db1d4dc4
...
...
@@ -38,7 +38,7 @@ dotnet restore
dotnet build -c %configuration% || goto error
echo Testing C#
dotnet test -c %configuration% -f netcoreapp
1.0
Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error
dotnet test -c %configuration% -f netcoreapp
2.1
Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error
dotnet test -c %configuration% -f net451 Google.Protobuf.Test\Google.Protobuf.Test.csproj || goto error
goto :EOF
...
...
csharp/buildall.bat
0 → 100644
View file @
db1d4dc4
@rem Builds Google.Protobuf and runs the tests
dotnet build src/Google.Protobuf.sln || goto :error
echo Running tests.
dotnet test src/Google.Protobuf.Test/Google.Protobuf.Test.csproj || goto :error
goto :EOF
:error
echo Failed!
exit /b %errorlevel%
csharp/buildall.sh
View file @
db1d4dc4
...
...
@@ -10,8 +10,8 @@ dotnet restore $SRC/Google.Protobuf.sln
dotnet build
-c
$CONFIG
$SRC
/Google.Protobuf.sln
echo
Running tests.
# Only test netcoreapp
1.0
, which uses the .NET Core runtime.
# Only test netcoreapp
2.1
, which uses the .NET Core runtime.
# If we want to test the .NET 4.5 version separately, we could
# run Mono explicitly. However, we don't have any differences between
# the .NET 4.5 and netstandard
1.0
assemblies.
dotnet
test
-c
$CONFIG
-f
netcoreapp
1.0
$SRC
/Google.Protobuf.Test/Google.Protobuf.Test.csproj
# the .NET 4.5 and netstandard
2.1
assemblies.
dotnet
test
-c
$CONFIG
-f
netcoreapp
2.1
$SRC
/Google.Protobuf.Test/Google.Protobuf.Test.csproj
csharp/src/Google.Protobuf.Test/Collections/RepeatedFieldTest.cs
View file @
db1d4dc4
...
...
@@ -750,7 +750,8 @@ namespace Google.Protobuf.Collections
var
list2
=
new
RepeatedField
<
double
>
{
SampleNaNs
.
Regular
,
SampleNaNs
.
PayloadFlipped
};
var
list3
=
new
RepeatedField
<
double
>
{
SampleNaNs
.
Regular
,
SampleNaNs
.
SignallingFlipped
};
EqualityTester
.
AssertInequality
(
list1
,
list2
);
// All SampleNaNs have the same hashcode under certain targets (e.g. netcoreapp2.1)
EqualityTester
.
AssertInequality
(
list1
,
list2
,
checkHashcode
:
false
);
EqualityTester
.
AssertEquality
(
list1
,
list3
);
Assert
.
True
(
list1
.
Contains
(
SampleNaNs
.
SignallingFlipped
));
Assert
.
False
(
list2
.
Contains
(
SampleNaNs
.
SignallingFlipped
));
...
...
csharp/src/Google.Protobuf.Test/EqualityTester.cs
View file @
db1d4dc4
...
...
@@ -49,13 +49,14 @@ namespace Google.Protobuf
Assert
.
AreEqual
(
first
.
GetHashCode
(),
second
.
GetHashCode
());
}
public
static
void
AssertInequality
<
T
>(
T
first
,
T
second
)
where
T
:
IEquatable
<
T
>
public
static
void
AssertInequality
<
T
>(
T
first
,
T
second
,
bool
checkHashcode
=
true
)
where
T
:
IEquatable
<
T
>
{
Assert
.
IsFalse
(
first
.
Equals
(
second
));
Assert
.
IsFalse
(
first
.
Equals
((
object
)
second
));
// While this isn't a requirement, the chances of this test failing due to
// coincidence rather than a bug are very small.
if
(
first
!=
null
&&
second
!=
null
)
// For such rare cases, an argument can be used to disable the check.
if
(
checkHashcode
&&
first
!=
null
&&
second
!=
null
)
{
Assert
.
AreNotEqual
(
first
.
GetHashCode
(),
second
.
GetHashCode
());
}
...
...
kokoro/release/csharp/windows/build_nuget.bat
View file @
db1d4dc4
...
...
@@ -7,4 +7,8 @@ cd csharp
powershell -File install_dotnet_sdk.ps1
set PATH=%LOCALAPPDATA%\Microsoft\dotnet;%PATH%
@rem Disable some unwanted dotnet options
set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
set DOTNET_CLI_TELEMETRY_OPTOUT=true
call build_packages.bat
kokoro/windows/csharp/build.bat
0 → 100644
View file @
db1d4dc4
@rem enter repo root
cd /d %~dp0\..\..\..
cd csharp
@rem Install dotnet SDK
powershell -File install_dotnet_sdk.ps1
set PATH=%LOCALAPPDATA%\Microsoft\dotnet;%PATH%
@rem Disable some unwanted dotnet options
set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
set DOTNET_CLI_TELEMETRY_OPTOUT=true
call buildall.bat
kokoro/windows/csharp/continuous.cfg
0 → 100644
View file @
db1d4dc4
# Config file for running tests in Kokoro
# Location of the build script in repository
build_file: "protobuf/kokoro/windows/csharp/build.bat"
timeout_mins: 1440
tests.sh
View file @
db1d4dc4
...
...
@@ -117,6 +117,12 @@ build_csharp() {
internal_build_cpp
NUGET
=
/usr/local/bin/nuget.exe
# Disable some unwanted dotnet options
export
DOTNET_SKIP_FIRST_TIME_EXPERIENCE
=
true
export
DOTNET_CLI_TELEMETRY_OPTOUT
=
true
# TODO(jtattermusch): is this still needed with "first time experience"
# disabled?
# Perform "dotnet new" once to get the setup preprocessing out of the
# way. That spews a lot of output (including backspaces) into logs
# otherwise, and can cause problems. It doesn't matter if this step
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment