summaryrefslogtreecommitdiff
path: root/tests/CMakeLists.txt
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>
* logstorage: Adds option to write logs in gzip format (#442)Linus Probert2023-04-191-1/+1
| | | | | | | | | | * 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-101-2/+4
| | | | | | | | | | | 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>
* tests: Deplicate unused files and variables (#359)Saya Sugiura2021-12-231-1/+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-051-5/+9
| | | | | | | | 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: 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: Refactor tests/CMakeLists.txtSaya Sugiura2021-10-051-63/+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>
* Alternative solutions for json-c dependencyBiastoch, Darian (ADITG/ESM)2021-06-301-2/+11
| | | | | | | 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-301-0/+2
| | | | | | | | -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>
* 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>
* 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>
* using POSIX shared memory APIs (#90) (#151)Vo Trung Chi2019-08-011-0/+9
| | | | | Replace all Linux specific shared memory APIs with POSIX alternatives. Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.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>
* Fix linking problem with tests when systemd enabled (#103)Jiri Popek2019-02-071-5/+5
| | | Change-Id: Ide7c91a9f3a182c4bc2f91613874b0ef3feca648
* Travis CI: build with systemd enabled (#97)Jiri Popek2019-02-021-0/+4
| | | | | | * Travis CI: build with systemd enabled * fix the 'sd_booted' linker issue
* UnitTest: UpdatesManikandanC2018-12-211-8/+19
| | | | | | | | | | | | 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>
* Unit Test: Event handlingChristoph Lipka2016-10-241-0/+2
| | | | | | Unit tests for DLT Daemon connection and event handling Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* Unit Test: MultiNodeOnkar Palkar2016-10-241-1/+3
| | | | | | Unit test for DLT MultiNode extension Signed-off-by: Christoph Lipka <clipka@jp.adit-jv.com>
* Purged all warnings for -Wall -WextraLutz Helwing2015-10-281-1/+2
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* DLT daemon improvement - dlt_init()-checkLutz Helwing2015-10-071-0/+2
| | | | | | | | | | 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 C++ version for cpp extension to -std=gnu++0xLutz Helwing2015-10-071-1/+1
| | | | Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Add C++ extensionStefan Vacek2015-10-071-0/+5
| | | | | | | | | | | - header only implementation, uses variadic templates from C++ 11 - Enable installation and building tests with -DWITH_DLT_CXX11_EXT - allow logging in the form of DLT_LOG_CXX(context, level, param1, param2, param3), e.g. - allow logging of user types (if a function logToDlt for the given user-type is present), e.g. - Added pkg-config file automotive-dlt-c++.pc - Sample code is provided in tests/dlt-test-cpp-extension.cpp Signed-off-by: Stefan Vacek <stefan.vacek@intel.com>
* Allow registration of contexts before application is registeredStefan Vacek2015-10-071-0/+3
| | | | Signed-off-by: Stefan Vacek <stefan.vacek@intel.com>
* Add env-var to set initial log-levelsStefan Vacek2015-10-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Rework of unit testsStefan Held2015-07-211-0/+3
| | | | | Signed-off-by: Stefan Held <stefan_held@mentor.com> Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Add the forgotten son gtest_dlt_daemon_commonStefan Held2015-07-211-0/+2
| | | | | | | | | Rework of unit tests in gtest_dlt_daemon_common No need to fix nullpointer Signed-off-by: Stefan Held <stefan_held@mentor.com> Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Rework of unit tests in gtest_dlt_commonStefan Held2015-07-211-3/+1
| | | | | | | Fix all nullpointer errors in dlt_common.c Signed-off-by: Stefan Held <stefan_held@mentor.com> Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* changed dlt-test-receiver delete dlt-test-filetranfer make a bash script ↵Stefan Held2015-06-171-2/+0
| | | | | | | wich tests the filetransfer Signed-off-by: Stefan Held <stefan_held@mentor.com> Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Added new filestranfer test filetransfer: send data with crc32 checksum ↵Stefan Held2015-06-171-0/+6
| | | | | | | receiver: receive data, save it at /tmp and verifiy the checksum Signed-off-by: Stefan Held <stefan_held@mentor.com> Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* 1st version of gtest now the following methods can be tested dlt_common -> ↵Stefan Held2015-06-171-4/+5
| | | | | | | | | | dlt_buffer_* dlt_common -> dlt_message_* Signed-off-by: Stefan Held <stefan_held@mentor.com> Conflicts: tests/CMakeLists.txt Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Adding unit tests for:Jens Bocklage2015-06-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | int dlt_user_log_write_start(DltContext *handle, DltContextData *log, DltLogLevelType loglevel); int dlt_user_log_write_start_id(DltContext *handle, DltContextData *log, DltLogLevelType loglevel, uint32_t messageid); int dlt_user_log_write_finish(DltContextData *log); int dlt_user_log_write_bool(DltContextData *log, uint8_t data); int dlt_user_log_write_float32(DltContextData *log, float32_t data); int dlt_user_log_write_float64(DltContextData *log, double data); int dlt_user_log_write_uint(DltContextData *log, unsigned int data); int dlt_user_log_write_uint8(DltContextData *log, uint8_t data); int dlt_user_log_write_uint16(DltContextData *log, uint16_t data); int dlt_user_log_write_uint32(DltContextData *log, uint32_t data); int dlt_user_log_write_uint64(DltContextData *log, uint64_t data); int dlt_user_log_write_uint8_formatted(DltContextData *log, uint8_t data, DltFormatType type); int dlt_user_log_write_uint16_formatted(DltContextData *log, uint16_t data, DltFormatType type); int dlt_user_log_write_uint32_formatted(DltContextData *log, uint32_t data, DltFormatType type); int dlt_user_log_write_uint64_formatted(DltContextData *log, uint64_t data, DltFormatType type); int dlt_user_log_write_int(DltContextData *log, int data); int dlt_user_log_write_int8(DltContextData *log, int8_t data); int dlt_user_log_write_int16(DltContextData *log, int16_t data); int dlt_user_log_write_int32(DltContextData *log, int32_t data); int dlt_user_log_write_int64(DltContextData *log, int64_t data); int dlt_user_log_write_string( DltContextData *log, const char *text); int dlt_user_log_write_constant_string( DltContextData *log, const char *text); int dlt_user_log_write_utf8_string(DltContextData *log, const char *text); int dlt_user_log_write_raw(DltContextData *log,void *data,uint16_t length); int dlt_user_log_write_raw_formatted(DltContextData *log,void *data,uint16_t length,DltFormatType type); int dlt_log_string(DltContext *handle,DltLogLevelType loglevel, const char *text); int dlt_log_string_int(DltContext *handle,DltLogLevelType loglevel, const char *text, int data); int dlt_log_string_uint(DltContext *handle,DltLogLevelType loglevel, const char *text, unsigned int data); int dlt_log_int(DltContext *handle,DltLogLevelType loglevel, int data); int dlt_log_uint(DltContext *handle,DltLogLevelType loglevel, unsigned int data); int dlt_log_raw(DltContext *handle,DltLogLevelType loglevel, void *data,uint16_t length); int dlt_log_marker(); Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
* Adding gtest framework v1.7.0 Adding initial hello world C test caseJens Bocklage2015-06-171-0/+10
Signed-off-by: Jens Bocklage <jens_bocklage@mentor.com> Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>