public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] Revert "BaseTools:code of test python module is moved to edksetup"
@ 2019-05-09  6:50 Fan, ZhijuX
  2019-05-09  7:00 ` Bob Feng
  0 siblings, 1 reply; 2+ messages in thread
From: Fan, ZhijuX @ 2019-05-09  6:50 UTC (permalink / raw)
  To: devel@edk2.groups.io; +Cc: Gao, Liming, Feng, Bob C

[-- Attachment #1: Type: text/plain, Size: 1549 bytes --]

This reverts commit df7c81b5b219c9aee776baa466dd64c9d318dd80.

In commint df7c81b5b219c9,used a function to test python module
But the Boolean value of the return value of this function is the
opposite of the Correct result, resulting in an unexpected result

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
---
 BaseTools/Tests/RunTests.py |  8 ++++++++
 edksetup.sh                 | 15 ++-------------
 2 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/BaseTools/Tests/RunTests.py b/BaseTools/Tests/RunTests.py
index e8acf1b348..81af736cd8 100644
--- a/BaseTools/Tests/RunTests.py
+++ b/BaseTools/Tests/RunTests.py
@@ -12,6 +12,14 @@
 import os
 import sys
 import unittest
+
+try:
+    import distutils.util
+except ModuleNotFoundError:
+    sys.exit('''
+Python reported: "No module named 'distutils.util"
+''')
+
 import TestTools
 
 def GetCTestSuite():
diff --git a/edksetup.sh b/edksetup.sh
index ed9ceae85d..c7b2e1e201 100755
--- a/edksetup.sh
+++ b/edksetup.sh
@@ -177,22 +177,11 @@ function SetupPython()
   SetupPython3
 }
 
-function TestUtilModule()
-{
-  if ( $PYTHON_COMMAND -c "import distutils.util" >/dev/null 2>&1 );then
-    return 1
-  else
-    echo Error: "No module named 'distutils.util"
-    return 0
-  fi
-}
-
 function SourceEnv()
 {
   SetWorkspace &&
-  SetupEnv &&
-  SetupPython &&
-  TestUtilModule
+  SetupEnv
+  SetupPython
 }
 
 I=$#
-- 
2.14.1.windows.1


[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 4071 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Revert "BaseTools:code of test python module is moved to edksetup"
  2019-05-09  6:50 [PATCH] Revert "BaseTools:code of test python module is moved to edksetup" Fan, ZhijuX
@ 2019-05-09  7:00 ` Bob Feng
  0 siblings, 0 replies; 2+ messages in thread
From: Bob Feng @ 2019-05-09  7:00 UTC (permalink / raw)
  To: Fan, ZhijuX, devel@edk2.groups.io; +Cc: Gao, Liming

Reviewed-by: Bob Feng <bob.c.feng@intel.com> 

-----Original Message-----
From: Fan, ZhijuX 
Sent: Thursday, May 9, 2019 2:50 PM
To: devel@edk2.groups.io
Cc: Gao, Liming <liming.gao@intel.com>; Feng, Bob C <bob.c.feng@intel.com>
Subject: [PATCH] Revert "BaseTools:code of test python module is moved to edksetup"

This reverts commit df7c81b5b219c9aee776baa466dd64c9d318dd80.

In commint df7c81b5b219c9,used a function to test python module But the Boolean value of the return value of this function is the opposite of the Correct result, resulting in an unexpected result

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
---
 BaseTools/Tests/RunTests.py |  8 ++++++++
 edksetup.sh                 | 15 ++-------------
 2 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/BaseTools/Tests/RunTests.py b/BaseTools/Tests/RunTests.py index e8acf1b348..81af736cd8 100644
--- a/BaseTools/Tests/RunTests.py
+++ b/BaseTools/Tests/RunTests.py
@@ -12,6 +12,14 @@
 import os
 import sys
 import unittest
+
+try:
+    import distutils.util
+except ModuleNotFoundError:
+    sys.exit('''
+Python reported: "No module named 'distutils.util"
+''')
+
 import TestTools
 
 def GetCTestSuite():
diff --git a/edksetup.sh b/edksetup.sh
index ed9ceae85d..c7b2e1e201 100755
--- a/edksetup.sh
+++ b/edksetup.sh
@@ -177,22 +177,11 @@ function SetupPython()
   SetupPython3
 }
 
-function TestUtilModule()
-{
-  if ( $PYTHON_COMMAND -c "import distutils.util" >/dev/null 2>&1 );then
-    return 1
-  else
-    echo Error: "No module named 'distutils.util"
-    return 0
-  fi
-}
-
 function SourceEnv()
 {
   SetWorkspace &&
-  SetupEnv &&
-  SetupPython &&
-  TestUtilModule
+  SetupEnv
+  SetupPython
 }
 
 I=$#
--
2.14.1.windows.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-09  7:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-09  6:50 [PATCH] Revert "BaseTools:code of test python module is moved to edksetup" Fan, ZhijuX
2019-05-09  7:00 ` Bob Feng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox