summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Update CMakeLists.txt (#482)HEADmasterGianfranco Costamagna2023-05-171-1/+5
| | | | | | | | | | | | | | | | | | | | | | * Update CMakeLists.txt Link systemd libraries, to avoid underlinking of tests with -DWITH_SYSTEMD_SOCKET_ACTIVATION=ON [ 82%] Linking CXX executable gtest_dlt_daemon_gateway cd dlt-daemon-2.18.9/obj-x86_64-linux-gnu/tests && /usr/bin/cmake -E cmake_link_script CMakeFiles/gtest_dlt_daemon_gateway.dir/link.txt --verbose=1 /usr/bin/c++ -g -O2 -ffile-prefix-map=dlt-daemon-2.18.9=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -isystem /include -std=gnu++0x -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -rdynamic CMakeFiles/gtest_dlt_daemon_gateway.dir/gtest_dlt_daemon_gateway.cpp.o CMakeFiles/gtest_dlt_daemon_gateway.dir/__/systemd/3rdparty/sd-daemon.c.o -o gtest_dlt_daemon_gateway -Wl,-rpath,dlt-daemon-2.18.9/obj-x86_64-linux-gnu/src/daemon ../src/daemon/libdlt_daemon.so /usr/lib/x86_64-linux-gnu/libgtest.a /usr/lib/x86_64-linux-gnu/libgtest_main.a -lrt /usr/lib/x86_64-linux-gnu/libgtest.a /usr/bin/ld: ../src/daemon/libdlt_daemon.so: undefined reference to `sd_listen_fds_with_names' * Add systemd libs for WITH_SYSTEMD as well and removed deprecated versions Signed-off-by: Michael Methner <mmethner@de.adit-jv.com> --------- Signed-off-by: Michael Methner <mmethner@de.adit-jv.com> Co-authored-by: Michael Methner <mmethner@de.adit-jv.com>
* Update gtest_dlt_daemon_multiple_files_logging.cpp (#481)Gianfranco Costamagna2023-05-051-2/+2
| | | | | | | | | | | | | | | | | | | Fix build error due to dlt_vlog not having the correct format string with security build flags enabled [ 88%] Building CXX object tests/CMakeFiles/gtest_dlt_daemon_multiple_files_logging.dir/gtest_dlt_daemon_multiple_files_logging.cpp.o cd dlt-daemon-2.18.9/obj-x86_64-linux-gnu/tests && /usr/bin/c++ -DCONFIGURATION_FILES_DIR=\"/etc\" -DDLT_DAEMON_USE_FIFO_IPC -DDLT_LIB_USE_FIFO_IPC -DDLT_NETWORK_TRACE_ENABLE -DDLT_SYSTEMD_ENABLE -DDLT_SYSTEMD_JOURNAL_ENABLE -DDLT_UNIT_TESTS -DDLT_USER_IPC_PATH=\"/tmp\" -DDLT_USE_IPv6 -DEXTENDED_FILTERING -D_GNU_SOURCE -Idlt-daemon-2.18.9 -Idlt-daemon-2.18.9/obj-x86_64-linux-gnu/include/dlt -Idlt-daemon-2.18.9/include/dlt -Idlt-daemon-2.18.9/src/shared -Idlt-daemon-2.18.9/src/core_dump_handler -Idlt-daemon-2.18.9/src/offlinelogstorage -Idlt-daemon-2.18.9/src/lib -Idlt-daemon-2.18.9/src/daemon -Idlt-daemon-2.18.9/src/console -Idlt-daemon-2.18.9/src/gateway -Idlt-daemon-2.18.9/systemd/3rdparty -g -O2 -ffile-prefix-map=dlt-daemon-2.18.9=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -isystem /include -std=gnu++0x -std=gnu++11 -Wall -Wextra -Wno-variadic-macros -Wno-strict-aliasing -DGTEST_HAS_PTHREAD=1 -MD -MT tests/CMakeFiles/gtest_dlt_daemon_multiple_files_logging.dir/gtest_dlt_daemon_multiple_files_logging.cpp.o -MF CMakeFiles/gtest_dlt_daemon_multiple_files_logging.dir/gtest_dlt_daemon_multiple_files_logging.cpp.o.d -o CMakeFiles/gtest_dlt_daemon_multiple_files_logging.dir/gtest_dlt_daemon_multiple_files_logging.cpp.o -c dlt-daemon-2.18.9/tests/gtest_dlt_daemon_multiple_files_logging.cpp dlt-daemon-2.18.9/tests/gtest_dlt_daemon_multiple_files_logging.cpp: In member function ‘virtual void t_dlt_logging_multiple_files_append_reinit_normal_Test::TestBody()’: dlt-daemon-2.18.9/tests/gtest_dlt_daemon_multiple_files_logging.cpp:106:13: error: format not a string literal and no format arguments [-Werror=format-security] 106 | dlt_vlog(LOG_INFO, log1); | ~~~~~~~~^~~~~~~~~~~~~~~~ dlt-daemon-2.18.9/tests/gtest_dlt_daemon_multiple_files_logging.cpp:110:13: error: format not a string literal and no format arguments [-Werror=format-security] 110 | dlt_vlog(LOG_INFO, log2); | ~~~~~~~~^~~~~~~~~~~~~~~~ In file included from /usr/include/string.h:535, from /usr/include/gtest/internal/gtest-port.h:264, from /usr/include/gtest/internal/gtest-internal.h:40, from /usr/include/gtest/gtest.h:62, from dlt-daemon-2.18.9/tests/gtest_dlt_daemon_multiple_files_logging.cpp:27: In function ‘strncpy’,
* logstorage: Adds option to write logs in gzip format (#442)Linus Probert2023-04-192-6/+137
| | | | | | | | | | * logstorage: Adds option to write logs in gzip format Adds functionality to allow storing offline logs in gzipped files instead of standard dlt files. * Ensure tests run safely with or without GZIP compression enabled * Enforce minimum version of zlib if enabling gzip compression
* logfile: exhance internal dlt logging by introducing size limits (#369)Daniel Weber2023-03-102-2/+281
| | | | | | | | | | | Enhance dlt logging such that multiple files are used as it is done for the offline traces. Add limit-specific config values for logging. For this purpose the pattern of index-based file names is used only. This approach of logging to multiple files and rotating in order to keep the limits ensures that dlt logs take care of available space on the underlying file system and do not grow infinitely. Signed-off-by: Daniel Weber <daniel.w.weber@daimler.com> Co-authored-by: Oleg Tropmann <oleg.tropmann@daimler.com>
* dlt-user: Fix crashes in dlt_free during dlt_init (#362)Alexander Mohr2023-01-111-0/+87
| | | | | | | | | If dlt_free is called while dlt_init is running, the dlt-user library crashes because the init and free where not thread safe. This commit introduces a new field dlt_user_initialising which will prevent entering dlt_free while dlt_init is running. Correctness is ensured by a unit test Signed-off-by: Alexander Mohr <alexander.m.mohr@mercedes-benz.com>
* Avoid memory corruption behind buffer wp in function ↵michael-methner2022-10-111-0/+92
| | | | | | | | | | | | dlt_getloginfo_conv_ascii_to_id (#411) * Avoid memory corruption behind buffer wp in function dlt_getloginfo_conv_ascii_to_id - Introduced new function dlt_getloginfo_conv_ascii_to_string for '\0' terminated strings - Avoid printing garbage characters in dlt-control after APID and CTID (which are not null terminated anymore) - Added unit test for dlt_client_parse_get_log_info_resp_text and dlt_getloginfo_conv_ascii_to_string - Use dlt_getloginfo_conv_ascii_to_string to get '\0' terminated for app_description and context_description Signed-off-by: Michael Methner <mmethner@de.adit-jv.com>
* tests: Deplicate unused files and variables (#359)Saya Sugiura2021-12-232-3/+0
| | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* Support for Cygwin toolchain. (#351)DoctorNoobingstoneIPresume2021-11-151-1/+1
| | | | | | Also tested with the latest version running on Windows XP (gcc-5.4.0) (http://www.crouchingtigerhiddenfruitbat.org/cygwin/timemachine.html). Signed-off-by: Adder <adder_2003@yahoo.com>
* gtest_dlt_daemon_gateway: fix gtest build failedLe-Tin2021-10-053-8/+15
| | | | | | | | Add gtest and gtest_main libraries if we don't install gtest package in system Create a new message fillter config file when running gtest gateway shell script set type of control message is CONTROL_MESSAGE_ON_DEMAND when testing dlt_gateway_send_control_message function Signed-off-by: Le-Tin <Tin.Le@vn.bosch.com>
* gtest: Bring-in changesSaya Sugiura2021-10-054-28/+76
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* gtest: Rework WORKING_DIRECTORYSaya Sugiura2021-10-051-8/+5
| | | | | | | testfile.dlt was not detected correctly with ctest, so corrected WORKING_DIRECTORY accordingly. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* gtest: Correct data amount in gtest_dlt_commonSaya Sugiura2021-10-051-14/+18
| | | | | | | gtest_dlt_common was failing when ring buffer size was modified. Amount of data to be written is corrected in the test code. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* gtest: Refactor tests/CMakeLists.txtSaya Sugiura2021-10-053-238/+68
| | | | | | | | This also removed following tests to more appropriate place: - dlt-test-preregister-context.c - dlt-test-cpp-extension.cpp Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* tests: Adapt to DLT_DISABLE_MACROSaya Sugiura2021-10-052-0/+2
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* gtest: Change script name to gtest_dlt_daemon_offline_log.shSaya Sugiura2021-10-051-0/+0
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* Implemention of tests for the dlt-qnx-system modulessugiura2021-10-051-0/+280
| | | | | | | | Following files are added to execute and verify the behavior of dlt-qnx-system module: - dlt-test-qnx-system: A test binary to send log messages to slogger2 with specific number of log messages, delay, and payload length. - start-qnx-system-test: A shell script to invoke the test execution and verify its result from received DLT log. Signed-Off By: Saya Sugiura <ssugiura@jp.adit-jv.com>
* console: provides args option to enable send/receive serial headerVo Trung Chi2021-10-051-1/+21
| | | | | | | Provides argument option to enable send and resync serial header via command line. Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
* dlt_common: correct read/write positionDinh Cong Toan2021-06-301-4/+31
| | | | | | | | | In dlt_buffer_read_block() and dlt_buffer_write_block(), read/write position should be updated in case these positions are equal to the size of ringbuffer. Adding boundary check in gtest_dlt_common.cpp Signed-off-by: Dinh Cong Toan <toan.dinhcong@vn.bosch.com>
* Alternative solutions for json-c dependencyBiastoch, Darian (ADITG/ESM)2021-06-303-75/+89
| | | | | | | json-c dependency was removed from libdlt ('dlt_common') and shifted into 'dlt-control-common'. By this only the command line tools have a dependency on json-c. dlt-control-common is now built as a static library, so that it can be linked against json-c. Command line tools that included only the .c file of dlt-control-common before, are now linked against this static libarary (see console/CMakeLists.txt). Signed-off-by: dbiastoch <dbiastoch@de.adit-jv.com>
* dlt-receive: Implemented gtest for extended filteringdbiastoch2021-06-304-0/+92
| | | | | | | | -Added 'testfile_extended.dlt', which extends the default 'testfile.dlt' by messages with very different lenghts, log levels, ContextIDs and AppIDs -Added 'testfilter.json', which contains a valide json filter file -Implemented gtest 't_dlt_message_print_ascii_with_json_filter' in 'gtest_dlt_common.cpp' to test the correct behavior of extended filtering and the json filter file parsing Signed-off-by: dbiastoch <dbiastoch@de.adit-jv.com>
* Add missing string functions (#309)Martin Willers2021-05-311-0/+209
| | | Signed-off-by: Martin Willers <M.Willers@gmx.net>
* Make nonverbose mode non exclusive (#300)Martin Willers2021-05-171-0/+39
| | | | | | | | | | | | | | | | * Make Non-Verbose mode non-exclusive Switching to global Non-Verbose mode now does not force Verbose messages to also be sent as Non-Verbose ones anymore. That would not make any sense, because Verbose messages don't have a MessageId and thus are all getting the same MessageId of 65535. Instead, setting global "Non-Verbose" mode will allow both Verbose and Non-Verbose messages to be sent in a single session. The "Verbose-APIs" (e.g. dlt_user_log_write_start()) will then only write Verbose messages, whereas the "Non-Verbose APIs" (e.g. dlt_user_log_write_start_id()) will then only write Non-Verbose messages. Signed-off-by: Martin Willers <M.Willers@gmx.net>
* Add verbose mode attribute handling (#292)Martin Willers2021-03-161-0/+515
| | | | | | dlt_user_log_write_*_attr() enables to writing these types, but also support adding "attributes" for them, i.e. a "name" and a "unit". Signed-off-by: Martin Willers <M.Willers@gmx.net>
* gtest_dlt_common: fix seg fault when using memcpy().Dinh Cong Toan2021-01-061-0/+2
| | | | | | | | - Checking size of buffer and size of message before using memcpy(). - Adding configuration file for testfilter in /tests/CMakeLists.txt. Signed-off-by: Dinh Cong Toan <toan.dinhcong@vn.bosch.com>
* gtest: Include necessary headerssugiura2021-01-061-99/+17
| | | | | | | | | This commit includes following headers which defines maximum and minimum value. - stdint.h - float.h Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* logstorage: Update unit testSaya Sugiura2021-01-061-15/+166
| | | | | | | | | | Following functions are updated due to interface and structure changes: - dlt_logstorage_sort_file_name - dlt_logstorage_rearrange_file_name - dlt_logstorage_prepare_on_msg Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com> Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
* Add support for logging with VSOCK (#255)Martin Ejdestig2020-12-141-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For more information about VSOCK, see "man vsock" ( https://man7.org/linux/man-pages/man7/vsock.7.html ). Makes it possible for processes in a virtual machine to log directly in DLT running on host without setting up a network connection between guest and host. It is also probably more efficient. Have not done any performance measurements (not main reason for patch), but no forwarding is required as when running DLT in a multi-node setup. When building dlt-daemon for host, WITH_DLT_DAEMON_VSOCK_IPC should be enabled for daemon to listen on incoming VSOCK requests. Local communication method between applications and daemon is still determined with DLT_IPC. When building for guest, WITH_DLT_LIB_VSOCK_IPC should be enabled and DLT_IPC will be ignored, which will make libdlt open a VSOCK socket to the deamon for logging messages. VSOCK can be tested without a virtual machine. Since VMADDR_CID_HOST is used by libdlt when connecting, see vsock man page, clients can be run on host to test VSOCK communication. Some modifications has been done to be able to handle logging through FIFO pipe and socket in the same build of dlt-daemon: - dlt_receiver_init/free_unix_socket() is renamed to dlt_receiver_init/free_global_buffer() and used for FIFO as well. Also fixes memory leak since dlt_receiver_free_unix_socket() was used regardless of whether DLT_USE_UNIX_SOCKET was defined or not. - Pass type to dlt_receiver_init() instead of dlt_receiver_receive(). And remove preprocessor conditionals for handling DLT_CONNECTION_APP_MSG in dlt_daemon_process_user_messages(). Also fixes wrong enum type being passed to dlt_receiver_receive() in dlt_client.c (DltClient::mode was used as a DltReceiverType enum but it is a DltClientMode enum). - Add a flag to DltDaemonApplication to indicate whether file descriptor is "owned" by the DltDaemonApplication or not. When dlt_daemon_application_add() is called due to message received on a socket, fd is passed as an argument (app does not own fd). For FIFO, a per application FIFO is opened (app owns the fd). Also fixes so that user handle is reset for both application and all its contexts when resetting any. Prevents fd from being used by accident after it has been closed. dlt_mkdir_recursive() is moved to src/daemon since it is only used in the daemon. Minimizes use of DLT_USE_UNIX_SOCKET_IPC. Other bugfixes: - Call DLT_SEM_FREE() if setting socket to O_NONBLOCK fails in src/lib/dlt_user.c:dlt_initialize_socket_connection(). - Close socket if dlt_receiver_init() fails in src/lib/dlt_user.c:dlt_initialize_socket_connection(). Signed-off-by: Martin Ejdestig <martin.ejdestig@volvocars.com>
* Avoid memory access errors with 4-chars context ids (#250)Martin Willers2020-11-171-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | For a 4-chars CTXID, i.e. one that does not include a null character, the strlen() calls were happily accessing memory until they eventually encountered a null character somewhere in memory. This was detected by valgrind, which reported a memory error when using a CTXID such as "INTM": ==21924== Conditional jump or move depends on uninitialised value(s) ==21924== at 0x4C30F78: strlen (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==21924== by 0x4E4B5A0: dlt_print_id (dlt_common.c:303) ==21924== by 0x4E4CF47: dlt_message_header_flags (dlt_common.c:687) ==21924== by 0x4E51434: dlt_message_print_ascii (dlt_common.c:3169) ==21924== by 0x4E4247A: dlt_user_print_msg (dlt_user.c:4108) ==21924== by 0x4E46D92: dlt_user_log_send_log (dlt_user.c:3670) ==21924== by 0x4E46F14: dlt_user_log_write_finish (dlt_user.c:1611) Sanitize some code Using memset() and memcpy() is always preferable to hand-rolled loops, because compilers have built-in support for them. Signed-off-by: Martin Willers <M.Willers@gmx.net>
* dlt_offline: fix build failures with gcc-10 (#245)Gianfranco Costamagna2020-09-011-0/+1
| | | | | | | | | | | | | | | see bug report: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=957140 /usr/bin/ld: CMakeFiles/dlt-daemon.dir/dlt_daemon_client.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: multiple definition of `g_logstorage_cache_max'; CMakeFiles/dlt-daemon.dir/dlt-daemon.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: first defined here /usr/bin/ld: CMakeFiles/dlt-daemon.dir/dlt_daemon_common.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:118: multiple definition of `g_logstorage_cache_size'; CMakeFiles/dlt-daemon.dir/dlt-daemon.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:118: first defined here /usr/bin/ld: CMakeFiles/dlt-daemon.dir/dlt_daemon_common.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: multiple definition of `g_logstorage_cache_max'; CMakeFiles/dlt-daemon.dir/dlt-daemon.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: first defined here /usr/bin/ld: CMakeFiles/dlt-daemon.dir/dlt_daemon_connection.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:118: multiple definition of `g_logstorage_cache_size'; CMakeFiles/dlt-daemon.dir/dlt-daemon.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:118: first defined here /usr/bin/ld: CMakeFiles/dlt-daemon.dir/dlt_daemon_connection.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: multiple definition of `g_logstorage_cache_max'; CMakeFiles/dlt-daemon.dir/dlt-daemon.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: first defined here /usr/bin/ld: CMakeFiles/dlt-daemon.dir/dlt_daemon_event_handler.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:118: multiple definition of `g_logstorage_cache_size'; CMakeFiles/dlt-daemon.dir/dlt-daemon.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:118: first defined here /usr/bin/ld: CMakeFiles/dlt-daemon.dir/dlt_daemon_event_handler.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: multiple definition of `g_logstorage_cache_max'; CMakeFiles/dlt-daemon.dir/dlt-daemon.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: first defined here /usr/bin/ld: CMakeFiles/dlt-daemon.dir/dlt_daemon_offline_logstorage.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: multiple definition of `g_logstorage_cache_max'; CMakeFiles/dlt-daemon.dir/dlt-daemon.c.o:./obj-x86_64-linux-gnu/src/daemon/./src/offlinelogstorage/dlt_offline_logstorage.h:116: first defined here Signed-off-by: Gianfranco Costamagna <costamagnagianfranco@yahoo.it> Signed-off-by: Gianfranco Costamagna <locutusofborg@debian.org>
* remove unused featureKHANH LUONG HONG DUY2020-07-061-4/+0
| | | | Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
* gtest_dlt_daemon_gateway: correct comparison operator syntaxLUONG HONG DUY KHANH(RBVH/ENG42)2020-07-061-2/+2
| | | | Signed-off-by: LUONG HONG DUY KHANH(RBVH/ENG42) <KHANH.LUONGHONGDUY@vn.bosch.com>
* UT: Fix segfault in logstorage testBui Nguyen Quoc Thanh2020-07-061-0/+1
| | | | Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
* execute unittests with cmakeFelix Herrmann2020-07-061-13/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | now you can do make test after make :) === Sample build and test: $ cmake -Bbuild -H. \ -DDLT_IPC=UNIX_SOCKET \ -DWITH_DLT_ADAPTOR=ON \ -DWITH_DLT_UNIT_TESTS=ON \ -DWITH_DLT_CXX11_EXT=ON \ -DWITH_DLT_MONITOR=OFF \ -DWITH_DLT_USE_IPv6=OFF $ cd build $ make $ make test Running tests... Test project /home/fherrmann/git/dlt-daemon/build Start 1: gtest_dlt_common 1/5 Test #1: gtest_dlt_common ................. Passed 0.02 sec Start 2: gtest_dlt_user 2/5 Test #2: gtest_dlt_user ................... Passed 1.01 sec Start 3: gtest_dlt_daemon_common 3/5 Test #3: gtest_dlt_daemon_common .......... Passed 0.01 sec Start 4: dlt_env_ll_unit_test 4/5 Test #4: dlt_env_ll_unit_test ............. Passed 0.04 sec Start 5: gtest_dlt_daemon_event_handler 5/5 Test #5: gtest_dlt_daemon_event_handler ... Passed 1.01 sec 100% tests passed, 0 tests failed out of 5 Total Test time (real) = 2.09 sec === Signed-off-by: Felix Herrmann <fherrmann@de.adit-jv.com> Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
* unittest: Update according to API's changesBui Nguyen Quoc Thanh2020-07-061-10/+20
| | | | | | | | Updates for two changed API: - dlt_logstorage_open_log_file - dlt_logstorage_prepare_on_msg Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
* network trace: Add mqueue verificationSaya Sugiura2020-07-062-2/+3
| | | | | | | | | | There is some OS (e.g. Android) which doesn't support message queue. Since network trace uses it as IPC, we need to disable it if following calls are not available: mq_open, mq_close, mq_unlink, mq_send, mq_receive Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com> Signed-off-by: KHANH LUONG HONG DUY <khanh.luonghongduy@vn.bosch.com>
* Unittest for new apiBui Nguyen Quoc Thanh2020-07-061-1/+55
| | | | | | | Add two new testcases in tests/gtest_dlt_common.cpp for dlt_file_quick_parsing() Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
* Redirect stdout to stderrLUONG HONG DUY KHANH(RBVH/ENG42)2020-07-061-4/+10
| | | | | | | | | | | | - daemon: New feature for LoggingMode at /etc/dlt.conf to be able to set value at 3 in order to redirect all stdout messages to stderr. - libdlt: New feature for DLT_LOG_MODE environment variable to be able to set value at 3 in order to redirect all stdout messages to stderr. - unit test: Add test cases for DLT_LOG_TO_STDERR Signed-off-by: LUONG HONG DUY KHANH(RBVH/ENG42) <KHANH.LUONGHONGDUY@vn.bosch.com>
* Unittest: Update testcaseBui Nguyen Quoc Thanh2020-07-062-2/+16
| | | | | | | | | gtest_dlt_daemon_gateway is updated to test for both cases: "With and Without General section in dlt_gateway.conf" Timeout=0 is now endless retry. So change it to "-1" Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* tests: remove unused zlib includeFelix Herrmann2020-07-061-1/+0
| | | | | | | Include in dlt-test-receiver introduces zlib dependency. It can be removed as it is not used. Signed-off-by: Felix Herrmann <fherrmann@de.adit-jv.com>
* Add unit tests for new sized string functionsMartin Willers2020-05-181-0/+100
| | | | Signed-off-by: Martin Willers <M.Willers@gmx.net>
* Avoided Seg fault in dlt_message_payload (#179) (#181)Vo Trung Chi2019-11-141-42/+29
| | | | | | | | | * Avoided Seg fault in dlt_message_payload (#179) Avoided Seg fault by adding boundary check before buffer access. Signed-off-by: Ravi Sankar P <ponnurangamravi.sankar@in.bosch.com> Signed-off-by: Vo Trung Chi <chi.votrung@vn.bosch.com>
* Add user custom timestamp interfaceSebastian Unger2019-09-131-0/+20
| | | | | | | | | | | | | Two new macros are introduced so that users can use their customized timestamps for DLT messages: - DLT_LOG_TS(CONTEXT, LOGLEVEL, TS, ARGS ...) - DLT_LOG_ID_TS(CONTEXT, LOGLEVEL, MSGID, TS, ARGS ...) Detailed explanations can be found in dlt_for_developers.md. Also a new option is added to dlt-system to use events' timestamps from journald adapter. Signed-off-by: Sebastian Unger <sunger@de.adit-jv.com>
* libdlt: truncate the log message if it is too long (#156) (#157)Vo Trung Chi2019-09-021-5/+1314
| | | | | | | | | | | | Change the behavior of dlt_user_log_write_string, dlt_user_log_write_constant_string and dlt_user_log_write_utf8_string so that they truncate the incoming message if it is too big and add "Message truncated, too long" at the end of it. These function should anyway still return an DLT_RETURN_USER_BUFFER_FULL error in this case. Signed-off-by: Nguyen Dinh Thi (RBVH/ENG2) <Thi.NguyenDinh@vn.bosch.com> Signed-off-by: Vo Trung Chi <chi.votrung@vn.bosch.com>
* using POSIX shared memory APIs (#90) (#151)Vo Trung Chi2019-08-013-1/+89
| | | | | Replace all Linux specific shared memory APIs with POSIX alternatives. Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
* doxygen: Align variable for apid and ctidSaya Sugiura2019-07-192-10/+10
| | | | | | | The variables used for application id and context id are aligned with "apid" and "ctid". Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* doxygen: Remove licenceSaya Sugiura2019-07-1912-24/+0
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* cmake-improvements (#135)Vo Trung Chi2019-07-031-10/+4
| | | | | | | | | | | | | | | 1. Allow building as a subproject of another cmake project (CMAKE_* vs PROJECT_* variables) 2. Do not generate header files within source – bad practice, use build directory for that(e.g. change location where dlt_version.h is being generated) 3. Use add_compile_options() instead of *_C/CXX_FLAGS variables for proper compile environment definition, also bad practice, also see p.2 4. Add WITH_DLT_PKGCONFIG – add generate pkgconfig .pc files as switchable option, should probably be part of headers install routine. Signed-off-by: Radoslaw Kaczorowski <external.radoslaw.kaczorowski@bosch-softtec.com>
* gtest: Logstorage unit test updateSaya Sugiura2019-06-181-102/+58
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* Unit test: Fix compiler warningsSaya Sugiura2019-06-111-40/+97
| | | | | | Fix the warnings from -Wmissing-field-initializers. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* Unit test fixBui Nguyen Quoc Thanh2019-06-102-1/+28
| | | | | | | | | | - Initialize variables in gtest_dlt_daemon_gateway.cpp to avoid unexpected error - Support FIFO mode in connectServer() in gtest_dlt_daemon_offline_log - Do not fork a child process in gtest_dlt_daemon_offline_log if DLT_IPC is not UNIX_SOCKET Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>