aboutsummaryrefslogtreecommitdiff
path: root/ccan/list
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2014-12-18 18:21:29 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2014-12-18 18:21:29 +1100
commitc652989453649b8d27f85dcfb882efcec8dbf64d (patch)
treed6e881c2017b4355ffd08cc0c85ca7f7c2395fd7 /ccan/list
parent1f91d6796676dc75188011f6ef4d09fc8dd81a29 (diff)
downloadskiboot-c652989453649b8d27f85dcfb882efcec8dbf64d.zip
skiboot-c652989453649b8d27f85dcfb882efcec8dbf64d.tar.gz
skiboot-c652989453649b8d27f85dcfb882efcec8dbf64d.tar.bz2
Run the CCAN unit tests and add to coverage-report
With some fun Makefile rules, we can pick up all CCAN unit tests. We exclude the unit test source files from the lcov report itself. Add skeleton ccan config.h and tap.h that are enough for us to build and run the test suite. Currently, the minimalist versions should be fine (and we don't need CCAN configurator). Also includes -Werror fixes for ccan tests. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'ccan/list')
-rw-r--r--ccan/list/test/helper.c2
-rw-r--r--ccan/list/test/run-check-corrupt.c6
-rw-r--r--ccan/list/test/run-list_del_from-assert.c4
-rw-r--r--ccan/list/test/run-single-eval.c3
-rw-r--r--ccan/list/test/run.c4
5 files changed, 18 insertions, 1 deletions
diff --git a/ccan/list/test/helper.c b/ccan/list/test/helper.c
index ca4700b..4fb1c5a 100644
--- a/ccan/list/test/helper.c
+++ b/ccan/list/test/helper.c
@@ -1,6 +1,6 @@
#include <stdlib.h>
#include <stdbool.h>
-#include <timebase.h>
+#include <time.h>
#include <ccan/list/list.h>
#include "helper.h"
diff --git a/ccan/list/test/run-check-corrupt.c b/ccan/list/test/run-check-corrupt.c
index f4c20b5..da4578a 100644
--- a/ccan/list/test/run-check-corrupt.c
+++ b/ccan/list/test/run-check-corrupt.c
@@ -16,6 +16,9 @@ static int my_fprintf(FILE *stream, const char *format, ...)
{
va_list ap;
int ret;
+
+ (void)stream;
+
va_start(ap, format);
ret = vsnprintf(printf_buffer, sizeof(printf_buffer), format, ap);
va_end(ap);
@@ -32,6 +35,9 @@ int main(int argc, char *argv[])
struct list_node n1;
char expect[100];
+ (void)argc;
+ (void)argv;
+
plan_tests(9);
/* Empty list. */
list.n.next = &list.n;
diff --git a/ccan/list/test/run-list_del_from-assert.c b/ccan/list/test/run-list_del_from-assert.c
index 05d6cad..453dc0f 100644
--- a/ccan/list/test/run-list_del_from-assert.c
+++ b/ccan/list/test/run-list_del_from-assert.c
@@ -14,6 +14,9 @@ int main(int argc, char *argv[])
pid_t child;
int status;
+ (void)argc;
+ (void)argv;
+
plan_tests(1);
list_head_init(&list1);
list_head_init(&list2);
@@ -25,6 +28,7 @@ int main(int argc, char *argv[])
if (child) {
wait(&status);
} else {
+ close(2); /* Close stderr so we don't print confusing assert */
/* This should abort. */
list_del_from(&list1, &n3);
exit(0);
diff --git a/ccan/list/test/run-single-eval.c b/ccan/list/test/run-single-eval.c
index f90eed3..3c17e03 100644
--- a/ccan/list/test/run-single-eval.c
+++ b/ccan/list/test/run-single-eval.c
@@ -28,6 +28,9 @@ int main(int argc, char *argv[])
node_count = 0;
struct list_head list = LIST_HEAD_INIT(list);
+ (void)argc;
+ (void)argv;
+
plan_tests(74);
/* Test LIST_HEAD, LIST_HEAD_INIT, list_empty and check_list */
ok1(list_empty(ref(&static_list, static_count)));
diff --git a/ccan/list/test/run.c b/ccan/list/test/run.c
index 1d02acd..bc9d266 100644
--- a/ccan/list/test/run.c
+++ b/ccan/list/test/run.c
@@ -1,3 +1,4 @@
+#include <ccan/list/test/helper.c>
#include <ccan/list/list.h>
#include <ccan/tap/tap.h>
#include <ccan/list/list.c>
@@ -25,6 +26,9 @@ int main(int argc, char *argv[])
opaque_t *q, *nq;
struct list_head opaque_list = LIST_HEAD_INIT(opaque_list);
+ (void)argc;
+ (void)argv;
+
plan_tests(65);
/* Test LIST_HEAD, LIST_HEAD_INIT, list_empty and check_list */
ok1(list_empty(&static_list));