summaryrefslogtreecommitdiff
path: root/src/tests
Commit message (Collapse)AuthorAgeFilesLines
* tests: add stdlib to dlt_cpp_extensionDarian Biastoch2021-10-051-0/+1
| | | | | | | | | Adding stdlib.h into dlt-test-cpp-extension.cpp solves the compile issue: dlt-test-cpp-extension.cpp:89:47: error: 'malloc' was not declared in this scope char *non_const_string = (char *)malloc(17); This occoured while building for QNX. Signed-off-by: Darian Biastoch <dbiastoch@de.adit-jv.com>
* gtest: Refactor tests/CMakeLists.txtSaya Sugiura2021-10-053-0/+179
| | | | | | | | 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-051-0/+4
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* tests: Add new test case with given bufferSaya Sugiura2021-10-051-25/+235
| | | | | | | | | New test case is added in dlt-test-user to verify the behavior of dlt_user_log_write_start_w_given_buffer() and dlt_user_log_write_finish_w_given_buffer(). Currently macro usage is not supported, so empty test case is added for macro test. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* tests: Enable macro disablingSaya Sugiura2021-10-056-90/+134
| | | | | | | | | | This commit introduces new cmake option "WITH_DLT_DISABLE_MACRO" to disable macro usage in case it is not allowed. Currently this is adapted to src/tests and src/examples only. for dlt-test-non-verbose, the build itself is currently disabled if WITH_DLT_DISABLE_MACRO is set; this needs to be enabled again in future by replacing or adding function usage. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* Implemention of tests for the dlt-qnx-system modulessugiura2021-10-052-0/+145
| | | | | | | | 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-053-3/+63
| | | | | | | 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 message header brokenDinh Cong Toan2021-06-301-1/+1
| | | | | | | | | | | | | This commit is to revert the following commits: - de4a4234 - fb9ff078 - db9917b3 - e4467f0e - a567e01d Those commits are from improvement but they seem to break the dlt message header in some cases. Signed-off-by: Bui Nguyen Quoc Thanh <thanh.buinguyenquoc@vn.bosch.com>
* dlt_client_main_loop running in an infinite loop restricts graceful exit of ↵Sreeharsha Ramanavarapu2021-01-081-1/+30
| | | | | | | | | | | | | | | | | | | | | | | DLT Client code (#284) Issue: ------ dlt_client_main_loop currently uses an infinite loop ("while (1)"). This creates problems when a DLT client is running in a thread as part of a larger application. Graceful exit (for example: during object destruction) is not possible because a thread is running dlt_client_main_loop in the background. It is also not possible to exit the client, if we want it to fetch only a pre-decided number of messages. Solution: --------- Allow user to define a callback function to check whether the next message should be fetched. dlt-test-client.c has a new option to fetch a pre-decided number of messages, after which the client will exit. Signed-off-by: Sreeharsha Ramanavarapu <sreeharsha.r@gmail.com>
* other: fix remaining conversion warningsDinh Cong Toan2021-01-061-1/+1
| | | | | | | | | | | - Converting datatype to the correct one. - As macro do not perform type-checking before, so these functions used it with different datatype could create a lot of conversion warnings. For this reason, these warnings could be consider as normal information and will not be fixed. Signed-off-by: Dinh Cong Toan <toan.dinhcong@vn.bosch.com>
* tests: fix conversion warningsiod1hc2021-01-069-55/+55
| | | | | | - Casting data type to the right format. Signed-off-by: Dinh Cong Toan <Toan.DinhCong@vn.bosch.com>
* network trace: Include necessary headersSaya Sugiura2020-07-063-6/+0
| | | | | | | | | | | Some components which links dlt seem to depend on following headers, which will be included by mqueue.h. - sys/types.h - fcntl.h So explicitly include them if mqueue interface is not supported in dlt_user.h. Also two headers are removed if dlt_used.h is included. Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* network trace: Add mqueue verificationSaya Sugiura2020-07-061-0/+48
| | | | | | | | | | 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>
* dlt-test-init-free: fix build failure with strict compiler flags, due to ↵Gianfranco Costamagna2020-01-271-2/+2
| | | | | | | | | uint being undefined. This is actually an "int" type, looking at the test implementation Signed-off-by: Gianfranco Costamagna <costamagnagianfranco@yahoo.it> Signed-off-by: Gianfranco Costamagna <locutusofborg@debian.org>
* Avoided Seg fault in dlt_message_payload (#179) (#181)Vo Trung Chi2019-11-141-10/+10
| | | | | | | | | * 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>
* lib: Disable extended header in non verbose mode by env varOnkar Palkar2019-09-132-0/+503
| | | | | | | dlt-test-non-verbose test application is also added. Signed-off-by: Onkar Palkar <onkar.palkar@wipro.com> Signed-off-by: S. Hameed <shameed@jp.adit-jv.com>
* dlt-test: Add message length optionBui Nguyen Quoc Thanh2019-09-132-5/+45
| | | | | | | | | | | | | New option is introduced for binary dlt-test-multi-process. It is used to specify the length of message to be sent. By default, when no length is specified, the current sample message will be sent. It is also used in dlt-test-multi-process-client. Also fixes: - Legacy bug: MAX_THREADS instead of MAX_PROCS - Correct coding style Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* Add user custom timestamp interfaceSebastian Unger2019-09-131-4/+82
| | | | | | | | | | | | | 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>
* Correct sa findingsSaya Sugiura2019-07-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dlt_offline_logstorage.c - Parameter to isdigit is not correct - Handle the size of memset() and strncpy() properly dlt-test-stress-user.c - Parameter d is duplicated dlt_env_ll.c - Parameter env is used before NULL check - Remove redundant line dlt-control-common.c dlt_daemon_event_handler.c - Do not use NULL variable to print log dlt_config_file_parser.c - Remove unnecessary loop dlt_daemon_client.c - Return error in NULL check dlt_user.c - Free allocated memory in error case Related commit: 5c8f88d logstorage: fix compile error Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* doxygen: Align variable for apid and ctidSaya Sugiura2019-07-191-4/+4
| | | | | | | 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-57/+33
| | | | | | | | | | | | | | | 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>
* dlt-test: Improve context IDBui Nguyen Quoc Thanh2019-06-181-14/+37
| | | | | | | | | New option for binary dlt-test-multi-process. The format of context id is constructed based on appId. Previously, context id is generated randomly. Now test binary can support below testcase: - Multiple apps can share the same context id. Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* dlt-test: Add optionsBui Nguyen Quoc Thanh2019-06-181-2/+45
| | | | | | | Support two options for dlt-test-filestransfer to specify the absolute path to tested files. Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* network trace: Define package ID macroSaya Sugiura2019-06-181-8/+8
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* test: Add manual interruption in dlt-test-stressBui Nguyen Quoc Thanh2019-06-181-7/+21
| | | | | | | - Add an environment variable to handle interruption of test. - By default, test1 won't wait for manual interruption anymore. Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
* POSIX: Replace usleep with nanosleepSaya Sugiura2019-05-063-10/+31
| | | | Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
* libdlt: Do not allow DLT usage in forked child (#95)Simon Herkenhoff2019-02-041-6/+16
| | | | | | | | | | | | | DLT shall not be used in a forked child until a variant of exec() is called, because DLT is using non async-signal-safe functions. The forking process can continue to use libdlt's logging facilities, but any attempt to use libdlt from the forked child will be denied. The fork-handler test is updated to reflect this by trying to log from the forked child which will fail. The fork then calls exec and runs another application that can continue to use DLT. Signed-off-by: Simon Herkenhoff <sherkenhoff@jp.adit-jv.com>
* Code beautification using uncrustifyChristoph Lipka2018-12-2110-2548/+2110
| | | | Signed-off-by: Christoph Lipka <clipka@de.adit-jv.com>
* Cleanup of unit test fixesManikandan C2018-12-211-0/+3
| | | | Signed-off-by: Manikandan C <mchockalingam@de.adit-jv.com>
* UnitTest: UpdatesManikandanC2018-12-211-15/+14
| | | | | | | | | | | | Gateway Logstorage Event Handler Signed-off-by: Christoph Lipka <clipka@de.adit-jv.com> Signed-off-by: S. Hameed <shameed@jp.adit-jv.com> Signed-off-by: Aditya Paluri <venkataaditya.paluri@in.bosch.com> Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com> Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com>
* Use poll in the dlt-daemon for POSIX complianceManikandanC2018-11-301-0/+4
| | | | | | | | | | | The poll system call is now used in the daemon to enable DLT use in POSIX compliant systems. Also added introduced new unregister_app macro to avoid missing of logs in startup buffer. Signed-off-by: Frederic Berat <fberat@de.adit-jv.com> Signed-off-by: ManikandanC <Manikandan.Chockalingam@in.bosch.com> Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com> Signed-off-by: S. Hameed <shameed@jp.adit-jv.com>
* dlt-client: fix dlt_client_cleanup memory handlingOnkar Palkar2017-02-063-6/+30
| | | | | | | Setter function introduced for seting up string parameters which are free'd in dlt_client_cleanup Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* Add dlt_user_is_logLevel_enabled APIChristoph Lipka2016-09-231-0/+50
| | | | | | | | | | This function allows an application developer to check if the DLT LogLevel is enabled before starting any log string creation. It can be used in application specific logging wrapper functions. Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com> Change-Id: I4c269b12bfdeae29a4e795385cdbc54a579ba621
* DLT_PTR: User macro to print pointersChristoph Lipka2016-04-281-0/+5
| | | | | | | | This macro internally checks the size of a void pointer to decide if the pointer address is sent with DLT_HEX32 or DLT_HEX64 macro. Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com> Change-Id: Ie316ac411f2174e0760e09244d04b83c8006f55d
* Unix socket control interfaceChristoph Lipka2015-11-243-6/+6
| | | | | | | | | | | | | | | | Control applications running in the same Linux OS should be able to communicate with the DLT Daemon via a socket connection. To be able to do that, the DLT Client library need to be extended. DLT Clients connected via this UNIX socket are not handled as normal DLT Clients and no log messages will be forwarded to them. This avoids problems in situations when a control application is connected to the DLT Daemon before any other 'real' DLT Client (e.g. DLT Viewer) is connected. In this situations, all already stored log messages are flushed to the control application and therefore lost, because the control application most likely ignore all incoming messages besides the one in which it is interested in. Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* Purged all warnings for -Wall -WextraLutz Helwing2015-10-284-26/+23
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Set DLT_USER_BUF_MAX_SIZE to 1390 to prepare UDP message transportLutz Helwing2015-10-282-6/+13
| | | | | | | | | | dlt-test-client and dlt-test-filetransfer have global failed test counter so they can return 1 on failure Using DLT_USER_BUF_MAX_SIZE in dlt-test-client.c truncated check Set path to /usr/local/share/ in dlt-test-filetransfer.c Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Added programme to test repeated calls of dlt_init and dlt_freeSven Hassler2015-10-072-1/+158
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* DLT daemon improvement - dlt_init()-checkLutz Helwing2015-10-078-1576/+1576
| | | | | | | | | | DLT daemon improvement - parameter value range check Adapt unit tests to check for enum return values Changed C version to gnu99 and C++ version to gnu++0c Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Fixed whitespace and formatting of new code Fixed licence headersLutz Helwing2015-10-071-34/+56
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Add env-var to set initial log-levelsStefan Vacek2015-10-071-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | name of environment variable: DLT_INITIAL_LOG_LEVEL Syntax: <apid1>:<ctid1>:<loglevel1>;<apid2>:<ctid2>:<loglevel2>;... apid: application id (up to 4 chars), if empty all applications will match ctid: context id (up to 4 chars), if empty all contexts will match loglevel: either -1..6 or a symbolic name (default, off, fatal, error, warning, info, debug, verbose) Examples: DLT_INITIAL_LOG_LEVEL=TEST:LOG:0 -> turn off logging for appid TEST and contextid LOG DLT_INITIAL_LOG_LEVEL=:LOG:warn -> for contexts with name "LOG" set log-level to warning (3) DLT_INITIAL_LOG_LEVEL=::VERBOSE -> set log-level of all contexts to VERBOSE DLT_INITIAL_LOG_LEVEL=::VERBOSE;TEST:LOG:3 -> set log-level of all contexts to VERBOSE except TEST:LOG, set this to WARNING dlt-example-user: add option -l to specify log-level to be used when sending messages Signed-off-by: Stefan Vacek <stefan.vacek@intel.com>
* Allow applications to fork()Stefan Vacek2015-10-072-1/+53
| | | | | | | | - if fork() is called from an application, dlt is reset and user application needs to re-register application and contexts in child-process Signed-off-by: Stefan Vacek <stefan.vacek@intel.com>
* Restrict dlt-receive to write max. n-bytesStefan Vacek2015-10-071-0/+72
| | | | | | | | - dlt-receive gets a new parameter to restrict the maximum size of the written file. When the limit is exceeded, a new file is opened - testscript (bash) in src/tests provided to demonstrate functionality Signed-off-by: Stefan Vacek <stefan.vacek@intel.com>
* Cleanup masterStefan Vacek2015-10-075-0/+0
| | | | | | | - remove compiler warnings - fix file permissions Signed-off-by: Stefan Vacek <stefan.vacek@intel.com>
* Removed all trailing whitespacesLutz Helwing2015-07-216-33/+33
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Fixed license headers and copyright doxygen commentsLutz Helwing2015-06-1710-19/+19
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Updated license headers to latest GENIVI license policy. Fixed further LRT ↵Lutz Helwing2015-06-1710-108/+146
| | | | | | Scan findings. Renamed and cleanup further files. Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Remove absolute installation paths so that DLT can be installed at any ↵Jacques GUILLOU2015-04-021-1/+3
| | | | | | location (not only "/usr"). Signed-off-by: Jacques GUILLOU <jacques.guillou@pelagicore.com>
* Fix PREFIX. Works now with the default PREFIX (/usr/local/) and with the ↵Alexander Wenzel2015-03-121-5/+1
| | | | | | user PREFIX (e.g. /temp/test_with_pref). PREFIX Fix for filetransfer directory (PREFIX/share/). Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>