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

Port win-unicode test to ocamltest #1730

Merged
merged 2 commits into from May 22, 2018
Merged

Conversation

nojb
Copy link
Contributor

@nojb nojb commented Apr 18, 2018

@shindere
Copy link
Contributor

shindere commented Apr 18, 2018 via email

@shindere
Copy link
Contributor

shindere commented Apr 18, 2018 via email

@shindere
Copy link
Contributor

shindere commented Apr 18, 2018 via email

@nojb
Copy link
Contributor Author

nojb commented Apr 19, 2018

could you please update .gitognore ?

Done.

@shindere
Copy link
Contributor

shindere commented Apr 19, 2018 via email

@nojb
Copy link
Contributor Author

nojb commented Apr 19, 2018

It seems the tests will run everywhere: is it on purpose that you didn't
guard them with the Config.windows_unicode stuff?

No, I just didn't know how to do it. The test will only compile on Windows and will fail if Unicode is not enabled, so: how do I restrict a test to run only when Config.windows_unicode is true ?

@nojb
Copy link
Contributor Author

nojb commented Apr 19, 2018

Second, the Makefile uses a number of flags to ocamlc and ocamlopt
that you don't use in the test block. Is that on purpose that you
omitted them?

No, I forgot to put them back; but in any case they were not important for the test.

@shindere
Copy link
Contributor

shindere commented Apr 19, 2018 via email

@shindere
Copy link
Contributor

shindere commented Apr 19, 2018 via email

@nojb nojb force-pushed the win_unicode_ocamltests branch 3 times, most recently from d90ce72 to 8b20939 Compare April 19, 2018 08:59
@nojb
Copy link
Contributor Author

nojb commented Apr 19, 2018

I'd suggest that you cherry-pick this as the first commit of your
branch. It adds a "windows-unicode" test. You may have to amend the
commit, I didn't test it,it was mainly to show you how it goes.

Done. Seems to work well, except the comparison of the reference file win-unicode/exec_tests.reference. Does ocamltest ignore end-of-line differences when comparing? In any case this test used to be disabled because it could not be run consistently in the CI, so we may have to disable it anyway (but let's see if problems persist when running it under ocamltest).

@shindere
Copy link
Contributor

shindere commented Apr 19, 2018 via email

@dra27
Copy link
Member

dra27 commented Apr 26, 2018

I think it's b1058dd in #1426 which was meant to be make comparisons \r-agnostic.

@dra27
Copy link
Member

dra27 commented Apr 26, 2018

This has nothing to do with line-endings - the files really are different!

@shindere
Copy link
Contributor

shindere commented Apr 26, 2018 via email

@dra27
Copy link
Member

dra27 commented Apr 26, 2018

There is at least a bug in ocamltest's detection for process termination (GPR for that shortly) and this test is presently sensitive to whether ocaml is installed or not - but I'm not sure yet whether that's the Makefile which is at fault or ocamltest!

@dra27
Copy link
Member

dra27 commented Apr 26, 2018

The weird comparison error message is now fixed - basically, at the point at which ocamltest was comparing the files, the execv'd processes hadn't finished and so the lines weren't displayed... but by the time diff was called to display the difference, it had and had written the lines!

@nojb - have you tested this on msvc or just mingw? It looks like the symlink_tests isn't linking the C stubs and I wondered if this might be a .o/.obj thing in ocamltest, but I haven't looked in detail. I'm also seeing errors loading unix.cma unless I have ocaml preinstalled which I think means something to do with the old SET_LD_PATH may be required - but there must be other tests which already need to do this (again, I just haven't looked yet).

@nojb
Copy link
Contributor Author

nojb commented Apr 26, 2018

Thanks for the help @dra27! I haven't yet looked at this again, but plan to do it between today and tomorrow; will keep my eyes open.

@shindere
Copy link
Contributor

shindere commented Apr 26, 2018 via email

@dra27
Copy link
Member

dra27 commented Apr 26, 2018

