Commit Graph

16077 Commits (84304a3282fc5be31f657e0de9c8ff305efc4789)

Author SHA1 Message Date
Jeremie Dimino 84304a3282 Core review work
- Apply the __ heuristic more systematically
- Update tests
- Fix Windows builds
2018-02-12 08:29:17 +00:00
octachron 8f2a15369f Factorize the build of the unprefixed stdlib
which is used by both ocamldoc and the reference manual.
2018-02-12 08:29:16 +00:00
octachron e95b0c4769 Minimal fix for the manual build pocess 2018-02-12 08:29:16 +00:00
David Allsopp 5e35fd0418 Alter awk scripts to cope with CRLF checkout 2018-02-12 08:29:16 +00:00
David Allsopp 4d79045d95 Use gawk on Windows in the build system
awk is symbolic link in Cygwin, which means it can't be used in -pp for
a native Windows build. Just use gawk instead, as no other package
provides the awk command on Cygwin.
2018-02-12 08:29:16 +00:00
Jeremie Dimino 225d1c65b9 Prefix the compilation unit names of all modules in the stdlib
Except for the Camlinternal* modules and the new Stdlib module, all
modules in the stdlib now compile to Stdlib__<module>.

Pervasives is renamed to Stdlib and now contains a list of aliases
from the long names to the short ones, so that from inside and outside
the stdlib we can refer to the standard modules as just List or
Stdlib.List rather than Stdlib__list.

In order to avoid printing the long names in error messages and in the
toplevel, the following heuristic is added to Printtyp: given a path
Foo__bar, if Foo.Bar exists and is a direct or indirect alias to
Foo__bar, then prefer Foo.Bar.

A bootstrap step was required to replace Pervasives by Stdlib as the
module opened by default.
2018-02-12 08:29:16 +00:00
Xavier Leroy e2e928fafe
MPR#7710: cyclic dependencies are an error for ocamldep -sort (#1578)
Before, cyclic dependencies were reported as a warning, and ocamldep -sort would exit with code 0.
Now, the message says "error" and the exit code is nonzero.
2018-02-11 14:54:48 +01:00
Gabriel Scherer f8b145b7ee
Merge pull request #1601 from delamonpansie/fix-doc-typo
Fix minor typo
2018-02-09 18:59:13 +01:00
Yuriy Vostrikov 3899948207 Fix minor typo 2018-02-09 19:46:52 +03:00
Sébastien Hinderer 01d436ba71 ocamltest: fix typo in previous commit 2018-02-08 15:04:06 +01:00
Sébastien Hinderer 3dcf686e86 ocamltest: add the "config" environment modifier
It adds the "utils" directory of te compiler to the list of
included directories.

This is useful for the tests which rely on Ocaml's Config module.

For the moment, such tests will still need to explicitly add
config.cmo / config.cmx to the list of linked modules thanks to the
all_modules variable.
2018-02-08 14:55:01 +01:00
Sébastien Hinderer 1af683fab1 ocamltest: add tests for flambda and spacetime support 2018-02-08 14:21:07 +01:00
Thomas Refis b00ca46feb
Merge pull request #1468 from trefis/enrich_typedecl
Do not enrich type_decls with incoherent manifests
2018-02-08 10:24:05 +00:00
Thomas Refis 085306b260 Changes 2018-02-08 10:23:04 +00:00
Thomas Refis cfc8f12ec8 enrich_typedecls: add tests 2018-02-08 10:23:04 +00:00
Thomas Refis 39b864f160 revert 88e8bec and 7b1140f : there should be no incoherent manifests anymore 2018-02-08 10:23:04 +00:00
Thomas Refis 68da72c265 enrich_typedecl: don't enrich incompatible decls 2018-02-08 10:23:04 +00:00
Sébastien Hinderer 3e3e8be164 ocamltest: do not use -linkall by default
This is to be closer to the behaviour of the legacy test harness
2018-02-08 10:10:08 +01:00
Sébastien Hinderer f55ec85bd8 ocamltest: rename a function to follow the coding conventions 2018-02-07 19:12:15 +01:00
Sébastien Hinderer 1b87cdd1df ocamltest: rename the source_modules variable to all_modules and make it public
This variable lists the files that need to be compiled and linked
to build a test.

By default, its value is derived from the "modules" variable and the
name of the test file. But it can now be overriden, which turns
out to be necessary, sometimes, e.g. when the modules have been
compiled separately.
2018-02-07 19:06:31 +01:00
Sébastien Hinderer 11118e03ae ocamltest: extend the Ocaml_filetypes module
Add constructors for the binary files
2018-02-07 18:47:11 +01:00
Sébastien Hinderer 0078dc54df ocamltest: rename the Filetype module into Ocaml_filetypes
This code is clearly OCaml-specific.
2018-02-07 17:58:44 +01:00
Sébastien Hinderer 248b9fcb0d ocamltest: rely on our own backend type
Use a backend type with only two constructors rather than the one provided
by the stdlib. This avoids having to deal with the "Other" case.
2018-02-07 17:24:25 +01:00
Gabriel Scherer f5a1ec53fc
Merge pull request #1586 from gasche/ocamltest-promote
A `-promote` option for ocamltest
2018-02-07 16:56:03 +01:00
Gabriel Scherer cb2379fa32 document that ocamltest -promote is experimental 2018-02-07 14:11:36 +01:00
Gabriel Scherer 746dfc5a9b testsuite/Makefile: support ocamltest in 'promote' target 2018-02-07 13:52:35 +01:00
Gabriel Scherer a564aed3ab testsuite/Makefile: factorize ocamltest execution 2018-02-07 13:52:35 +01:00
Gabriel Scherer 352e72d335 ocamltest: implement a -promote option
When -promote is set, running the test automatically overwrites each
reference output file with the actual output of the test. This option,
which mirrors the "make promote" target of old-style testsuite tests,
is very useful when a minor change in compiler/toplevel output affects
a lot of reference files in innocuous ways.

