Skip to content

Commit

Permalink
[C#] Provide path to SBE.dll for C# property tests in CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZachBray committed May 1, 2024
1 parent 6252d22 commit f4b5235
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,16 @@ project(':sbe-tool') {
implementation "org.json:json:${jsonVersion}"
}


targets {
all {
testTask.configure {
minHeapSize = '2g'
maxHeapSize = '2g'

javaLauncher.set(toolchainLauncher)

systemProperty 'sbe.dll', "${rootProject.projectDir}/csharp/sbe-dll/bin/Release/netstandard2.0/SBE.dll"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
public class DtosPropertyTest
{
private static final String DOTNET_EXECUTABLE = System.getProperty("sbe.tests.dotnet.executable", "dotnet");
private static final String SBE_DLL =
System.getProperty("sbe.dll", "csharp/sbe-dll/bin/Release/netstandard2.0/SBE.dll");
private static final String CPP_EXECUTABLE = System.getProperty("sbe.tests.cpp.executable", "g++");
private static final boolean KEEP_DIR_ON_FAILURE = Boolean.parseBoolean(
System.getProperty("sbe.tests.keep.dir.on.failure", "true"));
Expand Down Expand Up @@ -80,7 +82,9 @@ void csharpDtoEncodeShouldBeTheInverseOfDtoDecode(
writeInputFile(encodedMessage, tempDir);

execute(encodedMessage.schema(), tempDir, "test",
DOTNET_EXECUTABLE, "run", "--", "input.dat");
DOTNET_EXECUTABLE, "run",
"--property:SBE_DLL=" + SBE_DLL,
"--", "input.dat");

final byte[] inputBytes = new byte[encodedMessage.length()];
encodedMessage.buffer().getBytes(0, inputBytes);
Expand Down Expand Up @@ -211,12 +215,12 @@ private static void execute(
{
final Path stdout = tempDir.resolve(name + "_stdout.txt");
final Path stderr = tempDir.resolve(name + "_stderr.txt");
final ProcessBuilder compileProcessBuilder = new ProcessBuilder(args)
final ProcessBuilder processBuilder = new ProcessBuilder(args)
.directory(tempDir.toFile())
.redirectOutput(stdout.toFile())
.redirectError(stderr.toFile());

final Process process = compileProcessBuilder.start();
final Process process = processBuilder.start();

if (0 != process.waitFor())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

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

Expand Down

0 comments on commit f4b5235

Please sign in to comment.