libbinder: Split universal tests from Android-specific
Add a new binderRpcUniversalTests.cpp that contains all
the tests that can be run on any OS, leaving the
Android/Linux-specific tests in binderRpcTest.cpp.
This allows other operating systems, like Trusty,
to compile binderRpcUniversalTests.cpp by itself and
ignore the other file.
Bug: 230135749
Test: mmm tests
Change-Id: I382ed03b0dc9df4123b231077dce456ac7f555ba
diff --git a/libs/binder/tests/binderRpcTestCommon.h b/libs/binder/tests/binderRpcTestCommon.h
index 823bbf6..dc7d264 100644
--- a/libs/binder/tests/binderRpcTestCommon.h
+++ b/libs/binder/tests/binderRpcTestCommon.h
@@ -91,6 +91,14 @@
}
}
+static inline size_t epochMillis() {
+ using std::chrono::duration_cast;
+ using std::chrono::milliseconds;
+ using std::chrono::seconds;
+ using std::chrono::system_clock;
+ return duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count();
+}
+
struct BinderRpcOptions {
size_t numThreads = 1;
size_t numSessions = 1;