Skip to content

Commit 5f2c6e5

Browse files
pillo79carlescufi
authored andcommitted
ztest: export ztest_test_* symbols to llexts
Export the minimal set of ztest_test_* symbols to llexts so that the zassert_* macros can be used by the extension code to affect test execution. Calling these also requires vprintk() to be exported. Signed-off-by: Luca Burelli <[email protected]>
1 parent 3769682 commit 5f2c6e5

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

lib/os/printk.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ void vprintk(const char *fmt, va_list ap)
154154
#endif
155155
}
156156
}
157+
EXPORT_SYMBOL(vprintk);
157158

158159
void z_impl_k_str_out(char *c, size_t n)
159160
{

subsys/testsuite/ztest/src/ztest.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#include <zephyr/logging/log_ctrl.h>
1414
#include <zephyr/sys/reboot.h>
1515

16+
#include <zephyr/llext/symbol.h>
17+
1618
#ifdef KERNEL
1719
static struct k_thread ztest_thread;
1820
#endif
@@ -324,6 +326,7 @@ void ztest_test_fail(void)
324326
longjmp(stack_fail, 1);
325327
}
326328
}
329+
EXPORT_SYMBOL(ztest_test_fail);
327330

328331
void ztest_test_pass(void)
329332
{
@@ -334,6 +337,7 @@ void ztest_test_pass(void)
334337
get_friendly_phase_name(cur_phase));
335338
longjmp(stack_fail, 1);
336339
}
340+
EXPORT_SYMBOL(ztest_test_pass);
337341

338342
void ztest_test_skip(void)
339343
{
@@ -348,6 +352,7 @@ void ztest_test_skip(void)
348352
longjmp(stack_fail, 1);
349353
}
350354
}
355+
EXPORT_SYMBOL(ztest_test_skip);
351356

352357
void ztest_test_expect_fail(void)
353358
{
@@ -471,6 +476,7 @@ void ztest_test_fail(void)
471476
break;
472477
}
473478
}
479+
EXPORT_SYMBOL(ztest_test_fail);
474480

475481
void ztest_test_pass(void)
476482
{
@@ -488,6 +494,7 @@ void ztest_test_pass(void)
488494
}
489495
}
490496
}
497+
EXPORT_SYMBOL(ztest_test_pass);
491498

492499
void ztest_test_skip(void)
493500
{
@@ -507,6 +514,7 @@ void ztest_test_skip(void)
507514
break;
508515
}
509516
}
517+
EXPORT_SYMBOL(ztest_test_skip);
510518

511519
void ztest_test_expect_fail(void)
512520
{

subsys/testsuite/ztest/src/ztest_defaults.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
#include <zephyr/ztest.h>
8+
#include <zephyr/llext/symbol.h>
89

910
/**
1011
* @brief Try to shorten a filename by removing the current directory
@@ -21,6 +22,7 @@ const char *ztest_relative_filename(const char *file)
2122
{
2223
return file;
2324
}
25+
EXPORT_SYMBOL(ztest_relative_filename);
2426

2527
/**
2628
* Default entry point for running registered unit tests.

0 commit comments

Comments
 (0)