Skip to content

Commit

Permalink
tests: sprintf: convert normal test to use ztest
Browse files Browse the repository at this point in the history
This patch convert net test cases to use ztest framework APIs
which makes output unified to other test cases.

Signed-off-by: Punit Vara <punit.vara@intel.com>
  • Loading branch information
punitvara committed Aug 30, 2017
1 parent f468b23 commit 8d67228
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 401 deletions.
1 change: 1 addition & 0 deletions tests/kernel/sprintf/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ CONFIG_STDOUT_CONSOLE=y
CONFIG_NUM_IRQS=2
CONFIG_FLOAT=y
CONFIG_MAIN_STACK_SIZE=2048
CONFIG_ZTEST=y
3 changes: 2 additions & 1 deletion tests/kernel/sprintf/src/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ccflags-y += -I${ZEPHYR_BASE}/tests/include
include ${ZEPHYR_BASE}/tests/Makefile.test

obj-y = test_sprintf.o
obj-y = test_sprintf.o main.o
36 changes: 36 additions & 0 deletions tests/kernel/sprintf/src/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (c) 2017 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/

/**
* @addtogroup t_kernel_sprintf
* @{
* @defgroup t_sprintf_api test_sorintf_fn
* @}
*/

#include <ztest.h>
extern void sprintf_double_test(void);
extern void vsnprintf_test(void);
extern void vsprintf_test(void);
extern void snprintf_test(void);
extern void sprintf_misc_test(void);
extern void sprintf_integer_test(void);
extern void sprintf_stringtest(void);

/*test case main entry*/
void test_main(void *p1, void *p2, void *p3)
{
ztest_test_suite(test_sprintf_fn,
ztest_unit_test(sprintf_double_test),
ztest_unit_test(vsnprintf_test),
ztest_unit_test(vsprintf_test),
ztest_unit_test(snprintf_test),
ztest_unit_test(sprintf_misc_test),
ztest_unit_test(sprintf_integer_test),
ztest_unit_test(sprintf_stringtest));

ztest_run_test_suite(test_sprintf_fn);
}
Loading

0 comments on commit 8d67228

Please sign in to comment.