move of py_func and lua_func apps fixed.
This commit is contained in:
@@ -6,8 +6,10 @@ import platform
|
||||
import math
|
||||
import json
|
||||
import traceback
|
||||
|
||||
from testium.interpreter.utils.jrpc import JsonRpcSrv
|
||||
from testium.interpreter.utils.tum_except import ETUMRuntimeError, print_exception
|
||||
import py_func.tm as tm
|
||||
from py_func.func_call import func_exec
|
||||
|
||||
|
||||
|
||||
@@ -46,9 +46,8 @@ class TestItemLuaFunc(TestItem):
|
||||
self.func_name = self._prms.expanse(self.func_name)
|
||||
param_list = self._prms.getParamFromList(self.params)
|
||||
pl = self._prms.expanse(param_list)
|
||||
if tm.debug_enabled():
|
||||
tm.print_debug("Parameters list:")
|
||||
tm.print_debug(textwrap.indent(pprint.pformat(pl), " |"))
|
||||
print("Parameters list:")
|
||||
print(textwrap.indent(pprint.pformat(pl), " |"))
|
||||
|
||||
if self._proc is not None:
|
||||
self._proc.start()
|
||||
@@ -71,13 +70,11 @@ Is the lua environnment well defined in the "LUA_PATH" and "LUA_CPATH" variables
|
||||
if success == TestValue.SUCCESS:
|
||||
self.result.set(TestValue.SUCCESS)
|
||||
res, reported_values = ret
|
||||
print(res)
|
||||
reported_values = {**reported_values, "returned": res}
|
||||
self.result.reported = ret[1]
|
||||
|
||||
if tm.debug_enabled():
|
||||
tm.print_debug("Returned value:")
|
||||
tm.print_debug(textwrap.indent(pprint.pformat(res), " |"))
|
||||
print("Returned value:")
|
||||
print(textwrap.indent(pprint.pformat(res), " |"))
|
||||
|
||||
# The result of the func test item is put in global dir and result
|
||||
tm.setgd("lfn_" + self._name, res)
|
||||
@@ -85,9 +82,9 @@ Is the lua environnment well defined in the "LUA_PATH" and "LUA_CPATH" variables
|
||||
|
||||
else:
|
||||
self.result.set(TestValue.FAILURE, ret)
|
||||
if tm.debug_enabled():
|
||||
tm.print_debug("Failed:")
|
||||
tm.print_debug(textwrap.indent(pprint.pformat(ret), " |"))
|
||||
|
||||
print("Failed!")
|
||||
tm.print_debug(textwrap.indent(pprint.pformat(ret), " |"))
|
||||
|
||||
return
|
||||
|
||||
|
||||
@@ -44,9 +44,8 @@ class TestItemPyFunc(TestItem):
|
||||
self.func_name = self._prms.expanse(self.func_name)
|
||||
param_list = self._prms.getParamFromList(self.params)
|
||||
pl = self._prms.expanse(param_list)
|
||||
if tm.debug_enabled():
|
||||
tm.print_debug("Parameters list:")
|
||||
tm.print_debug(textwrap.indent(pprint.pformat(pl), " |"))
|
||||
print("Parameters list:")
|
||||
print(textwrap.indent(pprint.pformat(pl), " |"))
|
||||
|
||||
# start the process for executing external python
|
||||
self._py_func_proc.start()
|
||||
@@ -68,10 +67,8 @@ python_bin = {tm.gd("python_bin", "no python path defined")}"""
|
||||
res, reported_values = ret
|
||||
reported_values = {**reported_values, "returned": res}
|
||||
self.result.reported = ret[1]
|
||||
|
||||
if tm.debug_enabled():
|
||||
tm.print_debug("Returned value:")
|
||||
tm.print_debug(textwrap.indent(pprint.pformat(res), " |"))
|
||||
print("Returned value:")
|
||||
print(textwrap.indent(pprint.pformat(res), " |"))
|
||||
|
||||
# The result of the func test item is put in global dir and result
|
||||
tm.setgd("pfn_" + self._name, res)
|
||||
@@ -79,9 +76,8 @@ python_bin = {tm.gd("python_bin", "no python path defined")}"""
|
||||
|
||||
else:
|
||||
self.result.set(TestValue.FAILURE, ret)
|
||||
if tm.debug_enabled():
|
||||
tm.print_debug("Failed:")
|
||||
tm.print_debug(textwrap.indent(pprint.pformat(ret), " |"))
|
||||
print("Failed!")
|
||||
tm.print_debug(textwrap.indent(pprint.pformat(ret), " |"))
|
||||
|
||||
return
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ class PyProcessBase:
|
||||
sock.close()
|
||||
|
||||
# Add the path of the subprocess (root sources of testium)
|
||||
func_proc_path = testium_path()
|
||||
func_proc_path = os.path.realpath(os.path.join(testium_path(), ".."))
|
||||
env["PYTHONPATH"] = func_proc_path + os.pathsep + self._ppath + os.pathsep + env.get("PYTHONPATH", "")
|
||||
|
||||
params = [
|
||||
|
||||
Reference in New Issue
Block a user