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