summaryrefslogtreecommitdiff
path: root/vts
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2020-07-08 18:26:09 +0000
committerSteven Moreland <smoreland@google.com>2020-07-08 18:26:14 +0000
commitec28f53bb7a55c12cd1e51f9021ae868c246e351 (patch)
tree92fd9d01bdcee603573142f4aaadb19a7b8a7639 /vts
parent722a6156b5aba1bf91d688bf721e1dba72390a43 (diff)
downloadlibhwbinder-ec28f53bb7a55c12cd1e51f9021ae868c246e351.tar.gz
Avoid TREBLE_TESTING_OVERRIDE
This is moved from an environmental variable to a function since getenv is problematic in multi-threaded testing environments. Bug: 156668058 Test: run each of libhwbinder_benchmark hwbinderThroughputTest libhwbinder_latency Change-Id: I035b6fbe12536a292e7c473abfb7b135e9400cf0
Diffstat (limited to 'vts')
-rw-r--r--vts/performance/Benchmark.cpp2
-rw-r--r--vts/performance/Benchmark_throughput.cpp3
-rw-r--r--vts/performance/Latency.cpp2
3 files changed, 4 insertions, 3 deletions
diff --git a/vts/performance/Benchmark.cpp b/vts/performance/Benchmark.cpp
index e7d75cd..f995ec7 100644
--- a/vts/performance/Benchmark.cpp
+++ b/vts/performance/Benchmark.cpp
@@ -106,7 +106,7 @@ static void BM_sendVec_binderize(benchmark::State& state) {
}
int main(int argc, char* argv []) {
- setenv("TREBLE_TESTING_OVERRIDE", "true", true);
+ android::hardware::details::setTrebleTestingOverride(true);
enum HwBinderMode {
kBinderize = 0,
diff --git a/vts/performance/Benchmark_throughput.cpp b/vts/performance/Benchmark_throughput.cpp
index 42c1c6f..d197d2d 100644
--- a/vts/performance/Benchmark_throughput.cpp
+++ b/vts/performance/Benchmark_throughput.cpp
@@ -28,6 +28,7 @@
#include <android/hardware/tests/libhwbinder/1.0/IBenchmark.h>
#include <hidl/HidlSupport.h>
+#include <hidl/ServiceManagement.h>
using namespace std;
using namespace android;
@@ -297,7 +298,7 @@ void signal_all(vector<Pipe>& v) {
}
int main(int argc, char *argv[]) {
- setenv("TREBLE_TESTING_OVERRIDE", "true", true);
+ android::hardware::details::setTrebleTestingOverride(true);
enum HwBinderMode {
kBinderize = 0,
diff --git a/vts/performance/Latency.cpp b/vts/performance/Latency.cpp
index a4c0751..13a93ad 100644
--- a/vts/performance/Latency.cpp
+++ b/vts/performance/Latency.cpp
@@ -282,7 +282,7 @@ static void help() {
// atrace --async_start -c sched idle workq binder_driver freq && \
// libhwbinder_latency -i 10000 -pair 4 -trace
int main(int argc, char** argv) {
- setenv("TREBLE_TESTING_OVERRIDE", "true", true);
+ android::hardware::details::setTrebleTestingOverride(true);
vector<Pipe> client_pipes;
vector<Pipe> service_pipes;