@shindere - AppVeyor doesn't have an OCaml installed - what I was guessing was that @nojb does, as he seemed to be only talking about the error with the file comparison, not the other errors trying to run the tests! Is there something which should be in the ML file to ensure that the correct directory is available to ocamlrun for finding dllunix.dll?

@shindere
Copy link
Contributor

shindere commented Apr 26, 2018 via email

@nojb nojb force-pushed the win_unicode_ocamltests branch 2 times, most recently from ce4bbc4 to 596b5a6 Compare April 30, 2018 07:49
** setup-ocamlc.byte-build-env
program = "${test_build_directory}/mltest.byte"
*** ocamlc.byte
program = "${test_build_directory}/print.exe"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@shindere This auxiliary program needs to be compiled with the unix library, how do I do that?

@shindere
Copy link
Contributor

shindere commented May 9, 2018 via email

@nojb
Copy link
Contributor Author

nojb commented May 9, 2018

Are you saying that the "include unix" at the beginning of the test
block is not enough for that to work? I'd have guessed it would have
been enough, no?

No, it does not work. The program compiles fine, but the bytecode version of the helper program print.exe fails to find the unix DLL. (One needs to set CAML_LD_LIBRARY_PATH I guess).

@shindere
Copy link
Contributor

shindere commented May 9, 2018 via email

@nojb nojb force-pushed the win_unicode_ocamltests branch 2 times, most recently from 06dec1c to 964b332 Compare May 11, 2018 14:03
@nojb
Copy link
Contributor Author

nojb commented May 11, 2018

@shindere Sorry for the delay; I pushed a version that works in my machine, hopefully CI will validate.

  • I disabled a couple of tests in mltest.ml that caused problems but that were "repeated" anyway
  • The exec_tests.ml test is only run in native to avoid the problem of the missing unix DLL. In that test the test executable is launched from itself using Unix.exec* functions. In bytecode, the unix DLL is not found. I did not want to take up more time porting this test since it is one of the few remaining ones. The bytecode version can always be re-enabled later.

@shindere
Copy link
Contributor

shindere commented May 12, 2018 via email

@shindere
Copy link
Contributor

shindere commented May 12, 2018 via email

@shindere
Copy link
Contributor

shindere commented May 17, 2018 via email

@nojb
Copy link
Contributor Author

nojb commented May 17, 2018

Just tomake sure: was my review precise enough to be helpful?

Yeah, sorry for the delay, I've been super busy - I will try to get all this sorted out as soon as possible.

@shindere
Copy link
Contributor

shindere commented May 17, 2018 via email

@shindere
Copy link
Contributor

@nojb: You may take inspiration from
876d53a
just pushed to trunk by @xavierleroy and pass the whole system environment
to the child program, rather than just a few variables.

@nojb
Copy link
Contributor Author

nojb commented May 19, 2018

You may take inspiration from …

Thanks, I'll keep it in mind!

@nojb
Copy link
Contributor Author

nojb commented May 21, 2018

@shindere I simplified the test (in particular, no C stubs are needed anymore) and rewrote it as a toplevel test. AppVeyor passes, and Travis fails due to Changes (even though this PR has the label no-change-entry-needed).

@shindere
Copy link
Contributor

shindere commented May 21, 2018 via email

@nojb
Copy link
Contributor Author

nojb commented May 22, 2018

Could you please make sure the branch is rebased on latest trunk and the
commit history is clean?

Done.

@shindere
Copy link
Contributor

shindere commented May 22, 2018 via email

@shindere shindere merged commit 6ab67ad into ocaml:trunk May 22, 2018
@nojb nojb deleted the win_unicode_ocamltests branch May 22, 2018 07:29
@shindere
Copy link
Contributor

shindere commented May 22, 2018 via email

@nojb
Copy link
Contributor Author

nojb commented May 22, 2018

The only point I didn't check is that we do not lose anything in terms
of code coverage compared to the way the tests were done before.

Well, I removed the "exec" tests which were difficult to get right, but I think they are well exercised by the AppVeyor build which invokes many commands with Unicode arguments.

@shindere
Copy link
Contributor

shindere commented May 22, 2018 via email

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