Skip to content

Commit

Permalink
[C]: add java minor and major versions to defines for test. On JVMs >…
Browse files Browse the repository at this point in the history
…= 1.9, add opens args.
  • Loading branch information
tmontgomery committed May 3, 2019
1 parent 7037681 commit a328f1c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 10 additions & 1 deletion aeron-archive/src/test/cpp/AeronArchiveTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ class AeronArchiveTest : public testing::Test
{
if (::execl(m_java.c_str(),
"java",
#if JAVA_MINOR_VERSION >= 9
"--add-opens",
"java.base/java.lang.reflect=ALL-UNNAMED",
"--add-opens",
"java.base/java.net=ALL-UNNAMED"
"--add-opens",
"java.base/sun.nio.ch=ALL-UNNAMED",
#endif
"-Daeron.dir.delete.on.start=true",
"-Daeron.archive.dir.delete.on.start=true",
"-Daeron.archive.max.catalog.entries=1024",
Expand All @@ -95,6 +103,7 @@ class AeronArchiveTest : public testing::Test
}
}

m_stream << "Java " << JAVA_MAJOR_VERSION << "." << JAVA_MINOR_VERSION << std::endl;
m_stream << "ArchivingMediaDriver PID " << std::to_string(m_pid) << std::endl;
}

Expand Down Expand Up @@ -216,7 +225,7 @@ class AeronArchiveTest : public testing::Test
pid_t m_pid = 0;

std::ostringstream m_stream;
bool m_debug = false;
bool m_debug = true;
};

TEST_F(AeronArchiveTest, shouldSpinUpArchiveAndShutdown)
Expand Down
2 changes: 2 additions & 0 deletions aeron-archive/src/test/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ include_directories(${AERON_ARCHIVE_SOURCE_PATH})
add_definitions(-DAERON_ALL_JAR="${AERON_ALL_JAR}")
add_definitions(-DJAVA_EXECUTABLE="${Java_JAVA_EXECUTABLE}")
add_definitions(-DARCHIVE_DIR="${CMAKE_CURRENT_BINARY_DIR}/archive")
add_definitions(-DJAVA_MAJOR_VERSION=${Java_VERSION_MAJOR})
add_definitions(-DJAVA_MINOR_VERSION=${Java_VERSION_MINOR})

function(aeron_archive_client_test name file)
add_executable(${name} ${file})
Expand Down

0 comments on commit a328f1c

Please sign in to comment.