aboutsummaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2015-01-20 18:27:34 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-01-20 18:27:34 +1100
commit26d255fb55b515d8ee21c82a067d6610abbd2463 (patch)
tree7d7c1531ba3997d34126695547bcd777d61fe36d /libc
parentebfd0fdbab7eb6e97a4e8f36a04ea0e60c7441bf (diff)
downloadskiboot-26d255fb55b515d8ee21c82a067d6610abbd2463.zip
skiboot-26d255fb55b515d8ee21c82a067d6610abbd2463.tar.gz
skiboot-26d255fb55b515d8ee21c82a067d6610abbd2463.tar.bz2
Add skeleton for libc/ctype unit tests
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.check3
-rw-r--r--libc/test/run-ctype-test.c33
-rw-r--r--libc/test/run-ctype.c27
3 files changed, 62 insertions, 1 deletions
diff --git a/libc/test/Makefile.check b/libc/test/Makefile.check
index 5bc60c6..f37fe93 100644
--- a/libc/test/Makefile.check
+++ b/libc/test/Makefile.check
@@ -6,7 +6,8 @@ LIBC_TEST := libc/test/run-time
LIBC_DUALLIB_TEST := libc/test/run-snprintf \
libc/test/run-memops \
- libc/test/run-stdlib
+ libc/test/run-stdlib \
+ libc/test/run-ctype
LCOV_EXCLUDE += $(LIBC_TEST:%=%.c) $(LIBC_DUALLIB_TEST:%=%.c) $(LIBC_DUALLIB_TEST:%=%-test.c)
diff --git a/libc/test/run-ctype-test.c b/libc/test/run-ctype-test.c
new file mode 100644
index 0000000..5ba76f1
--- /dev/null
+++ b/libc/test/run-ctype-test.c
@@ -0,0 +1,33 @@
+/* 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 "../ctype/isdigit.c"
+#include "../ctype/isprint.c"
+#include "../ctype/isspace.c"
+#include "../ctype/isxdigit.c"
+#include "../ctype/tolower.c"
+#include "../ctype/toupper.c"
+
diff --git a/libc/test/run-ctype.c b/libc/test/run-ctype.c
new file mode 100644
index 0000000..15ec9bd
--- /dev/null
+++ b/libc/test/run-ctype.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;
+}