From 26d255fb55b515d8ee21c82a067d6610abbd2463 Mon Sep 17 00:00:00 2001 From: Stewart Smith Date: Tue, 20 Jan 2015 18:27:34 +1100 Subject: Add skeleton for libc/ctype unit tests Now it shows up as untested in lcov! Signed-off-by: Stewart Smith --- libc/test/Makefile.check | 3 ++- libc/test/run-ctype-test.c | 33 +++++++++++++++++++++++++++++++++ libc/test/run-ctype.c | 27 +++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 libc/test/run-ctype-test.c create mode 100644 libc/test/run-ctype.c 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 +#include + +#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 +#include +#include +#include + +int main(void) +{ + return 0; +} -- cgit v1.1