aboutsummaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2023-09-27test,mmsmspdu: add support for MSG log levelAleksander Morgado
2023-04-11port-serial-at: make mm_port_serial_at_command_finish() transfer ownershipLubomir Rintel
This will make it slightly easier to port mm_port_serial_at_command() to use GTask, since we won't have to keep a pointer to the result in GTask after _finish() has been called. In most cases the caller needs the value anyway, so this doesn't add too much hasle.
2023-04-10test: fix _mm_log() prototypesLubomir Rintel
GCC 13 is unhappy to cast a MMLogLevel to a guint32: [188/539] Compiling C object src/plugins/test-shared-icera.p/icera_tests_test-modem-helpers-icera.c.o In file included from ../src/plugins/icera/tests/test-modem-helpers-icera.c:27: ../src/mm-log-test.h:25:1: warning: conflicting types for ‘_mm_log’ due to enum/integer mismatch; have ‘void(void *, const gchar *, const gchar *, const gchar *, guint32, const gchar *, ...)’ {aka ‘void(void *, const char *, const char *, const char *, unsigned int, const char *, ...)’} [-Wenum-int-mismatch] 25 | _mm_log (gpointer obj, | ^~~~~~~ In file included from ../src/mm-log-test.h:20: ../src/mm-log.h:61:6: note: previous declaration of ‘_mm_log’ with type ‘void(void *, const gchar *, const gchar *, const gchar *, MMLogLevel, const gchar *, ...)’ {aka ‘void(void *, const char *, const char *, const char *, MMLogLevel, const char *, ...)’} 61 | void _mm_log (gpointer obj, | ^~~~~~~ That's perfectly fine, just use the enum type directly.
2023-04-10mmtty: handle MM_LOG_LEVEL_MSG in _mm_log()Lubomir Rintel
GCC 13 is unhappy about mixing enums and ints. However, if we fix the type un mmtty's _mm_log() prototype, the compiler will find something else to be irritiated about: [1/2] Compiling C object test/mmtty.p/mmtty.c.o ../test/mmtty.c: In function ‘_mm_log’: ../test/mmtty.c:283:5: warning: enumeration value ‘MM_LOG_LEVEL_MSG’ not handled in switch [-Wswitch-enum] 283 | switch (level) { | ^~~~~~ [2/2] Linking target test/mmtty Fix that first.
2023-03-30test,mmsmspdu: fix verbose logging supportAleksander Morgado
2022-11-07build: drop autotoolsAleksander Morgado
2022-01-05core: switch bash shell scripts to use /bin/sh for use w/Busybox.Bruce A. Johnson
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/483
2021-11-08build,meson: Make feature options booleanIñigo Martínez
Different options are set as `feature`, also every possible plugin, but this may cause confusion. All options set as `feature` but plugins have been made `boolean` to avoid further confusions. `help2man` is also installed in the CI image because is required to build different libraries.
2021-11-04core: replace 'dummy' with 'placeholder'Aleksander Morgado
2021-09-17Tests: fix -Wformat compiler warningYegor Yefremov
Use G_GUINT64_FORMAT to properly format a guint64 type.
2021-09-07test,lsudev: add attribute format to println()Aleksander Morgado
../test/lsudev.c: In function ‘println’: ../test/lsudev.c:68:5: warning: function ‘println’ might be a candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format] 68 | g_string_append_vprintf (output, fmt, args); | ^~~~~~~~~~~~~~~~~~~~~~~
2021-09-07build: Port to mesonIñigo Martínez
meson is a build system focused on speed an ease of use, which helps speeding up the software development. This patch adds meson support along autotools.
2021-03-31mmtty: new --spew-control optionAleksander Morgado
So that we simulate enabling the spew control, as we do during probing.
2021-03-31mmtty: allow enabling LF with --send-lfAleksander Morgado
2021-03-31mmtty: fix printing logs with --verboseAleksander Morgado
The _mm_log() implementation provided in 'mm-log-test.h' relies on g_test_verbose() to decide whether the logs are printed or not. We are not running under the GTest setup in mmtty, so that would not work properly. Just provide a custom _mm_log() method that checks for the verbose_flag instead.
2021-03-31mmtty: make sure \r\n is removed from the user lineAleksander Morgado
2020-04-08log: common logging method definition for all testers and helpersAleksander Morgado
2020-04-08sms-part-3gpp: port to use object loggingAleksander Morgado
2020-04-08log: new object logging supportAleksander Morgado
So that we can provide the specific object id in every log associated to a given object.
2020-01-31test,mmsmspdu: fix warnings with -Wswitch-enumAleksander Morgado
mmsmspdu.c: In function ‘show_part_info’: mmsmspdu.c:86:5: error: enumeration value ‘MM_SMS_ENCODING_UNKNOWN’ not handled in switch [-Werror=switch-enum] 86 | switch (encoding) { | ^~~~~~
2020-01-31test,mmrules: fix warnings with -Wswitch-defaultAleksander Morgado
mmrules.c: In function ‘print_rule’: mmrules.c:97:13: error: switch missing default case [-Werror=switch-default] 97 | switch (rule_match->type) { | ^~~~~~ mmrules.c:113:5: error: switch missing default case [-Werror=switch-default] 113 | switch (rule->result.type) { | ^~~~~~
2020-01-31test,lsudev: fix warnings with -Wsign-compareAleksander Morgado
lsudev.c: In function ‘println’: lsudev.c:64:19: error: comparison of integer expressions of different signedness: ‘int’ and ‘guint’ {aka ‘unsigned int’} [-Werror=sign-compare] 64 | for (i = 0; i < indent; i++) | ^
2020-01-30build: use AX_IS_RELEASE() and AX_COMPILER_FLAGS()Aleksander Morgado
The autoconf macros AX_COMPILER_FLAGS_{CFLAGS|GIR|LDFLAGS} test for compiler and linker support of various flags, and add the flags to the generated output. If the command-line option '--enable-compile-warnings' is specified to 'configure', a number of additional warning options is also added to the output. This is the default. This update requires the presence of the GNU autoconf-archive in the system.
2019-12-12Revert "build: fix order of linked libs in test apps"Aleksander Morgado
This reverts commit 3eb623e73b546a444c1fc717f4ed105b3b2d5eae. This change is plain wrong. The correct order was already fixed in commit 42dab8e8.
2019-12-11build: fix order of linked libs in test appsAleksander Morgado
Solving build issues with truly strict linkers, as in: http://lists.busybox.net/pipermail/buildroot/2019-December/268817.html
2019-11-15build,test: fix order of included librariesAleksander Morgado
Symbols are resolved forward, so if libhelpers depends on libmm-glib, it needs to be specified first.
2019-07-31test: untabifyBen Chan
2019-07-17test: new 'mmsmsmonitor' tool to monitor SMS messagesAleksander Morgado
The tool monitors SMS message additions and SMS state updates, e.g.: $ sudo ./test/mmsmsmonitor [/org/freedesktop/ModemManager1/SMS/0] sms found: received [/org/freedesktop/ModemManager1/SMS/1] sms found: received [/org/freedesktop/ModemManager1/SMS/2] sms found: received [/org/freedesktop/ModemManager1/SMS/3] sms found: received [/org/freedesktop/ModemManager1/SMS/4] sms found: received [/org/freedesktop/ModemManager1/SMS/5] sms found: received [/org/freedesktop/ModemManager1/SMS/6] sms found: received [/org/freedesktop/ModemManager1/SMS/7] new sms: receiving [/org/freedesktop/ModemManager1/SMS/7] sms updated: received
2019-07-15test: new 'mmsmspdu' tool to parse PDUs given in hexAleksander Morgado
2017-02-03glib: remove invocations of g_type_init()Ben Chan
g_type_init() has been deprecated (and also marked with the attribute 'deprecated') since glib 2.36 as the type system is automatically initialized. Since the minimum version of glib required by ModemManager is 2.36, calling g_type_init() isn't necessarily in the ModemManager code.
2016-09-29core: allow building and running without udevAleksander Morgado
Instead of relying on the udev daemon and GUDev to manage the devices reported by the kernel, we can now run ModemManager relying solely on the kernel events reported via the new ReportKernelEvent() API. Therefore, the '--no-auto-scan' option is implicit for the ModemManager daemon when udev is disabled in the build. Additionally, a new custom implementation of the kernel device object is provided, which uses sysfs to load the properties and attributes required in each kernel device, instead of using a GUdevDevice. The udev rule files are kept in place, and a simple custom parser is provided which preloads all rules in memory once and then applies them to the different kernel objects reported via ReportKernelEvent(), e.g. to set port type hints. A simple unit test setup is prepared to validate the udev rules during the `check' Makefile target.
2016-09-29core: use the kernel device object in the port object and the plugin interfaceAleksander Morgado
The mm_base_modem_grab_port() now receives a MMKernelDevice directly from the plugin, which is then stored in the MMPort corresponding to the port. This means that we have direct access to e.g. all properties set by udev rules everywhere, and we don't need additional GUdevClient objects (e.g. like the one used in the Huawei plugin to detect NDISDUP support during runtime). For virtual ports (e.g. generated during unit tests), we have a new 'generic' kernel device object which just provides the values from the kernel device properties given during its creation.
2016-03-15build,core: update build rulesAleksander Morgado
We try to combine in common envvars the compiler and linker flags shared by the different components, and where possible, also re-using the implicit AM_CFLAGS and AM_LDFLAGS variables that automake provides, and which apply to all objects being built in the same Makefile.am. The internal libmodem-helpers.la library is also renamed to libhelpers.la
2015-12-02core: use G_SOURCE_REMOVE and G_SOURCE_CONTINUE in GSourceFuncsAleksander Morgado
2015-02-11test: new 'mmtty' utilityAleksander Morgado
The new tester allows to play with the AT-capable TTY using the same code as ModemManager itself. $ sudo ./test/mmtty -d /dev/ttyHS0 --verbose opening serial port '/dev/ttyHS0'... (ttyHS0) opening serial port... (ttyHS0): port attributes not fully set (ttyHS0) device open count is 1 (open) flashing serial port '/dev/ttyHS0'... ready > AT+GCAP (ttyHS0): --> 'AT+GCAP<LF><CR>' (ttyHS0): <-- '<CR><LF>+GCAP: +CGSM,+DS,+ES<CR><LF><CR><LF>OK<CR><LF>' +GCAP: +CGSM,+DS,+ES > AT+GMI (ttyHS0): --> 'AT+GMI<LF><CR>' (ttyHS0): <-- '<CR><LF>Option N.V.<CR><LF><CR><LF>OK<CR><LF>' Option N.V. > ^C cancelling the main loop... (ttyHS0) device open count is 0 (close) (ttyHS0) closing serial port... (ttyHS0) serial port closed (ttyHS0) forced to close port
2013-06-18test: remove testers of the old interfaceAleksander Morgado
Old python tests using the old ModemManager interface are removed, as mmcli provides already a much nicer way to test the DBus interface. Also, mm-test.py and the PPPD plugin get removed, which were also using the old interface, and which were not very useful for testing newer non-PPP based modems. https://bugzilla.gnome.org/show_bug.cgi?id=702061
2012-09-14test: new tester for the messaging capabilities of a modem, using `mmcli'Aleksander Morgado
Usage: mmcli-test-sms [MODEM INDEX] [all|ucs2|gsm7|data] [NUMBER]" If [NUMBER] is not given, a dummy number will be used and NO SMS will be sent. If you give a proper [NUMBER], we will try to send the SMS.
2012-08-31test: add utility to force a modem disconnectDan Williams
2012-05-30test: ignore ESN errors in info.pyDan Williams
2012-03-16build: require gudev >= 147Aleksander Morgado
Since udev 147 the gudev API is no longer marked as experimental, and therefore `G_UDEV_API_IS_SUBJECT_TO_CHANGE' is no longer needed.
2012-02-02test: (sms-get.py) don't fail if we don't get an SMSCDan Williams
2012-02-01test: pretty-print SMS messages in sms-get.pyDan Williams
2012-01-26test: add SMS get example/testDan Williams
2012-01-26test: add missing examples to Makefile.amDan Williams
2012-01-26test: rename SMS send exampleDan Williams
2012-01-18test: print sent SMS message index on successDan Williams
2012-01-18gsm: change SMS send validity from 5-minute units to minutesDan Williams
Might as well keep it simple.
2012-01-18test: enhance SMS send util to accept validity and SMSC addressDan Williams
2012-01-18test: print out error if sending SMS failsDan Williams
2012-01-18tests: better handling of encodings in SMS test toolDan Williams
Python usually uses Unicode, but often the shell encoding will be in UTF-8, so Python needs some help converting the message to Unicode. Use LANG to do that if we can.