<div dir="ltr">Seems ok.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 3, 2023 at 3:58 AM Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Move the RTEMS test printer and rtems_test_exit() to separate files, to<br>
remove dependencies from the begin/end test messsage support.<br>
<br>
Update #4963.<br>
---<br>
cpukit/libtest/testbeginend.c | 28 -------------<br>
cpukit/libtest/testexit.c | 47 ++++++++++++++++++++++<br>
cpukit/libtest/testprinter.c | 63 ++++++++++++++++++++++++++++++<br>
spec/build/cpukit/librtemstest.yml | 2 +<br>
4 files changed, 112 insertions(+), 28 deletions(-)<br>
create mode 100644 cpukit/libtest/testexit.c<br>
create mode 100644 cpukit/libtest/testprinter.c<br>
<br>
diff --git a/cpukit/libtest/testbeginend.c b/cpukit/libtest/testbeginend.c<br>
index eca8712b35..d520a45e62 100644<br>
--- a/cpukit/libtest/testbeginend.c<br>
+++ b/cpukit/libtest/testbeginend.c<br>
@@ -42,13 +42,8 @@<br>
<br>
#include <rtems/test-info.h><br>
#include <rtems/test-printer.h><br>
-#include <rtems/bspIo.h><br>
#include <rtems/version.h><br>
<br>
-rtems_printer rtems_test_printer = {<br>
- .printer = rtems_printk_printer<br>
-};<br>
-<br>
static const char* const test_state_strings[] =<br>
{<br>
"EXPECTED_PASS",<br>
@@ -102,26 +97,3 @@ int rtems_test_end(const char* name)<br>
"\n*** END OF TEST %s ***\n\n", name<br>
);<br>
}<br>
-<br>
-void rtems_test_exit(int status)<br>
-{<br>
- (void) status;<br>
- rtems_shutdown_executive(0);<br>
-}<br>
-<br>
-int rtems_test_printf(<br>
- const char* format,<br>
- ...<br>
-)<br>
-{<br>
- va_list ap;<br>
- int len;<br>
- va_start(ap, format);<br>
- len = rtems_vprintf(<br>
- &rtems_test_printer,<br>
- format,<br>
- ap<br>
- );<br>
- va_end(ap);<br>
- return len;<br>
-}<br>
diff --git a/cpukit/libtest/testexit.c b/cpukit/libtest/testexit.c<br>
new file mode 100644<br>
index 0000000000..89f0dc341a<br>
--- /dev/null<br>
+++ b/cpukit/libtest/testexit.c<br>
@@ -0,0 +1,47 @@<br>
+/* SPDX-License-Identifier: BSD-2-Clause */<br>
+<br>
+/**<br>
+ * @file<br>
+ *<br>
+ * @ingroup RTEMSTestFrameworkImpl<br>
+ *<br>
+ * @brief This source file contains the implementation of<br>
+ * rtems_test_exit().<br>
+ */<br>
+<br>
+/*<br>
+ * Copyright (c) 2017 Chris Johns <<a href="mailto:chrisj@rtems.org" target="_blank">chrisj@rtems.org</a>>. All rights reserved.<br>
+ *<br>
+ * Redistribution and use in source and binary forms, with or without<br>
+ * modification, are permitted provided that the following conditions<br>
+ * are met:<br>
+ * 1. Redistributions of source code must retain the above copyright<br>
+ * notice, this list of conditions and the following disclaimer.<br>
+ * 2. Redistributions in binary form must reproduce the above copyright<br>
+ * notice, this list of conditions and the following disclaimer in the<br>
+ * documentation and/or other materials provided with the distribution.<br>
+ *<br>
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"<br>
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE<br>
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE<br>
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE<br>
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR<br>
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF<br>
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS<br>
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN<br>
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)<br>
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE<br>
+ * POSSIBILITY OF SUCH DAMAGE.<br>
+ */<br>
+<br>
+#ifdef HAVE_CONFIG_H<br>
+#include "config.h"<br>
+#endif<br>
+<br>
+#include <rtems/test-info.h><br>
+<br>
+void rtems_test_exit(int status)<br>
+{<br>
+ (void) status;<br>
+ rtems_shutdown_executive(0);<br>
+}<br>
diff --git a/cpukit/libtest/testprinter.c b/cpukit/libtest/testprinter.c<br>
new file mode 100644<br>
index 0000000000..b2b782bf4b<br>
--- /dev/null<br>
+++ b/cpukit/libtest/testprinter.c<br>
@@ -0,0 +1,63 @@<br>
+/* SPDX-License-Identifier: BSD-2-Clause */<br>
+<br>
+/**<br>
+ * @file<br>
+ *<br>
+ * @ingroup RTEMSTestFrameworkImpl<br>
+ *<br>
+ * @brief This source file contains the definition of ::rtems_test_printer and<br>
+ * the implementation of rtems_test_printf().<br>
+ */<br>
+<br>
+/*<br>
+ * Copyright (c) 2017 Chris Johns <<a href="mailto:chrisj@rtems.org" target="_blank">chrisj@rtems.org</a>>. All rights reserved.<br>
+ *<br>
+ * Redistribution and use in source and binary forms, with or without<br>
+ * modification, are permitted provided that the following conditions<br>
+ * are met:<br>
+ * 1. Redistributions of source code must retain the above copyright<br>
+ * notice, this list of conditions and the following disclaimer.<br>
+ * 2. Redistributions in binary form must reproduce the above copyright<br>
+ * notice, this list of conditions and the following disclaimer in the<br>
+ * documentation and/or other materials provided with the distribution.<br>
+ *<br>
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"<br>
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE<br>
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE<br>
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE<br>
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR<br>
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF<br>
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS<br>
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN<br>
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)<br>
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE<br>
+ * POSSIBILITY OF SUCH DAMAGE.<br>
+ */<br>
+<br>
+#ifdef HAVE_CONFIG_H<br>
+#include "config.h"<br>
+#endif<br>
+<br>
+#include <rtems/test-printer.h><br>
+#include <rtems/bspIo.h><br>
+<br>
+rtems_printer rtems_test_printer = {<br>
+ .printer = rtems_printk_printer<br>
+};<br>
+<br>
+int rtems_test_printf(<br>
+ const char* format,<br>
+ ...<br>
+)<br>
+{<br>
+ va_list ap;<br>
+ int len;<br>
+ va_start(ap, format);<br>
+ len = rtems_vprintf(<br>
+ &rtems_test_printer,<br>
+ format,<br>
+ ap<br>
+ );<br>
+ va_end(ap);<br>
+ return len;<br>
+}<br>
diff --git a/spec/build/cpukit/librtemstest.yml b/spec/build/cpukit/librtemstest.yml<br>
index fc268f8971..fbce36aace 100644<br>
--- a/spec/build/cpukit/librtemstest.yml<br>
+++ b/spec/build/cpukit/librtemstest.yml<br>
@@ -42,11 +42,13 @@ source:<br>
- cpukit/libtest/t-test.c<br>
- cpukit/libtest/testbeginend.c<br>
- cpukit/libtest/testbusy.c<br>
+- cpukit/libtest/testexit.c<br>
- cpukit/libtest/testextension.c<br>
- cpukit/libtest/testgcovcpufatalhalt.c<br>
- cpukit/libtest/testgcovbspreset.c<br>
- cpukit/libtest/testgcovdumpinfo.c<br>
- cpukit/libtest/testparallel.c<br>
+- cpukit/libtest/testprinter.c<br>
- cpukit/libtest/testrun.c<br>
- cpukit/libtest/testwrappers.c<br>
target: rtemstest<br>
-- <br>
2.35.3<br>
<br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div>