commit | bd9bc00b8d7ce2e6631e81a9696addbc399be388 | [log] [tgz] |
---|---|---|
author | Kun Yi <kunyi731@gmail.com> | Wed Aug 21 10:05:27 2019 -0700 |
committer | Kun Yi <kunyi731@gmail.com> | Wed Sep 11 13:58:37 2019 -0700 |
tree | 21b8771bef387deae6b8c00e3ec39935da86ef09 | |
parent | 94a04c4e9162800af7b2823cd52292e3aa189dc3 [diff] |
Rework envMock Instead of mocking all the functions, only mock std::getenv. Now each test only needs to provide an EnvImpl that delegate calls to mockEnv in order to inject dependencies on std::getenv. This for several reasons: 1. Any call to env::getEnv() will be calling the real implementation of the C++ code, and testing real code is better than testing mocks. 2. It is easier to write a fake class that takes a config string which can greatly simplify test cases. 3. We can now write unit tests that ensure the number of times std::getenv gets called (should be once, but multiple times right now). Tested: unit tests still pass Signed-off-by: Kun Yi <kunyi731@gmail.com> Change-Id: I3e5aff7fa5d025de1b8ae798af43b97d31151ab9
Exposes generic hwmon entries as DBus objects. More information can be found at Sensor Architecture
To build this package, do the following steps: 1. ./bootstrap.sh 2. ./configure ${CONFIGURE_FLAGS} 3. make To clean the repository run `./bootstrap.sh clean`.
To enable the use of Linux features like cgroups prioritization and udev/systemd control, one instance of phosphor-hwmon is intended to be run per hwmon sysfs class instance. This requires an algorithm for selecting a stable, well-known D-Bus busname. The algorithm is <PREFIX>-<ID>.Hwmon<N> where PREFIX is an autoconf configurable prefix (BUSNAME_PREFIX, xyz.openbmc_project by default), ID is a std::hash of the /sys/devices path backing the hwmon class instance, and N is the implemented phosphor-hwmon D-Bus API version.