summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei Wang2016-10-21 11:23:39 -0500
committerWei Wang2016-10-22 12:35:21 -0500
commit8c176302e6a6b4de40079af42c30d8d00da89f30 (patch)
treec063a1d84d1fbb8a9c4b70d2339aeea0063aa08d /base/include/android-base/test_utils.h
parentc75a32aae30f8cadbb5608d2fb680ef326708fcd (diff)
downloadplatform-system-core-8c176302e6a6b4de40079af42c30d8d00da89f30.tar.gz
platform-system-core-8c176302e6a6b4de40079af42c30d8d00da89f30.tar.xz
platform-system-core-8c176302e6a6b4de40079af42c30d8d00da89f30.zip
Move CapturedStderr to test_util library
Bug: 32181382 Test: run /data/nativetest(64)/binderTextOutputTest Change-Id: Ifb2e1f6af2c3f57b5cbed7dde65efb31253c52a2
Diffstat (limited to 'base/include/android-base/test_utils.h')
-rw-r--r--base/include/android-base/test_utils.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/base/include/android-base/test_utils.h b/base/include/android-base/test_utils.h
index 4ea3c8e48..c0bf0c1e1 100644
--- a/base/include/android-base/test_utils.h
+++ b/base/include/android-base/test_utils.h
@@ -48,4 +48,21 @@ class TemporaryDir {
48 DISALLOW_COPY_AND_ASSIGN(TemporaryDir); 48 DISALLOW_COPY_AND_ASSIGN(TemporaryDir);
49}; 49};
50 50
51class CapturedStderr {
52 public:
53 CapturedStderr();
54 ~CapturedStderr();
55
56 int fd() const;
57
58 private:
59 void init();
60 void reset();
61
62 TemporaryFile temp_file_;
63 int old_stderr_;
64
65 DISALLOW_COPY_AND_ASSIGN(CapturedStderr);
66};
67
51#endif // ANDROID_BASE_TEST_UTILS_H 68#endif // ANDROID_BASE_TEST_UTILS_H