summaryrefslogtreecommitdiff
path: root/base/test_utils.cpp
AgeCommit message (Collapse)Author
2020-05-19Migrate system/core/base to system/libbaseBaligh Uddin
BUG: 148941208 test: TH Change-Id: I1134f1e9e968b9273748e2483bea8d25e5c9e994
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-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-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
2017-02-13libbase: fix the way to find temp dir.Yabin Cui
Tests running in app context can't access /data/local/tmp, so try current directory if /data/local/tmp is not accessible. Bug: http://b/18790309 Test: run unit test in app context and shell context. Change-Id: If66fe8f0ac3edb3a32a2a2a50a524364f818a58b
2016-10-22Move CapturedStderr to test_util libraryWei Wang
Bug: 32181382 Test: run /data/nativetest(64)/binderTextOutputTest Change-Id: Ifb2e1f6af2c3f57b5cbed7dde65efb31253c52a2
2016-02-17Remove libbase's libutils dependency.Elliott Hughes
Yuck. Change-Id: If84758f25bc15d5b1a732eaccc226385f51cac13
2015-12-04Track rename of base/ to android-base/.Elliott Hughes
Change-Id: Idf9444fece4aa89c93e15640de59a91f6e758ccf
2015-09-01adb/base win32 tests: fix comment and open() flagsSpencer Low
Match base's use of O_BINARY. Change-Id: I930b5c8fddde20966580069f2e681b99cb26f1a3 Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-08-03libbase_test: win32: get some tests workingSpencer Low
* Get it building on Win32 by implementing mkstemp() and mkdtemp(). * Run StringPrintf %z test on Windows because it passes because we build with __USE_MINGW_ANSI_STDIO which implements %z. Change-Id: Ia01f94e8258503381a1df6d3da6e40de59e57125 Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-07-30Write mkdirs in more idiomatic C++ style.Alex Vallée
~ Rewrote mkdirs to be in C++ style. ~ Replaced adb_dir{start,stop} with std::string params and (r)find. + Added test for mkdirs. Also make base/test_utils.h public and support temporary directories as well as files. Change-Id: I6fcbdc5e0099f3359d3aac6b00c436f250ca1329
2015-04-29Get libbase tests working on Windows.Dan Albert
Tests using files from /proc still fail on Windows (obviously), but all tests are passing when run in Wine. Change-Id: Ie4c3ba65b642202f8fcaec73332a53bee6115fba
2015-03-20Add google3 style logging to libbase.Dan Albert
ART already had a flavor of this, but it was specialized for their use case a bit. Note that the logging.* tests are currently disabled for the device because there is no good way to capture the output of liblog. We can make something that will execute logcat and then then scan the output, but that's messy. Since we know it at least works on the host, we can add better device tests later. Change-Id: I47acd87a3312c0a5285b03f9c8dadef0c669f06a