Skip to content

Commit 17097f1

Browse files
committed
tests: move lib/timespec_util to unit/timeutil
Since native_sim and unit_testing platforms can now be compiled with time_t as 64-bits, that means that all platforms in Zephyr are consistent. Move the (now platform-independent) lib/timespec_util tests to unit/timeutil. Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
1 parent 95807ab commit 17097f1

File tree

6 files changed

+5
-49
lines changed

6 files changed

+5
-49
lines changed

tests/lib/timespec_util/CMakeLists.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/lib/timespec_util/prj.conf

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/lib/timespec_util/testcase.yaml

Lines changed: 0 additions & 36 deletions
This file was deleted.

tests/unit/timeutil/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ target_sources(testbinary
1414
test_s32.c
1515
test_s64.c
1616
test_sync.c
17+
timespec.c
1718
)

tests/unit/timeutil/main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
#include "timeutil_test.h"
99
#include "../../../lib/utils/timeutil.c"
1010

11+
extern void *setup(void);
12+
1113
void timeutil_check(const struct timeutil_test_data *tp,
1214
size_t count)
1315
{
@@ -52,4 +54,4 @@ void timeutil_check(const struct timeutil_test_data *tp,
5254
}
5355
}
5456

55-
ZTEST_SUITE(timeutil_api, NULL, NULL, NULL, NULL, NULL);
57+
ZTEST_SUITE(timeutil_api, NULL, setup, NULL, NULL, NULL);

tests/lib/timespec_util/src/main.c renamed to tests/unit/timeutil/timespec.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ ZTEST(timeutil_api, test_timespec_to_timeout)
365365
}
366366
}
367367

368-
static void *setup(void)
368+
void *setup(void)
369369
{
370370
printk("CONFIG_64BIT=%c\n", IS_ENABLED(CONFIG_64BIT) ? 'y' : 'n');
371371
printk("CONFIG_TIMEOUT_64BIT=%c\n", CONFIG_TIMEOUT_64BIT ? 'y' : 'n');
@@ -377,5 +377,3 @@ static void *setup(void)
377377

378378
return NULL;
379379
}
380-
381-
ZTEST_SUITE(timeutil_api, NULL, setup, NULL, NULL, NULL);

0 commit comments

Comments
 (0)