This is the only option of ocamltest that overwrites file in the
source directory, so it should be used with care -- under strict
version-control supervision.

The 'make promote' target is not yet supported for new-style testsuite
tests, as this feature depends on the not-yet-merged GPR#1574

  https://github.com/ocaml/ocaml/pull/1574

For a previous discussions of this feature, see GPR#1519

  https://github.com/ocaml/ocaml/pull/1519
2018-02-07 13:52:35 +01:00
Gabriel Scherer 05ac9d329e ocamltest: helper Environments function for boolean variables 2018-02-07 13:51:42 +01:00
Sébastien Hinderer fa60723857 ocamltest: take user-defined values of program varialbes into account 2018-02-07 12:33:30 +01:00
Sébastien Hinderer eb9a39e1b0 ocamltest: let scripts modify env and report reasons as hooks do 2018-02-06 16:30:43 +01:00
Sébastien Hinderer 1c3dd7755e ocamltest: add the afl-support test 2018-02-06 15:05:28 +01:00
Sébastien Hinderer 726c52ba87 ocamltest: add the "native-compiler" action
This action checks whether the support for native compilers is available.

It aims at replacing the $(BYTECODE_ONLY) Make variable.
2018-02-06 15:05:27 +01:00
Sébastien Hinderer 45074d3ed5 Migrate tests under lib-systhreads to ocamltest 2018-02-06 11:49:36 +01:00
Sébastien Hinderer c04cecc07e ocamltest: clarify the builtin tests a bit
This commit distinguishes the OS tests from the library tests.

It introduces the "libunix" and "libwin32unix" tests to figure out which
library is used.

It also changes to meaning of the "windows" test to pass on all Windows platforms.

Finally, a "not-windows" test is introduced, to be used until negation
on tests is implemented.
2018-02-06 11:48:55 +01:00
Gabriel Scherer cc5b7ef6be make alldepend 2018-02-05 19:30:48 +01:00
Gabriel Scherer 3e27ca1f16 synchronize Changes with 4.06 2018-02-05 19:03:00 +01:00
Sébastien Hinderer efb4916a5c ocamltest: include unix in the systhreads environment modifier 2018-02-05 15:09:20 +01:00
Sébastien Hinderer 3b890c86fe ocmaltest: rename threads environment modifier to systhreads
This is to avoid confusion between systhreads and vmthreads
2018-02-05 15:09:20 +01:00
Sébastien Hinderer 5229928c62 ocamltest: add actions to test whether we are running on a BSD system 2018-02-05 14:48:56 +01:00
Sébastien Hinderer 917c8cbe9e Remove useless test from the testsuite
According to its name, this test should be related to
MPR #5080 (https://caml.inria.fr/mantis/view.php?id=5080).

However, (1) the .ml source file does not use any quotation and (2)
the flags -pp 'camlp4o pa_macro.cmo' defined in the ADD_COMPFLAGS
make variable are not used while compiling the test, because the
rules in Makefile.okbad, which do not use ADD_COMPFLAGS, take precedence.

This test thus seems useless.
2018-02-05 14:06:33 +01:00
Sébastien Hinderer 8c75ba867f ocamltest: introduce the result module
This module contains types describing test results and functions to
build and use them.

Before this commit, only successful actions were returning an environemnt.
Starting from this commit, actions always return an environemnt, no matter
their result.

This will make it possible to write negations over tests.
2018-02-05 08:49:49 +01:00
Sébastien Hinderer b2321e12b7 ocamltest: register the module variable 2018-02-02 15:21:56 +01:00
Sébastien Hinderer 35085dc4fa ocamltest: introduce the possibility to compile only one module 2018-02-02 13:06:40 +01:00
Sébastien Hinderer 6517f0e53d ocamltest: rename compile_test_program to compile 2018-02-02 13:06:40 +01:00
Sébastien Hinderer 872775e639 ocamltest: move code from compile_test_program to compile_program
Also integrate the code of link_modules to compile_program
2018-02-02 13:06:40 +01:00
Sébastien Hinderer c24cb5b59c ocamltest: compute compiler output and reference during build env setup
Before this commit this was done by the compile actions themselves but it
is actually better to do it only once during the setup of the
build environment.
2018-02-02 13:06:40 +01:00
Sébastien Hinderer 7955b9c0c6 ocamltest: remove useless function arguments
In ocaml_actions, remove those arguments that can be derived from other
ones or can be easily computed.
2018-02-02 13:06:40 +01:00
Jérémie Dimino 49f6dd5d20
Allow compilation units to shadow sub-modules of Pervasives (#1513) 2018-02-02 10:44:23 +00:00
Jeremy Yallop 9aae7988ae Add an additional test for let-rec + unboxed types 2018-02-01 21:58:56 +01:00