aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libc/test/Makefile.check2
-rw-r--r--libc/test/run-memops-test.c43
-rw-r--r--libc/test/run-memops.c27
3 files changed, 71 insertions, 1 deletions
diff --git a/libc/test/Makefile.check b/libc/test/Makefile.check
index 6247e30..faebd86 100644
--- a/libc/test/Makefile.check
+++ b/libc/test/Makefile.check
@@ -4,7 +4,7 @@ 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_DUALLIB_TEST := libc/test/run-snprintf libc/test/run-memops
LCOV_EXCLUDE += $(LIBC_TEST:%=%.c) $(LIBC_DUALLIB_TEST:%=%.c) $(LIBC_DUALLIB_TEST:%=%-test.c)
diff --git a/libc/test/run-memops-test.c b/libc/test/run-memops-test.c
new file mode 100644
index 0000000..0979994
--- /dev/null
+++ b/libc/test/run-memops-test.c
@@ -0,0 +1,43 @@
+/* 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 "../string/memchr.c"
+#include "../string/memcmp.c"
+#include "../string/memcpy.c"
+#include "../string/memmove.c"
+#include "../string/memset.c"
+#include "../string/strcasecmp.c"
+#include "../string/strcat.c"
+#include "../string/strchr.c"
+#include "../string/strcmp.c"
+#include "../string/strcpy.c"
+/* #include "../string/strdup.c" */
+#include "../string/strlen.c"
+#include "../string/strncasecmp.c"
+#include "../string/strncmp.c"
+#include "../string/strncpy.c"
+#include "../string/strstr.c"
+#include "../string/strtok.c"
diff --git a/libc/test/run-memops.c b/libc/test/run-memops.c
new file mode 100644
index 0000000..15ec9bd
--- /dev/null
+++ b/libc/test/run-memops.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;
+}