Revert "BaseTools:code of test python module is moved to edksetup"
This reverts commit df7c81b5b2
.
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>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
This commit is contained in:
@@ -12,6 +12,14 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
|
try:
|
||||||
|
import distutils.util
|
||||||
|
except ModuleNotFoundError:
|
||||||
|
sys.exit('''
|
||||||
|
Python reported: "No module named 'distutils.util"
|
||||||
|
''')
|
||||||
|
|
||||||
import TestTools
|
import TestTools
|
||||||
|
|
||||||
def GetCTestSuite():
|
def GetCTestSuite():
|
||||||
|
15
edksetup.sh
15
edksetup.sh
@@ -177,22 +177,11 @@ function SetupPython()
|
|||||||
SetupPython3
|
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()
|
function SourceEnv()
|
||||||
{
|
{
|
||||||
SetWorkspace &&
|
SetWorkspace &&
|
||||||
SetupEnv &&
|
SetupEnv
|
||||||
SetupPython &&
|
SetupPython
|
||||||
TestUtilModule
|
|
||||||
}
|
}
|
||||||
|
|
||||||
I=$#
|
I=$#
|
||||||
|
Reference in New Issue
Block a user