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

tests: add support to test cross-compiled via Windows Subsystem for Linux (WIP) #3899

Merged
merged 3 commits into from Dec 10, 2019

Conversation

mback2k
Copy link
Member

@mback2k mback2k commented May 18, 2019

This enables the use of Windows Subsystem for Linux to run the
testsuite against Windows binaries while using Linux servers.

This PR introduces the following environment variables:

  • CURL_TEST_EXE_EXT: set the executable extension for all components
  • CURL_TEST_EXE_EXT_TOOL: set it for the curl tool only
  • CURL_TEST_EXE_EXT_SSH: set it for the SSH tools only
  • CURL_TEST_EXE_EXT_SRV: set it for the test servers only

Later testcurl.pl could be adjusted to make use of those variables.

Example usage:

CURL_TEST_EXE_EXT_TOOL=.exe CURL_TEST_EXE_EXT_SRV=.exe ./runtests.pl -a

This will use .exe variants for the curl tool and the test servers, but not for OpenSSH commands and therefore enables testing Windows curl against known good Linux OpenSSH (instead of a Windows port).

This PR requires #3290 and therefore currently carries b9f8937 with it until #3290 is merged.

@mback2k mback2k self-assigned this May 19, 2019
@mback2k mback2k requested a review from bagder May 19, 2019 11:54
@mback2k
Copy link
Member Author

mback2k commented May 19, 2019

@bagder Any thoughts about the structure of this? I am still thinking about a better approach to specify the executable extension for different parts of the testsuite, e.g. via additional runtests.pl and testcurl.pl parameters.

Finally I would also like to achieve the possibility of compiling the test servers for Linux while the rest is still cross-compiled so that the Windows build of curl could be tested against test servers that do not include crazy Windows workarounds. A solution which I haven't tested yet, could be to run ./configure twice, once for Linux and once for Windows and then only making the servers for Linux.

@mback2k
Copy link
Member Author

mback2k commented May 22, 2019

Rebased to current master and updated logmsg to only force \r\n on Windows Subsystem for Linux.

@mback2k
Copy link
Member Author

mback2k commented May 28, 2019

Rebased to current master and removed weird special character from runtests.pl that caused:
Unrecognized character \xC2; marked by <-- HERE after ($is_wsl)<-- HERE near column 21 at /tests/runtests.pl line 330.

@stale
Copy link

stale bot commented Nov 24, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 24, 2019
@mback2k
Copy link
Member Author

mback2k commented Nov 24, 2019

@bagder Would you mind taking a look at this idea?

@stale stale bot removed the stale label Nov 24, 2019
@bagder
Copy link
Member

bagder commented Nov 26, 2019

I think the idea is fine. It is possibly a bit icky for users to have to set multiple long environment variables to get it going, but it also seems like a rather edge use case so I doubt we will see wide adoption and use of this.

I don't run/use Windows myself. I can't comment on the specifics as I haven't tested this.

Copy link
Member

@bagder bagder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me, but I have not tested it!

@jay jay added the tests label Dec 7, 2019
@jay
Copy link
Member

jay commented Dec 7, 2019

Can we get someone who uses WSL to review this, @MarcelRaad don't mean to single you out but I know you've used it...

@mback2k mback2k marked this pull request as ready for review December 9, 2019 09:44
@mback2k
Copy link
Member Author

mback2k commented Dec 9, 2019

@MarcelRaad @bagder @jay Thanks for the feedback, I guess this can be merged in it's current state and additional improvements done in a separate PR.

Bash in Windows Subsystem for Linux (WSL) requires it for some reason.

(This is one of several commits to support use of WSL for the tests.)

Ref: curl#3899
Keys created on Windows Subsystem for Linux (WSL) require it for some
reason.

(This is one of several commits to support use of WSL for the tests.)

Ref: curl#3899
This enables the use of Windows Subsystem for Linux (WSL) to run the
testsuite against Windows binaries while using Linux servers.

This commit introduces the following environment variables:
- CURL_TEST_EXE_EXT: set the executable extension for all components
- CURL_TEST_EXE_EXT_TOOL: set it for the curl tool only
- CURL_TEST_EXE_EXT_SSH: set it for the SSH tools only

Later testcurl.pl could be adjusted to make use of those variables.
- CURL_TEST_EXE_EXT_SRV: set it for the test servers only

(This is one of several commits to support use of WSL for the tests.)

Closes curl#3899
@jay
Copy link
Member

jay commented Dec 10, 2019

Travis CI wasn't listed in the check for some reason. I've prepared the commits and rebased on master and force pushed to your branch, hopefully the travis ci will run now.

@bagder
Copy link
Member

bagder commented Dec 10, 2019

Very green!

@jay jay closed this in 9819984 Dec 10, 2019
@jay jay merged commit 9819984 into curl:master Dec 10, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

None yet

4 participants