summaryrefslogtreecommitdiffhomepage
path: root/test/util/test_util.cc
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2020-01-27 22:27:57 -0800
committergVisor bot <gvisor-bot@google.com>2020-01-27 22:28:43 -0800
commit5d569408ef94c753b7aae9392b5e4ebf7e5ea50d (patch)
treeb34260f2e94e62b4ee3f4bff45644c39fdf0fecd /test/util/test_util.cc
parent2a2da5be31ea3c32e66f0c0ff61ef189848f5258 (diff)
Create platform_util for tests.
PiperOrigin-RevId: 291869423
Diffstat (limited to 'test/util/test_util.cc')
-rw-r--r--test/util/test_util.cc11
1 files changed, 2 insertions, 9 deletions
diff --git a/test/util/test_util.cc b/test/util/test_util.cc
index 848504c88..15cbc6da6 100644
--- a/test/util/test_util.cc
+++ b/test/util/test_util.cc
@@ -45,20 +45,13 @@ namespace testing {
bool IsRunningOnGvisor() { return GvisorPlatform() != Platform::kNative; }
-Platform GvisorPlatform() {
+const std::string GvisorPlatform() {
// Set by runner.go.
char* env = getenv(TEST_ON_GVISOR);
if (!env) {
return Platform::kNative;
}
- if (strcmp(env, "ptrace") == 0) {
- return Platform::kPtrace;
- }
- if (strcmp(env, "kvm") == 0) {
- return Platform::kKVM;
- }
- std::cerr << "unknown platform " << env;
- abort();
+ return std::string(env);
}
bool IsRunningWithHostinet() {