All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] oeqa/selftest/bblogging: Split the test cases up for ease of testing
@ 2022-02-21 16:03 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2022-02-21 16:03 UTC (permalink / raw)
  To: openembedded-core

This makes it easier to see which of the tests are passing/failing for
a given change which aids debugging.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/lib/oeqa/selftest/cases/bblogging.py | 25 ++++++++++++++++++-----
 1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/meta/lib/oeqa/selftest/cases/bblogging.py b/meta/lib/oeqa/selftest/cases/bblogging.py
index 6b0bbfe1c1b..317e68b82f7 100644
--- a/meta/lib/oeqa/selftest/cases/bblogging.py
+++ b/meta/lib/oeqa/selftest/cases/bblogging.py
@@ -11,7 +11,7 @@ class BitBakeLogging(OESelftestTestCase):
     def assertCount(self, item, entry, count):
         self.assertEqual(item.count(entry), count, msg="Output:\n'''\n%s\n'''\ndoesn't contain %d copies of:\n'''\n%s\n'''\n" % (item, count, entry))
 
-    def test_shell_logging(self):
+    def test_shell_loggingA(self):
         # no logs, no verbose
         self.write_config('BBINCLUDELOGS = ""')
         result = bitbake("logging-test -c shelltest -f", ignore_status = True)
@@ -19,6 +19,7 @@ class BitBakeLogging(OESelftestTestCase):
         self.assertNotIn("This is shell stdout", result.output)
         self.assertNotIn("This is shell stderr", result.output)
 
+    def test_shell_loggingB(self):
         # logs, no verbose
         self.write_config('BBINCLUDELOGS = "yes"')
         result = bitbake("logging-test -c shelltest -f", ignore_status = True)
@@ -26,6 +27,7 @@ class BitBakeLogging(OESelftestTestCase):
         self.assertCount(result.output, "This is shell stdout", 1)
         self.assertCount(result.output, "This is shell stderr", 1)
 
+    def test_shell_loggingC(self):
         # no logs, verbose
         self.write_config('BBINCLUDELOGS = ""')
         result = bitbake("logging-test -c shelltest -f -v", ignore_status = True)
@@ -34,6 +36,7 @@ class BitBakeLogging(OESelftestTestCase):
         self.assertCount(result.output, "This is shell stdout", 2)
         self.assertCount(result.output, "This is shell stderr", 2)
 
+    def test_shell_loggingD(self):
         # logs, verbose
         self.write_config('BBINCLUDELOGS = "yes"')
         result = bitbake("logging-test -c shelltest -f -v", ignore_status = True)
@@ -42,7 +45,7 @@ class BitBakeLogging(OESelftestTestCase):
         self.assertCount(result.output, "This is shell stdout", 2)
         self.assertCount(result.output, "This is shell stderr", 2)
 
