aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-connectivity/samba/samba-4.1.12/0003-waf-improve-readability-of-cross-answers-generated-b.patch
blob: ec17d9d21634d4291bc872ab7959e228eb851942 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
From f7052d633396005563e44509428503f42c9faa97 Mon Sep 17 00:00:00 2001
From: Jackie Huang <jackie.huang@windriver.com>
Date: Thu, 12 Nov 2015 01:00:11 -0500
Subject: [PATCH 3/7] waf: improve readability of cross-answers generated by cross-execute

When generating a result for cross-answers from the (retcode, retstring) tuple:
- (0, "output") indicated as "output"
- 1 is interpreted as generic fail code, instead of 255, because most
  if not all tests fail with 1 as exit code rather than 255
- For failing test, use NO instead of FAIL, because that's not
  necessarily a failure (it could mean that something is NOT
  broken)

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Upstream-Status: Backport

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
---
 buildtools/wafsamba/samba_cross.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/buildtools/wafsamba/samba_cross.py b/buildtools/wafsamba/samba_cross.py
index 3f1ef12..d1e7006 100644
--- a/buildtools/wafsamba/samba_cross.py
+++ b/buildtools/wafsamba/samba_cross.py
@@ -6,7 +6,7 @@ from Configure import conf
 real_Popen = None
 
 ANSWER_UNKNOWN = (254, "")
-ANSWER_FAIL    = (255, "")
+ANSWER_NO      = (1, "")
 ANSWER_OK      = (0, "")
 
 cross_answers_incomplete = False
@@ -33,10 +33,13 @@ def add_answer(ca_file, msg, answer):
         f.write('%s: OK\n' % msg)
     elif answer == ANSWER_UNKNOWN:
         f.write('%s: UNKNOWN\n' % msg)
-    elif answer == ANSWER_FAIL:
-        f.write('%s: FAIL\n' % msg)
+    elif answer == ANSWER_NO:
+        f.write('%s: NO\n' % msg)
     else:
-        f.write('%s: (%d, "%s")\n' % (msg, retcode, retstring))
+        if retcode == 0:
+            f.write('%s: "%s"\n' % (msg, retstring))
+        else:
+            f.write('%s: (%d, "%s")\n' % (msg, retcode, retstring))
     f.close()
 
 
@@ -64,7 +67,7 @@ def cross_answer(ca_file, msg):
                 return ANSWER_UNKNOWN
             elif ans == "FAIL" or ans == "NO":
                 f.close()
-                return ANSWER_FAIL
+                return ANSWER_NO
             elif ans[0] == '"':
                 return (0, ans.strip('"'))
             elif ans[0] == "'":
-- 
1.9.1