From: Frederic Martinsons <frederic.martins...@gmail.com>

before that, a test executable at None was picked.
Moreover, use universal_newlines to subprocess call to avoid
being polluted by fancy carriage return characters.

Signed-off-by: Frederic Martinsons <frederic.martins...@gmail.com>
---
 meta/classes-recipe/ptest-cargo.bbclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/classes-recipe/ptest-cargo.bbclass 
b/meta/classes-recipe/ptest-cargo.bbclass
index 4ed528445a..5d53abe969 100644
--- a/meta/classes-recipe/ptest-cargo.bbclass
+++ b/meta/classes-recipe/ptest-cargo.bbclass
@@ -23,13 +23,13 @@ python do_compile_ptest_cargo() {
     bb.note(f"Building tests with cargo ({cmd})")
 
     try:
-        proc = subprocess.Popen(cmd, shell=True, env=env, 
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+        proc = subprocess.Popen(cmd, shell=True, env=env, 
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
     except subprocess.CalledProcessError as e:
         bb.fatal(f"Cannot build test with cargo: {e}")
 
     lines = []
     for line in proc.stdout:
-        data = line.decode('utf-8').strip('\n')
+        data = line.strip('\n')
         lines.append(data)
         bb.note(data)
     proc.communicate()
@@ -50,7 +50,7 @@ python do_compile_ptest_cargo() {
                 current_manifest_path = os.path.normpath(data['manifest_path'])
                 project_manifest_path = os.path.normpath(manifest_path)
                 if current_manifest_path == project_manifest_path:
-                    if data['target']['test'] or data['target']['doctest'] and 
data['executable']:
+                    if (data['target']['test'] or data['target']['doctest']) 
and data['executable']:
                         test_bins.append(data['executable'])
             except KeyError as e:
                 # skip lines that do not meet the requirements
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183918): 
https://lists.openembedded.org/g/openembedded-core/message/183918
Mute This Topic: https://lists.openembedded.org/mt/99982202/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to