aboutsummaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2015-01-20 18:23:15 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-01-20 18:23:15 +1100
commitebfd0fdbab7eb6e97a4e8f36a04ea0e60c7441bf (patch)
treef74789c8d8813b6d73481ab99f82072b1a7c4dcc /libc
parent721e826e6fddc77c64f6519c7878bf2046c37ca3 (diff)
downloadskiboot-ebfd0fdbab7eb6e97a4e8f36a04ea0e60c7441bf.zip
skiboot-ebfd0fdbab7eb6e97a4e8f36a04ea0e60c7441bf.tar.gz
skiboot-ebfd0fdbab7eb6e97a4e8f36a04ea0e60c7441bf.tar.bz2
Add skeleton for libc/stdlib unit test
Now it shows up as untested in lcov! Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'libc')
-rw-r--r--libc/test/Makefile.check4
-rw-r--r--libc/test/run-stdlib-test.c32
-rw-r--r--libc/test/run-stdlib.c27
3 files changed, 62 insertions, 1 deletions
diff --git a/libc/test/Makefile.check b/libc/test/Makefile.check
index faebd86..5bc60c6 100644
--- a/libc/test/Makefile.check
+++ b/libc/test/Makefile.check
@@ -4,7 +4,9 @@ LIBC_TEST := libc/test/run-time
# We have some tricky tests that have system libc and skiboot libc,
# so that we can test parts of skiboot libc but in userspace.
-LIBC_DUALLIB_TEST := libc/test/run-snprintf libc/test/run-memops
+LIBC_DUALLIB_TEST := libc/test/run-snprintf \
+ libc/test/run-memops \
+ libc/test/run-stdlib
LCOV_EXCLUDE += $(LIBC_TEST:%=%.c) $(LIBC_DUALLIB_TEST:%=%.c) $(LIBC_DUALLIB_TEST:%=%-test.c)
diff --git a/libc/test/run-stdlib-test.c b/libc/test/run-stdlib-test.c
new file mode 100644
index 0000000..d48c5d5
--- /dev/null
+++ b/libc/test/run-stdlib-test.c
@@ -0,0 +1,32 @@
+/* Copyright 2013-2015 IBM Corp.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * This file is run with the skiboot libc files rather than system libc.
+ * This means we have a bit of "fun" with actually executing the tests on
+ * the host.
+ * Patches to make this less ugly are very welcome.
+ */
+
+#include <config.h>
+#include <stdarg.h>
+
+#include "../stdlib/atoi.c"
+#include "../stdlib/atol.c"
+#include "../stdlib/error.c"
+#include "../stdlib/rand.c"
+#include "../stdlib/strtol.c"
+#include "../stdlib/strtoul.c"
diff --git a/libc/test/run-stdlib.c b/libc/test/run-stdlib.c
new file mode 100644
index 0000000..15ec9bd
--- /dev/null
+++ b/libc/test/run-stdlib.c
@@ -0,0 +1,27 @@
+/* Copyright 2013-2015 IBM Corp.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define BUFSZ 50
+
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+#include <stdio.h>
+
+int main(void)
+{
+ return 0;
+}