test: add tests for creating sensor objects

Add a variety of tests for different sensor constructor scenarios.

Change-Id: I859a9473e3c80fb06b0ae15f0eeb8217ee390b11
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/test/Makefile.am b/test/Makefile.am
index b9a3c49..8573194 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -11,7 +11,7 @@
 	$(PHOSPHOR_DBUS_INTERFACES_LIBS)
 
 # Run all 'check' test programs
-check_PROGRAMS = hwmon_unittest fanpwm_unittest
+check_PROGRAMS = hwmon_unittest fanpwm_unittest sensor_unittest
 TESTS = $(check_PROGRAMS)
 
 hwmon_unittest_SOURCES = hwmon_unittest.cpp
@@ -19,3 +19,16 @@
 
 fanpwm_unittest_SOURCES = fanpwm_unittest.cpp
 fanpwm_unittest_LDADD = $(PHOSPHOR_LOGGING_LIBS) $(top_builddir)/fan_pwm.o
+
+sensor_unittest_SOURCES = sensor_unittest.cpp
+sensor_unittest_CXXFLAGS = \
+	$(PHOSPHOR_LOGGING_CFLAGS) \
+	$(GPIOPLUS_CFLAGS)
+sensor_unittest_LDADD = \
+	-lstdc++fs \
+	$(PHOSPHOR_LOGGING_LIBS) \
+	$(GPIOPLUS_LIBS) \
+	$(top_builddir)/sensor.o \
+	$(top_builddir)/hwmon.o \
+	$(top_builddir)/gpio_handle.o \
+	env.o