gtest in library is hard (#3998)

* Revert "Revert "JNI for test coverage #3965""

This reverts commit 7566328816.

* JNI for test coverage #3965

Co-authored-by: rusefillc <sdfsdfqsf2334234234>
This commit is contained in:
rusefillc 2022-03-14 22:15:21 -04:00 committed by GitHub
parent 330e4065fe
commit 05e8f7f6d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -12,5 +12,7 @@ public class JniUnitTest {
EngineLogic engineLogic = new EngineLogic();
String version = engineLogic.getVersion();
assertTrue("Got " + version, version.contains("Hello"));
engineLogic.invokePeriodicCallback();
}
}

View File

@ -135,9 +135,12 @@ EngineTestHelper::EngineTestHelper(engine_type_e engineType, configuration_callb
EngineTestHelper::~EngineTestHelper() {
// Write history to file
std::stringstream filePath;
filePath << "unittest_" << ::testing::UnitTest::GetInstance()->current_test_info()->name() << ".logicdata";
writeEvents(filePath.str().c_str());
extern bool hasInitGtest;
if (hasInitGtest) {
std::stringstream filePath;
filePath << "unittest_" << ::testing::UnitTest::GetInstance()->current_test_info()->name() << ".logicdata";
writeEvents(filePath.str().c_str());
}
// Cleanup
enginePins.reset();