summaryrefslogtreecommitdiffstats
path: root/configure.ac
Commit message (Collapse)AuthorAgeFilesLines
* test: Add tests for Physical classAndrew Jeffery2019-03-181-2/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The additions to configure expose a new `check-code-coverage` make target when `--enable-code-coverage` is passed to `./configure`. Assuming gcov/lcov are installed, `make check-code-coverage` will run the test suite and generate an HTML line/function/branch coverage report that enables measurement of the effectiveness of the test suite. The tests themselves are trivial (integration) tests that get us to 78.8% line coverage and 93.3% function coverage over physical.hpp and physical.cpp. However, as we don't have the read() and write() functions under our control - and as they're implemented to return empty strings when the target files do not exist - this high level of coverage is more by luck than design. To demonstrate, under the current test arrangement, we can never enter this branch of setInitialState(): auto trigger = read<std::string>(blinkCtrl); if (trigger == "timer") { // LED is blinking. Get the delay_on and delay_off and compute // DutyCycle. sfsfs values are in strings. Need to convert 'em over to // integer. auto delayOn = std::stoi(read<std::string>(delayOnCtrl)); auto delayOff = std::stoi(read<std::string>(delayOffCtrl)); // Calculate frequency and then percentage ON frequency = delayOn + delayOff; auto factor = frequency / 100; auto dutyOn = delayOn / factor; // Update. this->dutyOn(dutyOn); } For similar reasons, we also fail to enter: auto brightness = read<std::string>(brightCtrl); if (brightness == std::string(ASSERT)) { // LED is in Solid ON sdbusplus::xyz::openbmc_project::Led::server ::Physical::state( Action::On); } To test both of these paths we need to make changes to isolate functionality so we can manipulate the read() call to return the necessary strings at the appropriate times, but that is for a future change. Change-Id: I0df2ab2d992ccad514cddb7f7fc6d080aa74f27d Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
* phosphor-led-sysfs: use c++17Vernon Mauery2018-10-041-1/+1
| | | | | | | Update configure.ac to choose the c++17 standard Change-Id: I4dac04257a7b6758d28c8639d1ced9651cfaca90 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
* Work-around: Extract led name from device pathVishwanatha Subbanna2017-06-081-0/+5
| | | | | | | | | | | | | | | | | | | | | | udev rule for leds subsystem in Witherspoon launches a systemd service file with /sys/class/leds/$name. If the path is sys-class-leds-rear-fault, systemd service file interprets it as /sys/class/leds/rear/fault. However, what is really needed by the service file is /sys/class/leds/rear-fault. This is a limitation in current systemd with template argument containing hyphen. Short term solution is to extract $name from path and convert "/" to "-". It would then become: /sys/class/leds/rear-fault and hence will work. Refer: systemd/systemd#5072 Change-Id: I0acc11d039650857005ba75810e3ef6bcc4a3934 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Link to dbus interfaces library for using generated codeVishwanatha Subbanna2017-03-131-0/+1
| | | | | Change-Id: Id1c45d8c66deb499a92bfd94bc271f378245da34 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Check for needed package modules than individual header filesVishwanatha Subbanna2017-03-131-2/+1
| | | | | Change-Id: I123c143cd8ed65da3922f1928f96dc60de6e9458 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Add missing LT_INIT to configure.acVishwanatha Subbanna2017-02-201-0/+3
| | | | | Change-Id: Iba83a1fec052486f64a9d7a685bbc9298a5bd707 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Adhere to freedesktop naming convention for service and object pathVishwanatha Subbanna2017-02-201-4/+4
| | | | | | | Refer: https://dbus.freedesktop.org/doc/dbus-api-design.html Change-Id: Ic5d25d7c2a1b8e17c4fb286e73b6da62793a845c Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
* Add initial files for physical LED controllerVishwanatha Subbanna2016-12-061-0/+38
This daemon uses sysfs entry for a particular LED and then triggers necessary action. Name and Path of the LED is needed as command line options to make sure this is genreric implementation. Change-Id: I3d52f1491fcb6ae8119b399a4d2c6770a3f5db30 Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
OpenPOWER on IntegriCloud