-    def test_python_exec_func_shell_logging(self):
+    def test_python_exec_func_shell_loggingA(self):
         # no logs, no verbose
         self.write_config('BBINCLUDELOGS = ""')
         result = bitbake("logging-test -c pythontest_exec_func_shell -f",
@@ -51,6 +54,7 @@ class BitBakeLogging(OESelftestTestCase):
         self.assertNotIn("This is shell stdout", result.output)
         self.assertNotIn("This is shell stderr", result.output)
 
+    def test_python_exec_func_shell_loggingB(self):
         # logs, no verbose
         self.write_config('BBINCLUDELOGS = "yes"')
         result = bitbake("logging-test -c pythontest_exec_func_shell -f",
@@ -59,6 +63,7 @@ class BitBakeLogging(OESelftestTestCase):
         self.assertCount(result.output, "This is shell stdout", 1)
         self.assertCount(result.output, "This is shell stderr", 1)
 
+    def test_python_exec_func_shell_loggingC(self):
         # no logs, verbose
         self.write_config('BBINCLUDELOGS = ""')
         result = bitbake("logging-test -c pythontest_exec_func_shell -f -v",
@@ -68,6 +73,7 @@ class BitBakeLogging(OESelftestTestCase):
         self.assertCount(result.output, "This is shell stdout", 2)
         self.assertCount(result.output, "This is shell stderr", 2)
 
+    def test_python_exec_func_shell_loggingD(self):
         # logs, verbose
         self.write_config('BBINCLUDELOGS = "yes"')
         result = bitbake("logging-test -c pythontest_exec_func_shell -f -v",
@@ -77,13 +83,14 @@ class BitBakeLogging(OESelftestTestCase):
         self.assertCount(result.output, "This is shell stdout", 2)
         self.assertCount(result.output, "This is shell stderr", 2)
 
-    def test_python_exit_logging(self):
+    def test_python_exit_loggingA(self):
         # no logs, no verbose
         self.write_config('BBINCLUDELOGS = ""')
         result = bitbake("logging-test -c pythontest_exit -f", ignore_status = True)
         self.assertIn("ERROR: Logfile of failure stored in:", result.output)
         self.assertNotIn("This is python stdout", result.output)
 
+    def test_python_exit_loggingB(self):
         # logs, no verbose
         self.write_config('BBINCLUDELOGS = "yes"')
         result = bitbake("logging-test -c pythontest_exit -f", ignore_status = True)
@@ -91,6 +98,7 @@ class BitBakeLogging(OESelftestTestCase):
         # A sys.exit() should include the output
         self.assertCount(result.output, "This is python stdout", 1)
 
+    def test_python_exit_loggingC(self):
         # no logs, verbose
         self.write_config('BBINCLUDELOGS = ""')
         result = bitbake("logging-test -c pythontest_exit -f -v", ignore_status = True)
@@ -98,6 +106,7 @@ class BitBakeLogging(OESelftestTestCase):
         # python tasks don't log output with -v currently
         #self.assertCount(result.output, "This is python stdout", 1)
 
+    def test_python_exit_loggingD(self):
         # logs, verbose
         self.write_config('BBINCLUDELOGS = "yes"')
         result = bitbake("logging-test -c pythontest_exit -f -v", ignore_status = True)
@@ -105,7 +114,7 @@ class BitBakeLogging(OESelftestTestCase):
         # python tasks don't log output with -v currently
         #self.assertCount(result.output, "This is python stdout", 1)
 
-    def test_python_exec_func_python_logging(self):
+    def test_python_exec_func_python_loggingA(self):
         # no logs, no verbose
         self.write_config('BBINCLUDELOGS = ""')
         result = bitbake("logging-test -c pythontest_exec_func_python -f",
@@ -113,6 +122,7 @@ class BitBakeLogging(OESelftestTestCase):
         self.assertIn("ERROR: Logfile of failure stored in:", result.output)
         self.assertNotIn("This is python stdout", result.output)
 
+    def test_python_exec_func_python_loggingB(self):
         # logs, no verbose
         self.write_config('BBINCLUDELOGS = "yes"')
         result = bitbake("logging-test -c pythontest_exec_func_python -f",
@@ -121,6 +131,7 @@ class BitBakeLogging(OESelftestTestCase):
         # A sys.exit() should include the output
         self.assertCount(result.output, "This is python stdout", 1)
 
+    def test_python_exec_func_python_loggingC(self):
         # no logs, verbose
         self.write_config('BBINCLUDELOGS = ""')
         result = bitbake("logging-test -c pythontest_exec_func_python -f -v",
@@ -129,6 +140,7 @@ class BitBakeLogging(OESelftestTestCase):
         # python tasks don't log output with -v currently
         #self.assertCount(result.output, "This is python stdout", 1)
 
+    def test_python_exec_func_python_loggingD(self):
         # logs, verbose
         self.write_config('BBINCLUDELOGS = "yes"')
         result = bitbake("logging-test -c pythontest_exec_func_python -f -v",
@@ -137,7 +149,7 @@ class BitBakeLogging(OESelftestTestCase):
         # python tasks don't log output with -v currently
         #self.assertCount(result.output, "This is python stdout", 1)
 
-    def test_python_fatal_logging(self):
+    def test_python_fatal_loggingA(self):
         # no logs, no verbose
         self.write_config('BBINCLUDELOGS = ""')
         result = bitbake("logging-test -c pythontest_fatal -f", ignore_status = True)
@@ -145,6 +157,7 @@ class BitBakeLogging(OESelftestTestCase):
         self.assertNotIn("This is python fatal test stdout", result.output)
         self.assertCount(result.output, "This is a fatal error", 1)
 
+    def test_python_fatal_loggingB(self):
         # logs, no verbose
         self.write_config('BBINCLUDELOGS = "yes"')
         result = bitbake("logging-test -c pythontest_fatal -f", ignore_status = True)
@@ -153,6 +166,7 @@ class BitBakeLogging(OESelftestTestCase):
         self.assertNotIn("This is python fatal test stdout", result.output)
         self.assertCount(result.output, "This is a fatal error", 1)
 
+    def test_python_fatal_loggingC(self):
         # no logs, verbose
         self.write_config('BBINCLUDELOGS = ""')
         result = bitbake("logging-test -c pythontest_fatal -f -v", ignore_status = True)
@@ -161,6 +175,7 @@ class BitBakeLogging(OESelftestTestCase):
         #self.assertCount(result.output, "This is python fatal test stdout", 1)
         self.assertCount(result.output, "This is a fatal error", 1)
 
+    def test_python_fatal_loggingD(self):
         # logs, verbose
         self.write_config('BBINCLUDELOGS = "yes"')
         result = bitbake("logging-test -c pythontest_fatal -f -v", ignore_status = True)
-- 
2.32.0



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-21 16:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-21 16:03 [PATCH] oeqa/selftest/bblogging: Split the test cases up for ease of testing Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.