Commit Graph

8 Commits (97743d4ebd6546789be0f07ff9ff9421acb1e4b5)

Author SHA1 Message Date
nirenjan 97743d4ebd Add internationalization support for x52test
This change updates x52test to use the gettext APIs. This also adds a
fake message catalogue to verify that the code is converted correctly
and the translations are displayed.

The fake message catalogue translates the English strings into Pig
Latin, which makes it easy enough for a maintainer to verify that the
changes have been made correctly.

Finally, this also adds some documentation to tell the maintainer or
translator how to make the relevant changes.
2020-05-20 14:36:40 -07:00
nirenjan 45f009ac90 Move LED tests in x52test to the end
x52test doesn't perform any checks to see if the connected device
supports setting individual LEDs. Therefore, if an X52 (non-Pro) was
connected when running x52test, it would fail when running the LED
tests, and not perform any of the subsequent tests.

By moving the LED tests to the end, this allows the other tests to run
on a non-Pro X52. Although the tests would still fail, it won't actually
break anything.

Addresses #19.
2020-05-18 14:59:24 -07:00
nirenjan be1f7e0d5a Fix error handling in x52test
x52test used to assume that a positive return code indicated a signal
was received and a negative return code indicated an error in libx52.
However, libx52 was changed a while back to return only a positive error
code of type `libx52_error_code`.

This commit changes that assumption, so that:

* The first check is always against `LIBX52_SUCCESS`, to ensure that any
  change in the enumeration won't break the rest of the code.
* Tests terminated by a signal return the negated value of the signal,
  i.e. -15 is SIGTERM and -2 is SIGINT.
* Tests that fail within libx52 return a standard `libx52_error_code`.
* Error printing uses `libx52_strerror`.

Addresses #19.
2020-05-18 14:58:31 -07:00
nirenjan dc80a0f2f1 Add option to run test without delay
x52test by default expects to run with an attached X52 unit. Since the
primary goal of the program is to test the hardware, it has embedded
delays to allow the user to verify the individual LEDs, MFD, brightness,
etc.

However, the complete test takes about 6 minutes. When using the stub
libusb library, the goal is to capture the requests, not verify it
against the hardware. In this case, the delays serve no useful purpose.

This change adds a nodelay flag, which is controlled by the presence of
a `NO_DELAY` environment variable, or the `LD_PRELOAD` environment
variable. As long as either of these variables are present in the
environment block, there will be no delays in the test execution.
2020-04-12 16:48:29 -07:00
nirenjan 1d51429f10 Make x52test use X macros 2018-07-17 17:21:21 -07:00
nirenjan 7dcd3049ec Add SPDX license identifiers in all files 2018-04-18 12:19:29 -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 f0a0a7dcaf Reorganize source layout 2017-07-27 17:56:51 -07:00