- py_func and lua_func items accept a context_id parameter; items sharing the same id reuse the same subprocess for the duration of the test run - Subprocess-side tm.setgd/tm.gd use a local fallback dict for non-JSON- serializable values (py_func only); serializable values reach the main process global dict and are accessible from any test item or subprocess - Shared subprocess engines are cleaned up in process.py finally block - LuaProcessBase gains is_alive() (was missing, broke all lua_func items) - Validation tests cover serializable sharing across different context ids, non-serializable sharing within the same context_id, and cross-item access - RST documentation updated for both py_func and lua_func items Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
215 lines
5.9 KiB
Plaintext
215 lines
5.9 KiB
Plaintext
- let:
|
|
name: lua_func test constants,
|
|
values:
|
|
lua_func test parameter: test parameter lua_func
|
|
|
|
- lua_func:
|
|
name: fail lua_func
|
|
key: $(test)_FAIL
|
|
file: $(test_path)$(psep)lua_func.lua
|
|
func_name: assertparam
|
|
param:
|
|
- false
|
|
|
|
- lua_func:
|
|
name: fail lua_func with expected result FAIL
|
|
key: $(test)_PASS
|
|
file: $(test_path)$(psep)lua_func.lua
|
|
func_name: assertparam
|
|
param:
|
|
- false
|
|
expected_result: FAIL
|
|
|
|
- lua_func:
|
|
name: pass lua_func with expected result FAIL
|
|
key: $(test)_FAIL
|
|
file: $(test_path)$(psep)lua_func.lua
|
|
func_name: assertparam
|
|
param:
|
|
- true
|
|
expected_result: FAIL
|
|
|
|
- lua_func:
|
|
name: expected -1
|
|
key: $(test)_PASS
|
|
file: $(test_path)$(psep)lua_func.lua
|
|
func_name: echo
|
|
param:
|
|
- -1
|
|
expected_result: -1
|
|
|
|
- lua_func:
|
|
name: expected eval
|
|
key: $(test)_PASS
|
|
file: $(test_path)$(psep)lua_func.lua
|
|
func_name: echo
|
|
param:
|
|
- -1
|
|
expected_result: "354848436 - 354848437"
|
|
|
|
- lua_func:
|
|
name: expected table
|
|
key: $(test)_PASS
|
|
file: $(test_path)$(psep)lua_func.lua
|
|
func_name: echo
|
|
param:
|
|
- [-1, a, {toto: tata}]
|
|
expected_result: "[-1, 'a', {'toto': 'tata'}]"
|
|
|
|
- lua_func:
|
|
name: global param lua_func
|
|
key: $(test)_PASS
|
|
file: $(test_path)$(psep)lua_func.lua
|
|
func_name: checkglobal
|
|
param:
|
|
- lua_func test parameter
|
|
expected_result: $(lua_func test parameter)
|
|
|
|
- lua_func:
|
|
name: global param lua_func 1
|
|
key: $(test)_PASS
|
|
file: $(test_path)$(psep)lua_func.lua
|
|
func_name: checkglobal2
|
|
param:
|
|
- 1
|
|
expected_result: ($(lua_data_to_be_returned))[0]
|
|
|
|
- lua_func:
|
|
name: global param lua_func 2
|
|
key: $(test)_PASS
|
|
file: $(test_path)$(psep)lua_func.lua
|
|
func_name: checkglobal2
|
|
param:
|
|
- 2
|
|
expected_result: ($(lua_data_to_be_returned))[1]
|
|
|
|
- lua_func:
|
|
name: global param lua_func 3
|
|
key: $(test)_PASS
|
|
file: $(test_path)$(psep)lua_func.lua
|
|
func_name: checkglobal2
|
|
param:
|
|
- 3
|
|
expected_result: ($(lua_data_to_be_returned))[2]
|
|
|
|
- let:
|
|
name: python2func
|
|
key: $(test)_PASS
|
|
values:
|
|
- py: $(test_path)$(psep)lua_func.lua
|
|
|
|
|
|
- lua_func:
|
|
name: skipped_checkglobal
|
|
file: $(test_path)$(psep)lua_func.lua
|
|
func_name: should_not_be_called
|
|
param:
|
|
- $(test parameter)
|
|
|
|
- lua_func:
|
|
name: skipped true
|
|
file: $(test_path)$(psep)lua_func.lua
|
|
func_name: checkglobal
|
|
skipped: true
|
|
param:
|
|
- $(test parameter)
|
|
|
|
- lua_func:
|
|
name: skipped 1
|
|
file: $(test_path)$(psep)lua_func.lua
|
|
func_name: checkglobal
|
|
skipped: 1
|
|
param:
|
|
- $(test parameter)
|
|
|
|
- group:
|
|
name: Function results check
|
|
steps:
|
|
- group:
|
|
name: Function result failure
|
|
steps:
|
|
- lua_func:
|
|
name: int failure
|
|
key: $(test)_PASS
|
|
file: $(test_path)$(psep)lua_func.lua
|
|
func_name: echo
|
|
param: [-1]
|
|
- lua_func:
|
|
name: float failure
|
|
key: $(test)_PASS
|
|
file: $(test_path)$(psep)lua_func.lua
|
|
func_name: echo
|
|
param: [-1.3]
|
|
- lua_func:
|
|
name: String failure
|
|
key: $(test)_PASS
|
|
file: $(test_path)$(psep)lua_func.lua
|
|
func_name: echo
|
|
param: [ "FAIL" ]
|
|
- lua_func:
|
|
name: Tuple int,str failure
|
|
key: $(test)_PASS
|
|
file: $(test_path)$(psep)lua_func.lua
|
|
func_name: tuple_return
|
|
param: [ -1, "Got a failure" ]
|
|
- group:
|
|
name: Functions result success
|
|
steps:
|
|
- lua_func:
|
|
name: int success
|
|
key: $(test)_PASS
|
|
file: $(test_path)$(psep)lua_func.lua
|
|
func_name: echo
|
|
param: [0]
|
|
- lua_func:
|
|
name: float success
|
|
key: $(test)_PASS
|
|
file: $(test_path)$(psep)lua_func.lua
|
|
func_name: echo
|
|
param: [0.3]
|
|
- lua_func:
|
|
name: String success
|
|
key: $(test)_PASS
|
|
file: $(test_path)$(psep)lua_func.lua
|
|
func_name: echo
|
|
param: [ "Something that is not only strictly FAIL" ]
|
|
- lua_func:
|
|
name: Tuple int,str success
|
|
key: $(test)_PASS
|
|
file: $(test_path)$(psep)lua_func.lua
|
|
func_name: tuple_return
|
|
param: [ 0, "OK" ]
|
|
|
|
- group:
|
|
name: context_id tests
|
|
steps:
|
|
- lua_func:
|
|
name: set context value
|
|
key: $(test)_PASS
|
|
file: $(test_path)$(psep)lua_func.lua
|
|
func_name: set_context_value
|
|
context_id: lua_ctx_test
|
|
param:
|
|
- hello lua
|
|
expected_result: hello lua
|
|
- lua_func:
|
|
name: get context value (same context_id)
|
|
key: $(test)_PASS
|
|
file: $(test_path)$(psep)lua_func.lua
|
|
func_name: get_context_value
|
|
context_id: lua_ctx_test
|
|
expected_result: hello lua
|
|
- lua_func:
|
|
name: get context value (no context_id, from main gd)
|
|
key: $(test)_PASS
|
|
file: $(test_path)$(psep)lua_func.lua
|
|
func_name: get_context_value
|
|
expected_result: hello lua
|
|
- lua_func:
|
|
name: get context value (different context_id)
|
|
key: $(test)_PASS
|
|
file: $(test_path)$(psep)lua_func.lua
|
|
func_name: get_context_value
|
|
context_id: lua_ctx_other
|
|
expected_result: hello lua
|