diff --git a/.travis.yml b/.travis.yml index e72e542203..b65ff9cd54 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,10 @@ os: sudo: false +# Tests for cppunit require C++11 which requires gcc-4.8 or newer +# This is available in either "trusty" or newer distros, or in "docker" envs +#dist: trusty + services: - docker @@ -91,8 +95,9 @@ matrix: - aspell-en - env: BUILD_TYPE=default-tgt:distcheck-valgrind os: linux -# dist: trusty -# sudo: required + sudo: false + services: + - docker addons: apt: packages: @@ -107,12 +112,18 @@ matrix: - *deps_driverlibs - env: BUILD_TYPE=default-alldrv os: linux + sudo: false + services: + - docker addons: apt: packages: - *deps_driverlibs - env: BUILD_TYPE=default-tgt:distcheck-light os: linux + sudo: false + services: + - docker addons: apt: packages: diff --git a/clients/upsclient.c b/clients/upsclient.c index f749a4c7d0..b90587b001 100644 --- a/clients/upsclient.c +++ b/clients/upsclient.c @@ -25,7 +25,7 @@ #ifdef HAVE_PTHREAD /* this include is needed on AIX to have errno stored in thread local storage */ #include -#endif +#endif #include #include @@ -37,7 +37,6 @@ #include #include #include -#include #include "upsclient.h" #include "common.h" diff --git a/drivers/dstate.h b/drivers/dstate.h index f4e244afd8..dd1b920122 100644 --- a/drivers/dstate.h +++ b/drivers/dstate.h @@ -22,6 +22,7 @@ #ifndef DSTATE_H_SEEN #define DSTATE_H_SEEN 1 +#include "timehead.h" #include "state.h" #include "attribute.h" diff --git a/drivers/eaton-pdu-marlin-mib.c b/drivers/eaton-pdu-marlin-mib.c index 3b2d61273c..bd1f623974 100644 --- a/drivers/eaton-pdu-marlin-mib.c +++ b/drivers/eaton-pdu-marlin-mib.c @@ -244,7 +244,7 @@ static snmp_info_t eaton_marlin_mib[] = { SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL, NULL }, /* FIXME: needs a date reformating callback * 2011-8-29,16:27:25.0,+1:0 - * Hex-STRING: 07 DB 08 1D 10 0C 36 00 2B 01 00 00 + * Hex-STRING: 07 DB 08 1D 10 0C 36 00 2B 01 00 00 * { "ups.date", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.1.2.1.8.0", "", SU_FLAG_STATIC | SU_FLAG_OK, NULL, NULL }, * { "ups.time", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.1.2.1.8.0", @@ -500,7 +500,7 @@ static snmp_info_t eaton_marlin_mib[] = { /* instant commands. */ /* Notes: - * - load.cycle might be replaced by / mapped on shutdown.reboot + * - load.cycle might be replaced by / mapped on shutdown.reboot * - outletControl{Off,On,Reboot}Cmd values: * 0-n : Timer * -1 : Cancel diff --git a/tests/Makefile.am b/tests/Makefile.am index 4f1e893859..e44bb084e8 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,5 +1,9 @@ # Network UPS Tools: tests +# Tests with gcc-4.8 require this C++11 option to be provided explicitly +# gcc-4.6 does not support this yet; newer gcc's should be ok by default +CPPUNIT_NUT_CFLAGS = -g -O0 -std=c++11 + if HAVE_CPPUNIT TESTS = cppunittest @@ -11,7 +15,7 @@ check-local: $(check_PROGRAMS) RES=0; for P in $^ ; do $(VALGRIND) ./$$P || { RES=$$? ; echo "FAILED: $(VALGRIND) ./$$P" >&2; }; done; exit $$RES endif -cppunittest_CXXFLAGS = $(CPPUNIT_CFLAGS) +cppunittest_CXXFLAGS = $(CPPUNIT_CFLAGS) $(CPPUNIT_NUT_CFLAGS) cppunittest_LDFLAGS = $(CPPUNIT_LIBS) cppunittest_LDADD = ../clients/libnutclient.la