summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoann Congal <yoann.congal@smile.fr>2025-08-28 20:13:23 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-09-01 23:07:06 +0100
commit4b099343bb888520190123f9a2a9231385ee711d (patch)
treef13e6644b2341b9c963dad8825d48cb82bfeaef9
parent60eb2be65cb4c0959e68434dfd59644a33496150 (diff)
downloadpoky-4b099343bb888520190123f9a2a9231385ee711d.tar.gz
ptest-cargo: move run-ptest rc variable initialisation
ptest-cargo run-ptest can be generated in two fashions: generated from scratch or appended to an exiting run-ptest file. The rc variable used to track tests failure was only initialized in "generated from scratch" case. Which lead to errors in the "appended" case. Move the rc variable initialisation to the common code of both case to fix this problem. Only initialize rc if it was not already affected in the recipe provided run-ptest. (From OE-Core rev: 177c47b7decd8e2d1e24738d10b0f7db2777a772) Signed-off-by: Yoann Congal <yoann.congal@smile.fr> Cc: Gyorgy Sarvari <skandigraun@gmail.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes-recipe/ptest-cargo.bbclass2
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/classes-recipe/ptest-cargo.bbclass b/meta/classes-recipe/ptest-cargo.bbclass
index ece25ff1eb..8351644b0f 100644
--- a/meta/classes-recipe/ptest-cargo.bbclass
+++ b/meta/classes-recipe/ptest-cargo.bbclass
@@ -103,10 +103,10 @@ python do_install_ptest_cargo() {
103 with open(ptest_script, "a") as f: 103 with open(ptest_script, "a") as f:
104 if not script_exists: 104 if not script_exists:
105 f.write("#!/bin/sh\n") 105 f.write("#!/bin/sh\n")
106 f.write("rc=0\n")
107 else: 106 else:
108 f.write(f"\necho \"\"\n") 107 f.write(f"\necho \"\"\n")
109 f.write(f"echo \"## starting to run rust tests ##\"\n") 108 f.write(f"echo \"## starting to run rust tests ##\"\n")
109 f.write("if [ -z \"$rc\" ]; then rc=0; fi\n")
110 for test_path in test_paths: 110 for test_path in test_paths:
111 script = textwrap.dedent(f"""\ 111 script = textwrap.dedent(f"""\
112 if ! {test_path} {rust_test_args} 112 if ! {test_path} {rust_test_args}