Commit Graph

153 Commits (a733d4420c9046ce7795575099c5f14471b6443f)

Author SHA1 Message Date
nirenjan a733d4420c Add API to let caller handle memory management
This is inspired by [skeeto]'s recent post on [minimalist C libraries]
and allows the caller to decide how to allocate or free memory needed by
libx52. A future addition could let the caller allocate a big enough
buffer up front, and let libx52 manage it.

[skeeto]: https://github.com/skeeto
[minimalist C libraries]: http://nullprogram.com/blog/2018/06/10/

[skip-ci]
2018-06-11 15:25:35 -07:00
nirenjan 7dcd3049ec Add SPDX license identifiers in all files 2018-04-18 12:19:29 -07:00
nirenjan e31f1e442b Move license text to LICENSE file 2018-04-18 12:16:48 -07:00
nirenjan 0913212ecc Always return translated error code
LIBUSB_SUCCESS is also handled by libx52_translate_libusb_error.
2017-10-27 14:20:19 -07:00
nirenjan 02c24cc964 Fix timezone offset calculations for large negative offsets 2017-10-27 14:19:38 -07:00
nirenjan 46cba64e6b Update build requirements in README
[skip ci]
2017-10-12 21:35:58 -07:00
nirenjan 86642e5b16 Use pkg-config for libusb 2017-09-10 17:13:38 -07:00
nirenjan 3845c81229 Add libx52_strerror API 2017-08-28 22:54:46 -07:00
nirenjan 6f3f8d7c46 Add more error codes and translation from libusb
These new error codes correspond to similar ones returned by libusb, but
abstract away the usage of libusb underneath libx52. This lets the
application rely solely on libx52 error codes to perform error handling.
2017-08-28 19:10:41 -07:00
nirenjan d4afbd6de2 Build libusbx52 only for tests 2017-08-25 06:39:04 -07:00
nirenjan e5ea621899 Fix libtool version info for libx52
Also update package version to indicate it is in pre-release stage.
2017-08-25 06:04:36 -07:00
nirenjan f3270def9d API change for libx52
- libx52_init returns the libx52_device in an output parameter and
  returns a libx52_error_code
- Make all functions return libx52_error_code
- Update package version to indicate incompatible API change
2017-08-23 19:30:35 -07:00
nirenjan fb222dda89 Add Changelog 2017-08-19 15:59:57 -07:00
nirenjan 82fa0cea28 Bump version number 2017-08-18 07:50:12 -07:00
nirenjan 21d6b503a7 travis-ci: Enable parallel make 2017-08-18 07:32:50 -07:00
nirenjan d54e02be5a Add test cases for raw time and date APIs 2017-08-18 07:28:23 -07:00
nirenjan acdcebc52e Add CLI commands to access raw date and time APIs 2017-08-18 07:26:50 -07:00
nirenjan 52abd335ab Add raw time and date APIs to libx52
The raw time and date APIs bypass the timezone calculation and update
the internal data structures with the requested time in hh:mm and date
in dd/mm/yy formats.

This is unlikely to be used often, but it is useful during testing.
2017-08-18 07:23:49 -07:00
nirenjan 6b89a9d7f9 Clarify Doxygen comments for libx52 2017-08-16 23:38:19 -07:00
nirenjan 533a472b10 Fix formatting for x52cli manual 2017-08-16 00:05:05 -07:00
nirenjan 780447122c Reduce number of included headers for libx52util.h 2017-08-16 00:04:10 -07:00
nirenjan b5f4e72148 Add test cases for MFD text 2017-08-14 22:58:22 -07:00
nirenjan 2e96378f80 Add test cases for MFD clock display 2017-08-12 08:43:13 -07:00
nirenjan b9a7e5de1f Remove redundant make check from Travis build
make distcheck already runs make check in the new location, so any
failures should start showing up there.

[skip ci]
2017-08-11 18:19:29 -07:00
nirenjan 3eb837df1b Merge tests into corresponding test-suites
This eliminates the large number of small generated test case files and
somewhat simplifies the actual management of test cases and test suites.
2017-08-11 18:10:53 -07:00
nirenjan 994c39ce3c Add test cases for blink and shift indicators 2017-08-04 08:26:21 -07:00
nirenjan 8f7c262ea6 Merge pull request #13 from Polynomial-C/newline
x52_cli: Print error messages with trailing newline.
2017-08-04 08:25:13 -07:00
Lars Wendler 44d46b70e0
x52_cli: Print error messages with trailing newline. 2017-08-04 11:12:24 +02:00
nirenjan e0d7cb8341 Add brightness test cases 2017-08-03 19:14:29 -07:00
nirenjan 2c2dbb3c42 Reorganize test scripts
This allows for a cleaner organization of different test categories.
2017-08-03 16:59:07 -07:00
nirenjan d9732d498d Fix environment for parallel tests 2017-08-03 16:56:06 -07:00
nirenjan b776101cb6 Add test-driver to .gitignore 2017-08-01 22:05:03 -07:00
nirenjan 0a8db132dc Make test setup routines use environment variables 2017-08-01 21:49:58 -07:00
nirenjan f6bf25d66f Add environment file to enable parallel tests 2017-08-01 21:45:02 -07:00
nirenjan 991218a8b0 Skip tests on OSX 2017-07-29 10:07:12 -07:00
nirenjan 0a45bd5ddf Use x52test_log_action to capture test output 2017-07-27 23:34:39 -07:00
nirenjan 55963ba824 Merge branch 'feature/automated-tests' 2017-07-27 20:52:09 -07:00
nirenjan a2496d5d28 Add realpath to Travis-CI
This package is necessary for the tests, otherwise the script will error
out with a missing "realpath" error.
2017-07-27 20:47:59 -07:00
nirenjan c79373676f Fix distcheck failure 2017-07-27 20:10:21 -07:00
nirenjan e463d9b890 Add tests framework and LED tests 2017-07-27 20:00:35 -07:00
nirenjan f0a0a7dcaf Reorganize source layout 2017-07-27 17:56:51 -07:00
nirenjan 7bc0ba522c Use LIBUSB_* values instead of magic numbers 2017-07-27 17:37:58 -07:00
nirenjan 74eeb27ad4 Fix build breakage on Travis-CI
Travis uses an older version of GCC which doesn't seem to support C99
mode by default. This fixes it by moving the variable declarations out
of the for loop and to the beginning of the function.
2017-07-27 17:22:36 -07:00
nirenjan dc352c58da Move build script out of .travis.yml 2017-07-27 17:09:16 -07:00
nirenjan 45c66a4f1a Fix distcheck breakage 2017-07-27 17:05:06 -07:00
nirenjan ea14d1132d Add implementation of stub libusb library
This commit adds the implementation of the stub libusb library in order
to use it in an LD_PRELOAD environment. This also adds the utility
programs to create a device list and sample output to compare against.
2017-07-27 16:43:01 -07:00
nirenjan dc7300db26 Add stub routines for mocking libusb
This is to be used for running automated tests on libx52 and associated
libraries and/or programs
2017-07-26 17:34:29 -07:00
nirenjan 59652c0aff Travis-CI: Compile using both GCC & clang 2017-07-21 22:47:26 -07:00
nirenjan f0e6836195 Upgrade Travis-CI distribution to Trusty 2017-07-21 09:11:36 -07:00
nirenjan 262d125cd4 Refactor util_char_map_gen.py to comply with PEP8 2017-06-14 11:04:53 -07:00