This change allows updates to the dev structure for individual test
cases. This defines the "setup_hook" array, and "fields" map, at both
the test group level and at the individual test case level, with the
ones at the test case level overriding any parent level fields and/or
hooks.
The primary use case for this is to add new test definitions that would
not be setup correctly by the default infrastructure, such as testing
the LED function for the non-Pro X52, or setting up clock tests for
local timezone, etc.
Prior to this change, libx52 tests needed a linker that supported the
--wrap argument. This is not available on OSX, and therefore, we had to
disable the unit tests on non-Linux systems.
Since we needed to rebuild the libx52 library anyway for the test, it is
simpler to just define libusb_control_transfer to point to our mock
function. This allows us to verify libx52 on all supported platforms.
This change adds a suite of tests in JSON format using a Python script
to generate the cmocka based test program. Because we need to wrap some
of libusb functionality, we need to rebuild and relink the libx52
sources with the -Wl,--wrap option.
Prior to this change, we needed to add a manual override function to
mock the vendor command. Given that cmocka has built-in support for
mocking functions, it's better to use that instead.
This change simply removes the manual override and any tests that rely
on it.
Prior to this change, generation of the character lookup table could use
Python 2 or Python 3, depending on what the first instance of python in
the PATH pointed to. On most systems, python is a symbolic link to
python2.7. However, given that Python 2 is EOL, it makes sense to switch
the code to use Python 3 now, rather than later.
This change updates the requirements to use Python 3.6 or later, and
updates the Makefile to invoke the script with the detected python
binary, rather than relying on the shebang to use the system Python.
Prior to this change, the assumption in all shell and Python scripts was
that the Bash interpreter would always be available at `/bin/bash`, and
Python would always be available at `/usr/bin/python`. However, on a VM
running FreeBSD, installing bash and python using the pkg command
installs them under /usr/local/bin.
This change updates the paths to use /usr/bin/env in the shebang. While
this is not a standard path either, it is more likely to be available at
this location.
This change also updates the find command in common_infra.sh to use
`-perm -+x` in lieu of `-executable`, which is not a condition defined
by POSIX. This allows running the tests on BSD.
With the introduction of AX_COMPILE_FLAGS in configure.ac, building with
--disable-nls in configuration raises additional warnings.
This change updates gettext.h in order to address those warnings.
Prior to the introduction of common test infrastructure, the offset test
was using an undocumented function in libx52 to validate the timezone
offset calculations.
This change allows us to hide that undocumented function and not have to
expose internal functionality in order to perform testing.
Prior to this change, the comparision loop ran until it found a zero
value in either the index or the value field, rather than looping until
both were zero.
This change fixes that bug, and also adds additional debug functions to
print the expected and observed values.
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.
This change adds tests for setting the X52Pro LEDs using the new x52
test infrastructure. This should be used in addition to the x52cli based
test suite.
This change allows for a test framework to override the functionality of
libx52_vendor_command. By doing so, it can build tests that change the
libx52_device structure, and therefore, not need to rely on libusbx52 to
get the commands written.
This allows for tests that can be built and run on other OSes as well,
since the libusbx52 based tests cannot run on OSX and have not been
tested on BSD systems.
With the introduction of automatic code review tools, libx52_update was
found to be "too complex". This change simply breaks out the switch
cases into a set of functions indexed through a lookup table.
Prior to this change, libx52_vendor_command would leave the device
handle untouched, even if the joystick was disconnected.
This change will force applications to reconnect to the joystick after
they encounter such a failure.
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.