cmake: Add new tests to test suite

Bring functionality of the cmake build system up to autotools.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I2231b51cfd52460fb525b5af6893b0474508859b
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9775628..a0cace7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,7 +5,7 @@
 add_definitions (-DMCTP_HAVE_STDIO)
 add_definitions (-DMCTP_DEFAULT_ALLOC)
 
-add_library (mctp STATIC alloc.c core.c log.c libmctp.h serial.c)
+add_library (mctp STATIC alloc.c astlpc.c core.c log.c libmctp.h serial.c)
 
 target_include_directories (mctp PUBLIC
                             $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
@@ -21,6 +21,18 @@
 target_link_libraries (test_seq mctp)
 add_test (NAME seq COMMAND test_seq)
 
+add_executable (test_bridge tests/test_bridge.c tests/test-utils.c)
+target_link_libraries (test_bridge mctp)
+add_test (NAME bridge COMMAND test_bridge)
+
+add_executable (test_astlpc tests/test_astlpc.c tests/test-utils.c)
+target_link_libraries (test_astlpc mctp)
+add_test (NAME astlpc COMMAND test_astlpc)
+
+add_executable (test_serial tests/test_serial.c tests/test-utils.c)
+target_link_libraries (test_serial mctp)
+add_test (NAME serial COMMAND test_serial)
+
 install (TARGETS mctp DESTINATION lib)
 install (FILES libmctp.h DESTINATION include)
 
diff --git a/tests/test_astlpc.c b/tests/test_astlpc.c
index 2253e99..aea2858 100644
--- a/tests/test_astlpc.c
+++ b/tests/test_astlpc.c
@@ -1,6 +1,9 @@
 /* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */
 
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
+
 #include "libmctp-astlpc.h"
 #include "libmctp-log.h"
 
diff --git a/tests/test_serial.c b/tests/test_serial.c
index 905f664..9691037 100644
--- a/tests/test_serial.c
+++ b/tests/test_serial.c
@@ -2,7 +2,9 @@
 
 #define _GNU_SOURCE
 
+#if HAVE_CONFIG_H
 #include "config.h"
+#endif
 
 #include "libmctp-log.h"
 #include "libmctp-serial.h"