diff options
author | Steven Moreland <smoreland@google.com> | 2020-07-08 18:26:09 +0000 |
---|---|---|
committer | Steven Moreland <smoreland@google.com> | 2020-07-08 18:26:14 +0000 |
commit | ec28f53bb7a55c12cd1e51f9021ae868c246e351 (patch) | |
tree | 92fd9d01bdcee603573142f4aaadb19a7b8a7639 /vts | |
parent | 722a6156b5aba1bf91d688bf721e1dba72390a43 (diff) | |
download | libhwbinder-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.cpp | 2 | ||||
-rw-r--r-- | vts/performance/Benchmark_throughput.cpp | 3 | ||||
-rw-r--r-- | vts/performance/Latency.cpp | 2 |
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; |