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

Allow to run unit-tests on Windows #2287

Merged
merged 19 commits into from Aug 5, 2021

Conversation

WojciechMazur
Copy link
Contributor

This PR continues topic of Scala Native support for Windows. It adds platform-specific compact layer for java.net Sockets allowing to execute unit tests. It also adds proper implementation for required java.io methods. To limit the number of changes currently only smaller subset of tests testsExt was added to CI

  • Included testsExt tests in the CI
  • Added minimal java.net implementation
  • Added binding for time.h not POSIX compliment *_s methods used in Windows
  • Added minimal java.io.File implementation required for tests
  • Added bindings for required WinSock2 and FileAPI functions
  • Fixed parsing symbols in Stacktrace on Windows
  • Added -g to compilation and linking step on Windows to allow gathering stack traces.
  • Fixed java.util.Date to compile on Windows

This PR needs to be rebased onto #2281 to actually work.

// Windows specific copy of posixlib/time.h
// Uses *_s variants of methods instead of *_r
#if defined(_WIN32)
#define _CRT_SECURE_NO_WARNINGS
Copy link
Member

Choose a reason for hiding this comment

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

I really think we should consider just doing a clib time API - We should have virtually all the time stuff in clib and then just the posix specific in the posixlib.

Both time APIs can access the same C code and we could just deprecate most of the Scala in posixlib. You could then add just windows specific stuff in another interface as needed.

Do you think we should just address that in another PR and try it get it merged first?

@WojciechMazur WojciechMazur marked this pull request as ready for review June 1, 2021 14:33
.github/workflows/run-tests-windows.yml Outdated Show resolved Hide resolved
javalib/src/main/scala/java/io/File.scala Outdated Show resolved Hide resolved
javalib/src/main/scala/java/io/FileOutputStream.scala Outdated Show resolved Hide resolved
windowslib/src/main/resources/scala-native/windows/time.c Outdated Show resolved Hide resolved
@WojciechMazur WojciechMazur merged commit 7deeb46 into scala-native:master Aug 5, 2021
WojciechMazur added a commit to WojciechMazur/scala-native that referenced this pull request Aug 25, 2021
This PR continues topic of Scala Native support for Windows. It adds platform-specific compact layer for java.net Sockets allowing to execute unit tests. It also adds proper implementation for required java.io methods. To limit the number of changes currently only smaller subset of tests testsExt was added to CI

* Included testsExt tests in the CI
* Added minimal java.net implementation
* Added binding for time.h not POSIX compliment *_s methods used in Windows
* Added minimal java.io.File implementation required for tests
* Added bindings for required WinSock2 and FileAPI functions
* Fixed parsing symbols in Stacktrace on Windows
* Added -g to compilation and linking step on Windows to allow gathering stack traces.
* Fixed java.util.Date to compile on Windows
@WojciechMazur WojciechMazur deleted the windows/unit-tests branch December 24, 2021 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants