Skip to content

Commit 5eba82c

Browse files
committed
[C#] Provide path to SBE.dll for C# property tests in CI.
1 parent 306d35f commit 5eba82c

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,13 +308,16 @@ project(':sbe-tool') {
308308
implementation "org.json:json:${jsonVersion}"
309309
}
310310

311+
311312
targets {
312313
all {
313314
testTask.configure {
314315
minHeapSize = '2g'
315316
maxHeapSize = '2g'
316317

317318
javaLauncher.set(toolchainLauncher)
319+
320+
systemProperty 'sbe.dll', "${rootProject.projectDir}/csharp/sbe-dll/bin/Release/netstandard2.0/SBE.dll"
318321
}
319322
}
320323
}

csharp/sbe-dll/sbe-dll.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@
3737
</None>
3838
</ItemGroup>
3939

40-
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
41-
<Reference Include="System.Runtime" />
42-
</ItemGroup>
43-
4440
<ItemGroup>
4541
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0-preview.2" PrivateAssets="All" />
4642
<PackageReference Include="System.Memory" Version="4.5.3" />

sbe-tool/src/propertyTest/java/uk/co/real_logic/sbe/properties/DtosPropertyTest.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
public class DtosPropertyTest
4040
{
4141
private static final String DOTNET_EXECUTABLE = System.getProperty("sbe.tests.dotnet.executable", "dotnet");
42+
private static final String SBE_DLL =
43+
System.getProperty("sbe.dll", "csharp/sbe-dll/bin/Release/netstandard2.0/SBE.dll");
4244
private static final String CPP_EXECUTABLE = System.getProperty("sbe.tests.cpp.executable", "g++");
4345
private static final boolean KEEP_DIR_ON_FAILURE = Boolean.parseBoolean(
4446
System.getProperty("sbe.tests.keep.dir.on.failure", "true"));
@@ -80,7 +82,9 @@ void csharpDtoEncodeShouldBeTheInverseOfDtoDecode(
8082
writeInputFile(encodedMessage, tempDir);
8183

8284
execute(encodedMessage.schema(), tempDir, "test",
83-
DOTNET_EXECUTABLE, "run", "--", "input.dat");
85+
DOTNET_EXECUTABLE, "run",
86+
"--property:SBE_DLL=" + SBE_DLL,
87+
"--", "input.dat");
8488

8589
final byte[] inputBytes = new byte[encodedMessage.length()];
8690
encodedMessage.buffer().getBytes(0, inputBytes);
@@ -211,12 +215,12 @@ private static void execute(
211215
{
212216
final Path stdout = tempDir.resolve(name + "_stdout.txt");
213217
final Path stderr = tempDir.resolve(name + "_stderr.txt");
214-
final ProcessBuilder compileProcessBuilder = new ProcessBuilder(args)
218+
final ProcessBuilder processBuilder = new ProcessBuilder(args)
215219
.directory(tempDir.toFile())
216220
.redirectOutput(stdout.toFile())
217221
.redirectError(stderr.toFile());
218222

219-
final Process process = compileProcessBuilder.start();
223+
final Process process = processBuilder.start();
220224

221225
if (0 != process.waitFor())
222226
{

sbe-tool/src/propertyTest/resources/CSharpDtosPropertyTest/SbePropertyTest.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<ItemGroup>
99
<Reference Include="SBE">
10-
<HintPath>/home/zach/src/real-logic/simple-binary-encoding/csharp/sbe-dll/bin/Release/netstandard2.0/SBE.dll</HintPath>
10+
<HintPath>$(SBE_DLL)</HintPath>
1111
</Reference>
1212
</ItemGroup>
1313

0 commit comments

Comments
 (0)