Various fixes for windows

This commit is contained in:
2026-02-14 13:29:22 +01:00
parent a2af730894
commit bc3ac40cef
7 changed files with 41 additions and 7 deletions

View File

@@ -77,6 +77,9 @@ main:
condition: <| $(conditional_exec) == 1 |>
console_name: consname
steps:
{% if os == "Windows" %}
- read_until: {expected: "echo 0", timeout: 0}
{% endif %}
- read_until: {expected: "0", timeout: 0}
- console:

View File

@@ -67,13 +67,16 @@ main:
name: Console read_until immediate
console_name: consname
steps:
- read_until: {expected: "0", timeout: 0}
{% if os == "Windows" %}
- read_until: {expected: "echo 0", timeout: 1}
{% endif %}
- read_until: {expected: "0", timeout: 1}
- console:
name: Console read_until immediate (2)
console_name: consname
steps:
- read_until: {expected: "$(terminal_prompt)", timeout: 0}
- read_until: {expected: "$(terminal_prompt)", timeout: 1}
- console:
name: Console closure

View File

@@ -13,8 +13,13 @@ main:
- open:
protocol: terminal
terminal_path: $(test_directory)
{% if os == "Windows" %}
- writeln: mkdir "$(plot_log_path)" && echo Fini
- read_until: {expected: echo Fini, timeout: 1}
{% else %}
- writeln: mkdir -p "$(plot_log_path)" && echo Fini
- read_until: {expected: Fini, timeout: 5}
{% endif %}
- read_until: {expected: Fini, timeout: 1}
- console:
name: Console closure

View File

@@ -88,8 +88,9 @@ class TestItemConsoleOpen(TestItemConsoleAction):
terminal_path = self._prms.getParam("terminal_path", processed=True)
if terminal_path is not None:
terminal_path = os.path.normpath(terminal_path)
default_shell = "cmd.exe" if tm.OS() == "Windows" else "/usr/bin/env bash"
terminal_shell = self._prms.getParam(
"shell", default="/usr/bin/env bash", required=False, processed=True
"shell", default=default_shell, required=False, processed=True
)
try:

View File

@@ -1,5 +1,6 @@
import lxml
import lxml.html
import lxml.etree
import html
import interpreter.test_report.report_export as rpe
import interpreter.test_report.test_report as tr

View File

@@ -42,6 +42,9 @@
console_name: consname
key: $(test)_PASS
steps:
{% if os == "Windows" %}
- read_until: {expected: echo "terminal loaded", timeout: 1}
{% endif %}
- read_until: {expected: terminal loaded, timeout: 5}
- console:
@@ -63,6 +66,9 @@
console_name: consname
key: $(test)_PASS
steps:
{% if os == "Windows" %}
- read_until: {expected: echo 0, timeout: 0}
{% endif %}
- read_until: {expected: "0", timeout: 0}
- console:

View File

@@ -8,14 +8,20 @@
- open:
protocol: terminal
terminal_path: $(test_directory)
{% if os == "Linux" %}
- writeln: echo "endOfOpen"
{% endif %}
- console:
name: Console read_until with timeout
console_name: term
key: $(test)_PASS
steps:
{% if os == "Linux" %}
- read_until: {expected: endOfOpen, timeout: 5}
{% else %}
- read_until: {expected: $(terminal_prompt), timeout: 5}
{% endif %}
- console:
name: Console write
@@ -33,6 +39,9 @@
console_name: term
key: $(test)_PASS
steps:
{% if os == "Windows" %}
- read_until: {expected: "echo 0", timeout: 0}
{% endif %}
- read_until: {expected: "0", timeout: 0}
- console:
@@ -61,7 +70,7 @@
console_name: term
key: $(test)_PASS
steps:
- read_until: {expected: "Something never prints", timeout: 1, no_fail: true}
- read_until: {expected: Something never prints, timeout: 1, no_fail: true}
- console:
name: Console read_until muted
@@ -69,7 +78,10 @@
key: $(test)_PASS
steps:
- writeln: echo "HelloConsole"
- read_until: {expected: "HelloConsole", timeout: 1, mute: true}
{% if os == "Windows" %}
- read_until: {expected: echo "HelloConsole", timeout: 1, mute: true}
{% endif %}
- read_until: {expected: HelloConsole, timeout: 1, mute: true}
- console:
name: Console read_until muted
@@ -77,6 +89,9 @@
key: $(test)_PASS
steps:
- writeln: echo "HelloConsole is PASS" && echo "endOfCmd"
{% if os == "Windows" %}
- read_until: {expected: echo "endOfCmd", timeout: 1}
{% endif %}
- read_until: {expected: endOfCmd, timeout: 1, process_result: "'Hello' in r'''$(result)''' and 'PASS' in r'''$(result)''' "}
- console: