Commit Graph

26 Commits (37162510ac8a576cea6fba343392cd35c223a1d4)

Author SHA1 Message Date
nirenjan 37162510ac Enable additional compiler warnings
This change adds additional compiler warnings as detected by the
autoconf archive. Because the code is susceptible to these additional
warnings, disable treating warnings as errors for now, until we can fix
the warnings.
2020-06-11 23:38:44 -07:00
nirenjan af49ce6500 Fix daylight savings offset calculation bug
This commit changes the local timezone calculation to use tm.tm_gmtoff,
and falling back to calculating it manually from the output of strftime
when tm_gmtoff is not a member of struct tm.

This also fixes the tests so that they are no longer expected to fail.

Fixes #20.
2020-06-06 17:48:17 -07:00
nirenjan 4f22983739 Revert "Enable compiling libx52 with weak symbol binding"
The hope was that I could compile some tests that would override
libx52_vendor_command, and run those on OSX to bypass the skipped tests
that used x52cli. However, a Travis-CI run indicated that the compiler
on OSX doesn't support weak symbols, which renders the point moot.
2020-06-06 17:05:17 -07:00
nirenjan 95bc71859b Enable compiling libx52 with weak symbol binding
This change allows exporting libx52_vendor_command as a weak symbol,
thereby allowing it to be overridden by a test runner to validate that
the library is indeed behaving as per the spec.

Because this is something that may not be necessarily desirable on a
production environment, add a configure time flag to disable building
with weak symbols. This will also disable any tests that may rely on
libx52_vendor_command being a weak function.
2020-06-06 16:24:31 -07:00
nirenjan 1188bea444 Use TAP for tests
Prior to this change, the tests were using the automake simple test
harness. The limitation was that for each set of test cases (e.g.
timezone tests), even if one test failed, it would report every test in
that set as failed. Migrating to TAP allows fine-grained reporting on
every single test case, and allows better investigation into checking
which individual tests failed.

This change also updates the timezone tests to explicitly mark the ones
that check when the timezone is Pacific Daylight Time as expected to
fail. It also updates the clock tests to improve the formatting of the
test case identifier.
2020-06-06 08:33:30 -07:00
nirenjan 543aec85b1 Add config header to all C files 2020-06-05 15:19:56 -07:00
nirenjan 2db24e8759 Add udev rules to distribution
Prior to this change, a user had to manually install their own udev
rules on Linux if they wanted to access the joystick without having to
run as root. The most common usecase was on systems based on Debian,
where the user would be a member of the plugdev group, and they would
create their own rule to allow members of the group to write to the
joystick.

This change adds a validated udev rule to the distribution, so if the
user compiles from source and does a make install, the rule to allow
plugdev group members to access the joystick is installed.
2020-05-30 16:38:58 -07:00
nirenjan ec9443dcdd Add gettext support to libx52
This change adds gettext support to libx52 using the Autotools
framework. This should allow translators to translate the error messages
provided by libx52_strerror into their corresponding localized versions.
2020-05-19 08:07:10 -07:00
nirenjan 0204103ccd Add Doxygen support
This change adds Doxygen support in the configure/make step. Doxygen is
optional, and the absence of Doxygen should not break the build.
2020-04-18 01:35:57 -07:00
nirenjan 116f7b3a57 Install libx52.pc during make install 2020-04-17 00:04:09 -07:00
nirenjan 848d70fcf2 Generate pkg-config file for libx52 2020-04-16 22:10:48 -07:00
nirenjan e49261c8d6 Move pthread build logic to configure.ac
Prior to this change, the libusbx52 Makefile was manually specifying the
pthread flags to indicate that the linker needed to link against the
pthread libraries.

This change moves the pthread detection logic out to configure.ac, and
updates the flags in libusbx52 Makefile to use the pthread compiler.
2020-04-15 17:31:46 -07:00
nirenjan 9dc92eb52e Force the use of STDC when building 2020-04-14 23:45:35 -07:00
nirenjan 42f416af1d Update version and changelog for hotplug support 2020-04-14 18:38:12 -07:00
nirenjan 152a3e7932 Update for release 0.2.0 2020-04-14 18:30:16 -07:00
nirenjan 7dcd3049ec Add SPDX license identifiers in all files 2018-04-18 12:19:29 -07:00
nirenjan 86642e5b16 Use pkg-config for libusb 2017-09-10 17:13:38 -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 82fa0cea28 Bump version number 2017-08-18 07:50:12 -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 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 bc9001705d Convert character map generator to Python script
The conversion makes it simpler to allow cross-compilation, since we
should be using the host Python interpreter to build the generated
character map, rather than relying on the automake infrastructure.
2016-05-05 09:18:05 -07:00
nirenjan e752be9805 Use autoconf macros for if-checks 2015-12-10 07:40:38 -08:00
nirenjan c87e785a18 Restructure code layout
Copy files to individual folders. This makes it cleaner to add new
functionality in the future.
2015-12-08 21:46:42 -08:00