mirror of
https://git.yoctoproject.org/poky
synced 2026-05-08 05:09:24 +00:00
ptest-cargo: refactor run-ptest generation to remove redundancy
This refactoring simplifies the generation of the run-ptest script by removing redundant logic and improving readability. (From OE-Core rev: 287614a847651f8bd528597b7d6ccb8ad8262367) Signed-off-by: Ines KCHELFI <ines.kchelfi@smile.fr> Reviewed-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
c2aec3f86c
commit
40346626ec
@@ -98,17 +98,19 @@ python do_install_ptest_cargo() {
|
||||
test_paths.append(os.path.join(ptest_path, os.path.basename(test_bin)))
|
||||
|
||||
ptest_script = os.path.join(ptest_dir, "run-ptest")
|
||||
if os.path.exists(ptest_script):
|
||||
with open(ptest_script, "a") as f:
|
||||
script_exists = os.path.exists(ptest_script)
|
||||
with open(ptest_script, "a") as f:
|
||||
if not script_exists:
|
||||
f.write("#!/bin/sh\n")
|
||||
|
||||
else:
|
||||
f.write(f"\necho \"\"\n")
|
||||
f.write(f"echo \"## starting to run rust tests ##\"\n")
|
||||
for test_path in test_paths:
|
||||
f.write(f"{test_path} {rust_test_args}\n")
|
||||
else:
|
||||
with open(ptest_script, "a") as f:
|
||||
f.write("#!/bin/sh\n")
|
||||
for test_path in test_paths:
|
||||
f.write(f"{test_path} {rust_test_args}\n")
|
||||
|
||||
for test_path in test_paths:
|
||||
f.write(f"{test_path} {rust_test_args}\n")
|
||||
|
||||
if not script_exists:
|
||||
os.chmod(ptest_script, 0o755)
|
||||
|
||||
# this is chown -R root:root ${D}${PTEST_PATH}
|
||||
|
||||
Reference in New Issue
Block a user