From: Kefu Chai Date: Wed, 26 Dec 2018 04:58:08 +0000 (+0800) Subject: test: write log file to current directory X-Git-Tag: v13.2.5~33^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3e57c0f640d44236ff5e050c83fab20b6bc31354;p=ceph.git test: write log file to current directory instead of writing log files to '/tmp', write them to current directory. by default, ctest runs the tests in ${CMAKE_CURRENT_BINARY_DIR}, so, in this case, the log files are located in build/src/test/. this ensure that current user has enough previledge to remove the log files. this also allows multiple instances of 'unittest_log' to run in parallel. See-also: http://tracker.ceph.com/issues/36737 Signed-off-by: Kefu Chai (cherry picked from commit a13a6f1d0b39a541896591cd04fc1980bb1acfee) Conflicts: src/log/test.cc: trivial resolution --- diff --git a/src/log/test.cc b/src/log/test.cc index fae67e964fc8e..5b89e7b436970 100644 --- a/src/log/test.cc +++ b/src/log/test.cc @@ -31,7 +31,7 @@ TEST(Log, Simple) Log log(&subs); log.start(); - log.set_log_file("/tmp/foo"); + log.set_log_file("foo"); log.reopen_log_file(); log.set_stderr_level(5, -1); @@ -60,7 +60,7 @@ TEST(Log, ReuseBad) subs.set_gather_level(1, 1); Log log(&subs); log.start(); - log.set_log_file("/tmp/foo"); + log.set_log_file("foo"); log.reopen_log_file(); const int l = 0; @@ -92,7 +92,7 @@ TEST(Log, ManyNoGather) subs.set_gather_level(1, 1); Log log(&subs); log.start(); - log.set_log_file("/tmp/big"); + log.set_log_file("big"); log.reopen_log_file(); for (int i=0; i