Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: api changes to extend windows support. #27

Open
YO4 opened this issue Nov 4, 2024 · 0 comments · May be fixed by #25
Open

RFC: api changes to extend windows support. #27

YO4 opened this issue Nov 4, 2024 · 0 comments · May be fixed by #25

Comments

@YO4
Copy link

YO4 commented Nov 4, 2024

In the PR #25 Windows CI support is in progress.
I describe here some changes needed for windows support.

CLI options

Windows has expanded console support in recent years, with multiple implementations coexisting.
To make these choices, I decided to use the CLI option.
As an example, the following is a way to specify that conhost is used, the window under test is displayed, and the failed test is not closed but left in place.
rake TESTOPTS="--windows=conhost --show-console --close-console=pass"
Additional options are follows.

yamatanooroti options
        --wait=0.01                  Specify yamatanooroti wait time in seconds.
        --timeout=2.0                Specify yamatanooroti timeout in seconds.
windows specific yamatanooroti options
        --windows=TYPE               Specify console type
                                     (ca[nary], co[nhost], l[egacy-conhost], p[review], s[table])
                                     (1.17, 1.18, 1.19, 1.20, 1.21, 1.21preview, 1.22preview)
        --wt-dir=DIR                 Specify Windows Terminal working dir.
                                     Automatically determined if not specified and treated temporary.
                                     DIR is treaded permanent if specified and download files are remains.
        --[no-]show-console          Show test ongoing console.
        --[no-]close-console[=COND]  Close test target console when COND met
                                     (a[lways], n[ever], p[ass])

Yamatanooroti API changes

The behavior of Windows conhost (aka. Command Prompt Window) changes depending on the code page settings.
Needed to support code page changes to correctly display DBCS in a CI environment.
To change the codepage before launch of the target process, the codepage must be specified in start_terminal().
Currently, it is treated as windows specific and the new settings are used only in a windows environment.
‘‘‘
def setup
if Yamatanooroti.win?
start_terminal(5, 30, ['ruby', 'bin/simple_repl'], startup_message: 'prompt>', codepage: 932)
else
start_terminal(5, 30, ['ruby', 'bin/simple_repl'], startup_message: 'prompt>')
end
end
‘‘‘
Since Yamatanooroti.win is included in the existing yamatanooroti, the changes will not affect non-Windows environments.
However, since the test code appears to be redundant, it is also a consideration to modify the vterm side to accept it as **kwargs and ignore it.

Another changes

A test-unit specific api is used to reduce signal handler invalidation by the WIN32API used and to determine window close by test results. For example, Test::Unit.at_exit testdown do; end
Since yamatanooroti is not executed in the ruby test, I have determined that this does not affect it, but I have not confirmed this.

@YO4 YO4 linked a pull request Nov 4, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant