Skip to content

Commit 7b3ed2f

Browse files
nashifkartben
authored andcommitted
tests: kernel/common: cleanup doxygen
Fix grouping and general doxygen fixups. Signed-off-by: Anas Nashif <[email protected]>
1 parent 7d36a18 commit 7b3ed2f

File tree

11 files changed

+114
-65
lines changed

11 files changed

+114
-65
lines changed

tests/kernel/common/src/atomic.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ static struct k_thread thread[THREADS_NUM];
2828
atomic_t total_atomic;
2929

3030
/**
31-
* @addtogroup kernel_common_tests
31+
* @defgroup kernel_atomic_ops_tests Atomic Operations
32+
* @ingroup all_tests
33+
* @{
34+
* @}
35+
*
36+
* @addtogroup kernel_atomic_ops_tests
3237
* @{
3338
*/
3439

@@ -92,7 +97,6 @@ atomic_t total_atomic;
9297
* atomic_test_and_set_bit(), atomic_clear_bit(), atomic_set_bit(),
9398
* ATOMIC_DEFINE
9499
*
95-
* @ingroup kernel_common_tests
96100
*/
97101
ZTEST_USER(atomic, test_atomic)
98102
{
@@ -312,7 +316,6 @@ void atomic_handler(void *p1, void *p2, void *p3)
312316
* In this time, the two sub threads will be scheduled separately
313317
* according to the time slice.
314318
*
315-
* @ingroup kernel_common_tests
316319
*/
317320
ZTEST(atomic, test_threads_access_atomic)
318321
{
@@ -349,7 +352,6 @@ ZTEST(atomic, test_threads_access_atomic)
349352
* in a non-atomic manner (as long as it is logically safe)
350353
* and expect its value to match the result of the similar atomic increment.
351354
*
352-
* @ingroup kernel_common_tests
353355
*/
354356
ZTEST(atomic, test_atomic_overflow)
355357
{
@@ -383,8 +385,8 @@ ZTEST(atomic, test_atomic_overflow)
383385
atomic_value);
384386
}
385387

386-
extern void *common_setup(void);
387-
ZTEST_SUITE(atomic, NULL, common_setup, NULL, NULL, NULL);
388388
/**
389389
* @}
390390
*/
391+
extern void *common_setup(void);
392+
ZTEST_SUITE(atomic, NULL, common_setup, NULL, NULL, NULL);

tests/kernel/common/src/bitarray.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@
2222
#define BITFIELD_SIZE 512
2323

2424
/**
25-
* @addtogroup kernel_common_tests
25+
* @defgroup kernel_bitarray_tests Bit Arrays
26+
* @ingroup all_tests
27+
* @{
28+
* @}
29+
*
30+
* @addtogroup kernel_bitarray_tests
2631
* @{
2732
*/
2833

@@ -1058,9 +1063,8 @@ ZTEST(bitarray, test_ffs)
10581063
zassert_equal(find_lsb_set(value), bit + 1, "LSB is not matched");
10591064
}
10601065
}
1061-
extern void *common_setup(void);
1062-
ZTEST_SUITE(bitarray, NULL, common_setup, NULL, NULL, NULL);
1063-
10641066
/**
10651067
* @}
10661068
*/
1069+
extern void *common_setup(void);
1070+
ZTEST_SUITE(bitarray, NULL, common_setup, NULL, NULL, NULL);

tests/kernel/common/src/bitfield.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@
1919
#define BITFIELD_SIZE 512
2020

2121
/**
22-
* @addtogroup kernel_common_tests
22+
* @defgroup kernel_bitfield_tests Bit Fields
23+
* @ingroup all_tests
24+
* @{
25+
* @}
26+
*
27+
* @addtogroup kernel_bitfield_tests
2328
* @{
2429
*/
2530

@@ -131,10 +136,10 @@ ZTEST(bitfield, test_bitfield)
131136

132137
}
133138

134-
extern void *common_setup(void);
135-
136-
ZTEST_SUITE(bitfield, NULL, common_setup, NULL, NULL, NULL);
137-
138139
/**
139140
* @}
140141
*/
142+
143+
extern void *common_setup(void);
144+
145+
ZTEST_SUITE(bitfield, NULL, common_setup, NULL, NULL, NULL);

tests/kernel/common/src/boot_delay.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@
66

77
#include <zephyr/ztest.h>
88

9+
910
/**
10-
* @brief Test delay during boot
11-
* @defgroup kernel_init_tests Init
11+
* @defgroup kernel_init_tests Kernel Initialization
1212
* @ingroup all_tests
1313
* @{
14+
* @}
15+
*
16+
* @addtogroup kernel_init_tests
17+
* @{
1418
*/
1519

1620
/**
@@ -39,9 +43,9 @@ ZTEST(boot_delay, test_bootdelay)
3943
(NSEC_PER_MSEC * CONFIG_BOOT_DELAY));
4044
}
4145

42-
extern void *common_setup(void);
43-
ZTEST_SUITE(boot_delay, NULL, common_setup, NULL, NULL, NULL);
44-
4546
/**
4647
* @}
4748
*/
49+
50+
extern void *common_setup(void);
51+
ZTEST_SUITE(boot_delay, NULL, common_setup, NULL, NULL, NULL);

tests/kernel/common/src/byteorder.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@
1010
#include <zephyr/sys/byteorder.h>
1111

1212
/**
13-
* @addtogroup kernel_common_tests
13+
* @defgroup kernel_byteorder_tests Byteorder Operations
14+
* @ingroup all_tests
15+
* @{
16+
* @}
17+
*
18+
* @addtogroup kernel_byteorder_tests
1419
* @{
1520
*/
21+
1622
/**
1723
* @brief Test swapping for memory contents
1824
*
@@ -704,9 +710,10 @@ ZTEST(byteorder, test_sys_get_be)
704710
zassert_mem_equal(host, exp, sizeof(exp), "sys_get_be() failed");
705711
}
706712

707-
extern void *common_setup(void);
708-
ZTEST_SUITE(byteorder, NULL, common_setup, NULL, NULL, NULL);
709-
710713
/**
711714
* @}
712715
*/
716+
717+
718+
extern void *common_setup(void);
719+
ZTEST_SUITE(byteorder, NULL, common_setup, NULL, NULL, NULL);

tests/kernel/common/src/clock.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@ static ZTEST_BMEM struct timer_data tdata;
2929
#define LESS_DURATION 70
3030

3131
/**
32-
* @addtogroup kernel_common_tests
32+
* @defgroup kernel_clock_tests Clock Operations
33+
* @ingroup all_tests
34+
* @{
35+
* @}
36+
*
37+
* @addtogroup kernel_clock_tests
3338
* @{
3439
*/
3540

@@ -231,9 +236,9 @@ ZTEST(clock, test_ms_time_duration)
231236
k_timer_stop(&ktimer);
232237
}
233238

234-
extern void *common_setup(void);
235-
ZTEST_SUITE(clock, NULL, common_setup, NULL, NULL, NULL);
236-
237239
/**
238240
* @}
239241
*/
242+
243+
extern void *common_setup(void);
244+
ZTEST_SUITE(clock, NULL, common_setup, NULL, NULL, NULL);

tests/kernel/common/src/constructor.c

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
#include <errno.h>
99
#include <zephyr/tc_util.h>
1010
#include <zephyr/ztest.h>
11-
/**
12-
* @addtogroup kernel_common_tests
13-
* @{
14-
*/
1511

1612
/**
17-
* @brief Test if constructors work
13+
* @defgroup kernel_constructor_tests Constructors
14+
* @ingroup all_tests
15+
* @{
16+
* @}
1817
*
18+
* @addtogroup kernel_constructor_tests
19+
* @{
1920
*/
2021

2122
static int constructor_number;
@@ -35,7 +36,10 @@ void __attribute__((__constructor__(1000))) __constructor_init_priority_1000(voi
3536
{
3637
constructor_values[constructor_number++] = 1000;
3738
}
38-
39+
/**
40+
* @brief Test if constructors work
41+
*
42+
*/
3943
ZTEST(constructor, test_constructor)
4044
{
4145
zassert_equal(constructor_number, 3,
@@ -51,9 +55,9 @@ ZTEST(constructor, test_constructor)
5155
"constructor without priority not called last");
5256
}
5357

54-
extern void *common_setup(void);
55-
ZTEST_SUITE(constructor, NULL, common_setup, NULL, NULL, NULL);
56-
5758
/**
5859
* @}
5960
*/
61+
62+
extern void *common_setup(void);
63+
ZTEST_SUITE(constructor, NULL, common_setup, NULL, NULL, NULL);

tests/kernel/common/src/errno.c

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,7 @@
99
#include <errno.h>
1010
#include <zephyr/sys/errno_private.h>
1111

12-
/**
13-
* @brief Test the thread context
14-
*
15-
* @defgroup kernel_threadcontext_tests Thread Context Tests
16-
*
17-
* @ingroup all_tests
18-
*
19-
* @{
20-
* @}
21-
*/
12+
2213
#define N_THREADS 2
2314
#define STACK_SIZE (384 + CONFIG_TEST_EXTRA_STACK_SIZE)
2415

@@ -59,11 +50,17 @@ static void errno_thread(void *_n, void *_my_errno, void *_unused)
5950

6051
k_fifo_put(&fifo, &result[n]);
6152
}
62-
6353
/**
64-
* @brief Verify thread context
54+
* @defgroup kernel_errno_tests Error Number
55+
* @ingroup all_tests
56+
* @{
57+
* @}
6558
*
66-
* @ingroup kernel_threadcontext_tests
59+
* @addtogroup kernel_errno_tests
60+
* @{
61+
*/
62+
/**
63+
* @brief Verify thread context
6764
*
6865
* @details Check whether variable value per-thread are saved during
6966
* context switch
@@ -140,8 +137,6 @@ void thread_entry_user(void *p1, void *p2, void *p3)
140137
*
141138
* @details Check whether a C standard errno can be stored successfully,
142139
* no matter it is using tls or not.
143-
*
144-
* @ingroup kernel_threadcontext_tests
145140
*/
146141
ZTEST_USER(common_errno, test_errno)
147142
{
@@ -160,6 +155,8 @@ ZTEST_USER(common_errno, test_errno)
160155
k_thread_join(tid, K_FOREVER);
161156
}
162157

158+
/**
159+
* @}
160+
*/
163161
extern void *common_setup(void);
164-
165162
ZTEST_SUITE(common_errno, NULL, common_setup, NULL, NULL, NULL);

tests/kernel/common/src/irq_offload.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@
1717
#include <zephyr/kernel_structs.h>
1818
#include <zephyr/irq_offload.h>
1919

20+
/**
21+
* @defgroup kernel_irq_offload_tests IRQ Offload
22+
* @ingroup all_tests
23+
* @{
24+
* @}
25+
*
26+
* @addtogroup kernel_irq_offload_tests
27+
* @{
28+
*/
29+
2030
volatile uint32_t sentinel;
2131
#define SENTINEL_VALUE 0xDEADBEEF
2232

@@ -36,8 +46,6 @@ static void offload_function(const void *param)
3646
/**
3747
* @brief Verify thread context
3848
*
39-
* @ingroup kernel_interrupt_tests
40-
*
4149
* @details Check whether offloaded running function is in interrupt
4250
* context, on the IRQ stack or not.
4351
*/
@@ -97,7 +105,8 @@ static void offload_thread_fn(void *p0, void *p1, void *p2)
97105
}
98106
}
99107

100-
/* Invoke irq_offload() from an interrupt and verify that the
108+
/**
109+
* @brief Invoke irq_offload from an interrupt and verify that the
101110
* resulting nested interrupt doesn't explode
102111
*/
103112
ZTEST(common_1cpu, test_nested_irq_offload)
@@ -130,6 +139,8 @@ ZTEST(common_1cpu, test_nested_irq_offload)
130139

131140
k_thread_abort(&offload_thread);
132141
}
133-
142+
/**
143+
*
144+
*/
134145
extern void *common_setup(void);
135146
ZTEST_SUITE(irq_offload, NULL, common_setup, NULL, NULL, NULL);

tests/kernel/common/src/printk.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,14 @@ static int ram_console_out(int character)
181181
pos = (pos + 1) % BUF_SZ;
182182
return _old_char_out(character);
183183
}
184+
184185
/**
185-
* @addtogroup kernel_common_tests
186+
* @defgroup kernel_printk_tests Printk
187+
* @ingroup all_tests
188+
* @{
189+
* @}
190+
*
191+
* @addtogroup kernel_printk_tests
186192
* @{
187193
*/
188194

@@ -253,9 +259,9 @@ ZTEST(printk, test_printk)
253259
zassert_str_equal(pk_console, expected, "snprintk failed");
254260
}
255261

256-
extern void *common_setup(void);
257-
ZTEST_SUITE(printk, NULL, common_setup, NULL, NULL, NULL);
258262

259263
/**
260264
* @}
261265
*/
266+
extern void *common_setup(void);
267+
ZTEST_SUITE(printk, NULL, common_setup, NULL, NULL, NULL);

0 commit comments

Comments
 (0)