Skip to content

Clearer error in testsuite when ocamltest missing#9935

Merged
dra27 merged 1 commit intoocaml:trunkfrom
dra27:disabled-testsuite
Sep 23, 2020
Merged

Clearer error in testsuite when ocamltest missing#9935
dra27 merged 1 commit intoocaml:trunkfrom
dra27:disabled-testsuite

Conversation

@dra27
Copy link
Copy Markdown
Member

@dra27 dra27 commented Sep 22, 2020

Since #9250 in 4.11, it's possible to build OCaml without ocamltest (this was added for various reasons). If you either build a release tag or explicitly configure with --disable-test, the message if you try to run the testsuite is a little off:

dra27@summer:~/ocaml-6$ make -C testsuite all
make: Entering directory '/home/dra27/ocaml-6/testsuite'
/bin/sh: 2: -find-test-dirs: not found


Summary:
    0 tests passed
    0 tests skipped
    0 tests failed
    0 tests not started (parent test skipped or failed)
    0 unexpected errors
    0 tests considered

This tiny PR (most of the diff is whitespace change) displays a slightly less awful error message:

dra27@summer:~/ocaml-6$ make -C testsuite all
make: Entering directory '/home/dra27/ocaml-6/testsuite'
Makefile:121: *** ocamltest not found in ../ocamltest. Stop.
Makefile:115: recipe for target 'all' failed
make: *** [all] Error 2
make: Leaving directory '/home/dra27/ocaml-6/testsuite'

Copy link
Copy Markdown
Member

@gasche gasche left a comment

Choose a reason for hiding this comment

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

Looks good to me.

ifeq "$(FLEXLINK_ENV)" ""
ocamltest := MKDLL="$(MKDLL)" SORT=$(SORT) MAKE=$(MAKE) $(ocamltest_program)
ifeq "$(ocamltest_program)" ""
ocamltest = $(error ocamltest not found in $(ocamltest_directory))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Out of curiosity: could you run this as a separate conditional first (without putting the rest in an extra else .. endif level), given that the build errors if it fires?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I wanted to keep make working - i.e. the help target

@dra27
Copy link
Copy Markdown
Member Author

dra27 commented Sep 23, 2020

Thank you!

@dra27 dra27 merged commit eface9f into ocaml:trunk Sep 23, 2020
@dra27 dra27 deleted the disabled-testsuite branch September 23, 2020 08:42
@dra27 dra27 mentioned this pull request Oct 9, 2020
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.

2 participants