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

utils/edit_distance test fails if ocaml.opt is not built #6840

Closed
vicuna opened this issue Apr 15, 2015 · 3 comments
Closed

utils/edit_distance test fails if ocaml.opt is not built #6840

vicuna opened this issue Apr 15, 2015 · 3 comments

Comments

@vicuna
Copy link

vicuna commented Apr 15, 2015

Original bug ID: 6840
Reporter: @lpw25
Assigned to: @gasche
Status: closed (set by @xavierleroy on 2016-12-07T10:48:57Z)
Resolution: fixed
Priority: normal
Severity: minor
Fixed in version: 4.02.2+dev / +rc1
Category: configure and build/install

Bug description

The test in testsuite/tests/utils/edit_distance.ml always fails if you have not
run make world.opt. The attached patch fixes this by only running the test in
bytecode mode.

It should be noted that this test is a unit test of a function within the
compiler. This is inconsistent with the rest of the testsuite, and it should
probably be replace by a test which checks the actual output of the compiler.

I suggest merging the attached fix, but leaving the bug unresolved until the test
has been rewritten.

File attachments

@vicuna
Copy link
Author

vicuna commented Apr 15, 2015

Comment author: @gasche

This is inconsistent with the rest of the testsuite, and it should
probably be replace by a test which checks the actual output of the compiler.

What would be the point of such a change? My idea in adding the test is that we might want to change the implementation (eg. to a more optimized one) later, and that this testcase could catch regression bugs at this time. Trying to test the compiler output seems harder, more fragile (you're sensitive to changes in heuristics), and likely to catch less bugs.

@vicuna
Copy link
Author

vicuna commented Apr 16, 2015

Comment author: @lpw25

What would be the point of such a change?

I guess it is just quite strange to have a single unit test in amongst all the non-unit tests. Every other test tests the behaviour of the compiler that has been built, whereas this test compiles some new code and tests the behaviour of that.

Perhaps it would make more sense if this test was testing the behaviour of the function within the appropriate compiler-libs. I know it wouldn't make much difference, but at least then it would be testing an output of the build process rather than testing the source directly.

@vicuna
Copy link
Author

vicuna commented Apr 26, 2015

Comment author: @gasche

I applied the patch you propose (BYTECODE_ONLY). Given that the rest of the suggestion seems hard to implement without weakening the safety guarantees, I'm fine with "strange" here and mark the bug resolved (but do feel free to complain here if the odd test does create another actual problem someday).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants