move of py_func and lua_func apps fixed.

This commit is contained in:
2026-02-13 18:51:05 +01:00
parent 210c2d6231
commit a6058b9dd8
4 changed files with 16 additions and 21 deletions

View File

@@ -6,8 +6,10 @@ import platform
import math import math
import json import json
import traceback import traceback
from testium.interpreter.utils.jrpc import JsonRpcSrv from testium.interpreter.utils.jrpc import JsonRpcSrv
from testium.interpreter.utils.tum_except import ETUMRuntimeError, print_exception from testium.interpreter.utils.tum_except import ETUMRuntimeError, print_exception
import py_func.tm as tm
from py_func.func_call import func_exec from py_func.func_call import func_exec

View File

@@ -46,9 +46,8 @@ class TestItemLuaFunc(TestItem):
self.func_name = self._prms.expanse(self.func_name) self.func_name = self._prms.expanse(self.func_name)
param_list = self._prms.getParamFromList(self.params) param_list = self._prms.getParamFromList(self.params)
pl = self._prms.expanse(param_list) pl = self._prms.expanse(param_list)
if tm.debug_enabled(): print("Parameters list:")
tm.print_debug("Parameters list:") print(textwrap.indent(pprint.pformat(pl), " |"))
tm.print_debug(textwrap.indent(pprint.pformat(pl), " |"))
if self._proc is not None: if self._proc is not None:
self._proc.start() 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: if success == TestValue.SUCCESS:
self.result.set(TestValue.SUCCESS) self.result.set(TestValue.SUCCESS)
res, reported_values = ret res, reported_values = ret
print(res)
reported_values = {**reported_values, "returned": res} reported_values = {**reported_values, "returned": res}
self.result.reported = ret[1] self.result.reported = ret[1]
if tm.debug_enabled(): print("Returned value:")
tm.print_debug("Returned value:") print(textwrap.indent(pprint.pformat(res), " |"))
tm.print_debug(textwrap.indent(pprint.pformat(res), " |"))
# The result of the func test item is put in global dir and result # The result of the func test item is put in global dir and result
tm.setgd("lfn_" + self._name, res) 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: else:
self.result.set(TestValue.FAILURE, ret) self.result.set(TestValue.FAILURE, ret)
if tm.debug_enabled():
tm.print_debug("Failed:") print("Failed!")
tm.print_debug(textwrap.indent(pprint.pformat(ret), " |")) tm.print_debug(textwrap.indent(pprint.pformat(ret), " |"))
return return

View File

@@ -44,9 +44,8 @@ class TestItemPyFunc(TestItem):
self.func_name = self._prms.expanse(self.func_name) self.func_name = self._prms.expanse(self.func_name)
param_list = self._prms.getParamFromList(self.params) param_list = self._prms.getParamFromList(self.params)
pl = self._prms.expanse(param_list) pl = self._prms.expanse(param_list)
if tm.debug_enabled(): print("Parameters list:")
tm.print_debug("Parameters list:") print(textwrap.indent(pprint.pformat(pl), " |"))
tm.print_debug(textwrap.indent(pprint.pformat(pl), " |"))
# start the process for executing external python # start the process for executing external python
self._py_func_proc.start() self._py_func_proc.start()
@@ -68,10 +67,8 @@ python_bin = {tm.gd("python_bin", "no python path defined")}"""
res, reported_values = ret res, reported_values = ret
reported_values = {**reported_values, "returned": res} reported_values = {**reported_values, "returned": res}
self.result.reported = ret[1] self.result.reported = ret[1]
print("Returned value:")
if tm.debug_enabled(): print(textwrap.indent(pprint.pformat(res), " |"))
tm.print_debug("Returned value:")
tm.print_debug(textwrap.indent(pprint.pformat(res), " |"))
# The result of the func test item is put in global dir and result # The result of the func test item is put in global dir and result
tm.setgd("pfn_" + self._name, res) tm.setgd("pfn_" + self._name, res)
@@ -79,9 +76,8 @@ python_bin = {tm.gd("python_bin", "no python path defined")}"""
else: else:
self.result.set(TestValue.FAILURE, ret) self.result.set(TestValue.FAILURE, ret)
if tm.debug_enabled(): print("Failed!")
tm.print_debug("Failed:") tm.print_debug(textwrap.indent(pprint.pformat(ret), " |"))
tm.print_debug(textwrap.indent(pprint.pformat(ret), " |"))
return return

View File

@@ -138,7 +138,7 @@ class PyProcessBase:
sock.close() sock.close()
# Add the path of the subprocess (root sources of testium) # 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", "") env["PYTHONPATH"] = func_proc_path + os.pathsep + self._ppath + os.pathsep + env.get("PYTHONPATH", "")
params = [ params = [