tests CHANGE speedup building

Instead of including C source files and bilding each test from the
sources, use shared library objects and link them into the resulting
test executable.

Maintaining list of included C source files was unmaintainable with the
increasing number of source files and dependencies between them.
diff --git a/tests/src/test_common.c b/tests/src/test_common.c
index 92d34cb..b79f3ec 100644
--- a/tests/src/test_common.c
+++ b/tests/src/test_common.c
@@ -12,16 +12,12 @@
  *     https://opensource.org/licenses/BSD-3-Clause
  */
 
-#include "../../src/common.c"
-#include "../../src/compat.c"
-#include "../../src/log.c"
-
 #include <stdarg.h>
 #include <stddef.h>
 #include <setjmp.h>
 #include <cmocka.h>
 
-#include "libyang.h"
+#include "../../src/common.h"
 
 #define BUFSIZE 1024
 char logbuf[BUFSIZE] = {0};