summaryrefslogtreecommitdiff
path: root/base/include/android-base/test_utils.h
AgeCommit message (Collapse)Author
2020-05-19Migrate system/core/base to system/libbaseBaligh Uddin
BUG: 148941208 test: TH Change-Id: I1134f1e9e968b9273748e2483bea8d25e5c9e994
2019-12-12base: avoid evaluating macro argument multiple times.Josh Gao
Previously, in the regex test helpers, we would evaluate the haystack expression again to generate the error message, which leads to nonsensical errors if the expression returns a different value on the second call (e.g. functions like dlerror which return null on subsequent calls). Test: bionic-unit-tests with a failure Test: treehugger Change-Id: I2126cefeb45e26638194af8a82d0f2a9d7196edf
2018-11-13base: move TemporaryFile and TemporaryDir to android-base/file.hMark Salyzyn
Allow a wider legitimate audience to use TemporaryFile and TemporaryDir by moving them from android-base/test_utils.h to android-base/file.h. Test: compile Bug: 119313545 Change-Id: Ie558c5873ce5b3937914918b6bfb427e5b61d0da
2018-09-04Add Start/Stop/Reset to CapturedStdFd.Christopher Ferris
Move the fd() function to be private since it should not have been exposed in the first place. Fix the way logging_test uses CapturedXXX. Adding this because the new isolated testing doesn't print errors to stderr so the ASSERT_ EXPECT_ messages can get swallowed. Also, it's easier to reuse a CapturedXXX object in a test with these functions. Test: New unit tests pass. Change-Id: I38b113fc184146ce434802f80a9b7997fa83e78a
2018-06-26libbase: switch to #pragma once.Elliott Hughes
Bug: N/A Test: builds Change-Id: I125498ac4257ac4e901c6f2a5f1bfac1432d859d
2018-05-23Add StdioLogger for command-line tools.Elliott Hughes
Bug: N/A Test: ran tests Change-Id: If366a4ea25aea1becdd3e443eba225e9bd52ebba
2018-03-08base: Add TemporaryFile::DoNotRemove().Yabin Cui
Bug: http://b/73127105 Test: none. Change-Id: I563c12bfb629ddd630568dda4817fb10cc9940a8
2017-12-19base: extract {ASSERT,EXPECT}_MATCH helpers from debuggerd_test.Josh Gao
Add some helper macros that perform regex string matching to <android-base/test_utils.h>. Test: libbase_test32/64 on host Change-Id: I1b0f03dc73f8b4fdfb8ac6c75d59ef421e0e9640
2017-12-06base: allow creating tempfile in a custom temporary dir.Yabin Cui
Bug: http://b/70232908 Test: none. Change-Id: I24b894793f6725186b3582a91db083427e51aa5a
2017-09-11Add the Release function for TemporaryFilesTianjie Xu
Some tests may create a File* by calling fdopen() on the temp file's fd. We should release the ownership of fd in this case to avoid the double close. Bug: 65430057 Test: libbase unit tests pass Change-Id: I54fcce2029f9a574f53afdbdda737ee58620c73a
2016-10-22Move CapturedStderr to test_util libraryWei Wang
Bug: 32181382 Test: run /data/nativetest(64)/binderTextOutputTest Change-Id: Ifb2e1f6af2c3f57b5cbed7dde65efb31253c52a2
2016-03-23Fix <android-base/*.h> header guards.Elliott Hughes
I've been meaning to do this for a while, and it came up on the bug below that there have been conflicts with similar-named files in <base/*.h>, so let's rule out one possible explanation. Bug: http://b/27804373 Change-Id: I69e5d52b6260c573c308513420aee0e281426bd4
2015-12-07Rename base/ to android-base/.Elliott Hughes
Bug: http://b/26023797 Change-Id: Ie6c63bf86bed05faab87d290de6f34d9af3532a8