diff options
Diffstat (limited to 'test/log')
-rw-r--r-- | test/log/log_api.cpp | 2 | ||||
-rw-r--r-- | test/log/log_process.cpp | 14 | ||||
-rw-r--r-- | test/log/meson.build | 10 |
3 files changed, 15 insertions, 11 deletions
diff --git a/test/log/log_api.cpp b/test/log/log_api.cpp index 53118960..0b999738 100644 --- a/test/log/log_api.cpp +++ b/test/log/log_api.cpp @@ -2,7 +2,7 @@ /* * Copyright (C) 2019, Google Inc. * - * log.cpp - log API test + * log API test */ #include <algorithm> diff --git a/test/log/log_process.cpp b/test/log/log_process.cpp index 966b80cf..9609e23d 100644 --- a/test/log/log_process.cpp +++ b/test/log/log_process.cpp @@ -2,7 +2,7 @@ /* * Copyright (C) 2019, Google Inc. * - * log_process.cpp - Logging in isolated child process test + * Logging in isolated child process test */ #include <fcntl.h> @@ -81,12 +81,13 @@ protected: return TestFail; } - timeout.start(200ms); + timeout.start(2s); while (timeout.isRunning()) dispatcher->processEvents(); if (exitStatus_ != Process::NormalExit) { - cerr << "process did not exit normally" << endl; + cerr << "process did not exit normally: " << exitStatus_ + << endl; return TestFail; } @@ -115,8 +116,11 @@ protected: close(fd); string str(buf); - if (str.find(message) == string::npos) + if (str.find(message) == string::npos) { + cerr << "Received message is not correct (received " + << str.length() << " bytes)" << endl; return TestFail; + } return TestPass; } @@ -136,7 +140,7 @@ private: ProcessManager processManager_; Process proc_; - Process::ExitStatus exitStatus_; + Process::ExitStatus exitStatus_ = Process::NotExited; string logPath_; int exitCode_; int num_; diff --git a/test/log/meson.build b/test/log/meson.build index ac87841a..2298ff84 100644 --- a/test/log/meson.build +++ b/test/log/meson.build @@ -1,15 +1,15 @@ # SPDX-License-Identifier: CC0-1.0 log_test = [ - ['log_api', 'log_api.cpp'], - ['log_process', 'log_process.cpp'], + {'name': 'log_api', 'sources': ['log_api.cpp']}, + {'name': 'log_process', 'sources': ['log_process.cpp']}, ] -foreach t : log_test - exe = executable(t[0], t[1], +foreach test : log_test + exe = executable(test['name'], test['sources'], dependencies : libcamera_private, link_with : test_libraries, include_directories : test_includes_internal) - test(t[0], exe, suite : 'log') + test(test['name'], exe, suite : 'log') endforeach |