11 Commits

Author SHA1 Message Date
Mihai Tudor Panu
89d5de43e0 license: update to SPDX style license text throughout
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2020-03-05 15:13:36 -08:00
Noel Eck
c2ce3e8222 gtest: Bump up to 3ms min-delay for CI
Much less stringent unit test for min timing delay.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-07-31 15:46:21 -07:00
Noel Eck
db3c73cbd1 utilities: Update time/r methods for LINUX
Default to MONOTONIC clock for timer methods to avoid falling victim to
clock corrections.  Changed signatures from accepting pointers since
this is not needed an complicates calls and Java/JS/Python bindings.

    * Switched from nanosleep to clock_nanosleep to allow developers to
      provide a clock for LINUX
    * Default upm_clock_init to CLOCK_MONOTONIC
    * Updated logic to calculating delay and elapsed to be more readable
    * Added ns flavors for completeness
    * Refactored all upm_* delay/timer methods
    * Added #else for preprocessor cases w/o an #else
    * Added test for AQI
    * Added test fixture with logic to identify a minimum delay time
      which is used as a metric for testing all delay methods
    * Much more lenient unit testing of delays to minimize false CI
      failures

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-07-31 14:20:30 -07:00
Noel Eck
be46240b8c gtest: Qualify nmea_gps test with nmea_gps target
Change the unit test CMakeLists to only build the nmea_gps unit test if
the nmea_gps target exists.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-07-30 10:05:07 -07:00
Noel Eck
ef81a20140 gtest: Added headers to unit tests
Added missing headers for the C++ unit tests.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-07-18 13:51:01 -07:00
Noel Eck
6228498147 nmea_gps: Added parsing TXT and bw calculations
Added code to parse GPTXT nmea sentences.  Added methods to calculate
sentences/second and raw bytes/second.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-05-25 15:51:13 -07:00
Noel Eck
3a077df5f6 nmea_gps: Update to handle parsing into structures
NMEA GPS class now uses threads to handle parsing NMEA sentences.
Currently only handles GGA, GSV, and GLL types.  Added queues for
holding parsed data.

    * Parsing thread
    * Parse GPS Fix from GGA and GLL
    * Parse satellite info from GSV
    * Provide a queue for GPS fix data as well as raw sentences
      (for debugging)
    * Target structures and NMEAGPS class have a __str__() method
      which summarizes the objects into a std::string.  These are
      tied to the __str__ method in python
    * Added google unit test for the above functionality

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-05-23 08:30:22 -07:00
Noel Eck
76dd42a47d utilities_tests: Update us range for gtest
Be a bit more lenient with the acceptable range for the microsecond
flavor of upm_delay (+/- 150us instead of +/- 100us).

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-03-13 15:25:24 -07:00
Noel Eck
7254d5f75e gtest: Added custom target for all unit tests
Create a target which depends on all unit test executables for ease of
building/running.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-03-13 15:08:15 -07:00
Noel Eck
41e80d611e json: Added nlohmann's JSON C++ header
Adding JSON header for serializing/deserializing library descriptor JSON
files.

    * Added header
    * Added simple unit test to verify functionality

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-03-02 16:19:04 -08:00
Noel Eck
92b0919f56 gtest: Added Google Test
Added Google Test for unit testing.  Currently NOT required by UPM
CMake.

    * Added a test fixture for the utilities library.
    * Fixed bug in delay methods provided by utilities library.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-03-02 12:03:24 -08:00