summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* build: enable valgrindPatrick Venture2019-03-211-0/+2
| | | | | | | Enable valgrind to check memory usage. Change-Id: I73ec2ee1a92e797ea9b78d6ea440f9ccdd2f49f3 Signed-off-by: Patrick Venture <venture@google.com>
* build: enable code coveragePatrick Venture2019-03-191-2/+8
| | | | | | | | | Enable code coverage for the project. Valgrind not enabled in this step. Tested: Verified code coverage step now running. Change-Id: Ieb3606e5ad741fb0dd181f8da594c18258efa6bc Signed-off-by: Patrick Venture <venture@google.com>
* test: rework gtest/gmock lookupPatrick Venture2019-03-061-4/+6
| | | | | | | Rework the gtest/gmock lookup based on openbmc/gpioplus. Change-Id: Ic53928e6f8b7a30e801976d62c910fe31bd4cc49 Signed-off-by: Patrick Venture <venture@google.com>
* test: rework to use Pair-wise comparisonPatrick Venture2019-03-061-19/+29
| | | | | | | Use Pair-wise comparison instead of straight equality check. Change-Id: I3aa567015bfbd81578275fc0edf1ef785fde7678 Signed-off-by: Patrick Venture <venture@google.com>
* test: add adjustvalue testPatrick Venture2019-01-251-0/+35
| | | | | | | | Add a test that calls adjust value on a sensor value to verify it's processed as expected. Change-Id: Iff299efced680c730d7ba5bdeff71617446db042 Signed-off-by: Patrick Venture <venture@google.com>
* sensor: add gpio handle test variationPatrick Venture2019-01-092-2/+47
| | | | | | | Add a sensor constructor test where the gpio handle is required. Change-Id: I05050fb71a6287183ca94f974e965e3f58de9499 Signed-off-by: Patrick Venture <venture@google.com>
* test: add gpiohandle mock implPatrick Venture2019-01-022-0/+44
| | | | | | | Add gpio handle mock implementation for use in testing. Change-Id: I0fb2d1af4739ad700f62a4e7cbbe62db528bb93e Signed-off-by: Patrick Venture <venture@google.com>
* test: add tests for creating sensor objectsPatrick Venture2019-01-022-1/+65
| | | | | | | Add a variety of tests for different sensor constructor scenarios. Change-Id: I859a9473e3c80fb06b0ae15f0eeb8217ee390b11 Signed-off-by: Patrick Venture <venture@google.com>
* test: add environment mock implPatrick Venture2019-01-022-0/+71
| | | | | | | Add environment mock implementation for use in testing. Change-Id: I5a8efe994692a2e4436bf7f3c0155516d92b49c6 Signed-off-by: Patrick Venture <venture@google.com>
* clang-format: fix pointer alignment, sort usingPatrick Venture2018-09-041-8/+8
| | | | | Change-Id: Ia1b19aeba59b2f680b62ce3855e929b9ad77377a Signed-off-by: Patrick Venture <venture@google.com>
* add .clang-formatPatrick Venture2018-08-313-115/+64
| | | | | Change-Id: I94ce26d595367e08d6fb3734535bcd855f1b1473 Signed-off-by: Patrick Venture <venture@google.com>
* update configure and test/Makefile.amPatrick Venture2018-06-271-5/+4
| | | | | | | | Update configure.ac and test/Makefile.am to properly handle newer googletest, per gerrit/11203. Change-Id: I13563216784389d0a32f802daf23d75658e0288e Signed-off-by: Patrick Venture <venture@google.com>
* hwmonio:: Add Interface base class and testsPatrick Venture2018-06-143-1/+256
| | | | | | | | | | Enable injecting hwmonio::HwmonIO mocks for testing. Tested: Ran on quanta-q71l and saw all sensors exported to dbus as expected with the expected values. Change-Id: I35912bf2a733932d9e1e774ff53b0114ae16560b Signed-off-by: Patrick Venture <venture@google.com>
* hwmon module unit-tests -- first onePatrick Venture2018-04-243-0/+33
| | | | | | | | This patchset just starts the process of adding unit-tests to the hwmon module. Change-Id: I569aa97658b0ff56634ddf1a599fedb4caa95abe Signed-off-by: Patrick Venture <venture@google.com>
* test: moved to toolsPatrick Venture2018-04-246-246/+0
| | | | | | | | | | | Moved the current test folder to tools and started a new test folder. This will allow for rapid introduction of new unit-tests into phosphor-hwmon. The tools folder contains small tools to aid in phosphor-hwmon configuration and misc. This folder will go under review at another time. Change-Id: Ice18ffb5cdcbd519d49088e233a8082a9410b03e Signed-off-by: Patrick Venture <venture@google.com>
* Add findHwmonFromDevPath()Matt Spinler2018-03-071-0/+6
| | | | | | | | | | | | | | | | | | This function can find the hwmon path from a /devices path. This path is similar to what udev lists as the device path, but with the /hwmon/hwmonN directories removed from the end. In addition, any ':' characters in the path have been converted to '--', so the code needs to convert them back. This is done because some devices are not in the device tree, and hence wouldn't have the open firmware device path that the code previously only supported. Tested: Tested with the new /devices path. Change-Id: Ic26646c6f609323cff86d4cd10bbe0a44d7d61ac Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Rename functionMatt Spinler2018-03-051-1/+1
| | | | | | | | | | | A future commit will add a new function to find the hwmon device from a different type of path, so clarify the current function name in preparation. Tested: Compiled Change-Id: I3c990f4a91b12e592e22818b085dcd3736e5fcde Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* sysfs IO enhancementsBrad Bishop2017-09-081-2/+7
| | | | | | | | | | | | | | | | | | Add retries for some sysfs IO errors: EIO: Tolerate intermittant device or bus failures. ETIMEDOUT: Tolerate intermittant timeouts. EAGAIN: Tolerate drivers that do not block. ENXIO: Tolerate momentarily unplugged devices on busses that don't support hotplug. EBADMSG: Tolerate CRC errors. Flush stdio buffers after writes. Remove redundant retry and delay constants. Resolves: openbmc/openbmc#2262 Change-Id: I2104139bf7ced96bb10f7450b42ca36e61c84287 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* test: Add a number of test applicationsBrad Bishop2017-08-315-1/+163
| | | | | | | Add a number of applications for testing. Change-Id: I2d85c33d0d85f2a551e644a722107bb78250b2cd Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* mainloop: Cache devpath at startupBrad Bishop2017-08-311-0/+1
| | | | | | | | | | Currently the devpath is determined after a bus error to make a callout. Finding the path at startup is less prone to race conditions around ENOENT on driver unload in the event of a callout. Change-Id: I8ce8d9f630c8b7ecc398082002aa113ab352d3cb Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Build: Autotools usage improvementsBrad Bishop2017-03-081-3/+8
| | | | | | | | | | | Use libtool defaults. Define CXXFLAGS rather than CFLAGS. Add libraries via LIBADD rather than LDFLAGS. This allows --as-needed to drop unnecessary libs if present. Don't bother with PIC objects for convenience library. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com> Change-Id: I4a6079402a01ad5f6ccfb71ca9fca44c567ec62d
* Link to libphosphor_dbusBrad Bishop2017-02-161-2/+2
| | | | | | | Remove manually generated server bindings. Change-Id: I77ccda7f669d58f55e86ee5887dbbb380c673390 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Test: Remove unnecessary server_thread methodBrad Bishop2017-01-171-10/+6
| | | | | | | | | std::thread allows any callback signature so remove the usual pthread void * foo(void *) wrapper when starting the server thread. Change-Id: I3b9e705da97258933a0c6b294c2c3bbdb8f98a27 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Avoid unnecessary move operationBrad Bishop2017-01-171-4/+4
| | | | | Change-Id: I7fcdbb653b36cfd1bb2566bf59861867d368c9df Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Grab DBus connectionBrad Bishop2017-01-131-0/+1
| | | | | | | | Connect to DBus and own a busname. Create a freedesktop ObjectManager. Change-Id: I186dadc5a5172f44edf9cfc8d0a338677636de04 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add config optionsBrad Bishop2017-01-131-1/+3
| | | | | | | | Obtain the DBus service name prefix and sensors namespace root path from the configure script. Change-Id: I5c48882b62b09a466b3b7b30b3935d65ccc58326 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Add testcaseBrad Bishop2017-01-133-0/+68
Add a basic test that simply runs the server. Change-Id: Ie682df8cf4dd755852e4fb07ccbc83e8bb13d629 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
OpenPOWER on IntegriCloud