Commit Graph

381 Commits

Author SHA1 Message Date
Rudi Grinberg c4545fce18 Get rid of indexed lookups for deps
Have %{first-dep} to replace %{<}

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-06 18:46:10 +07:00
Etienne Millon 2c29217a20 Add a test case for project_root
Signed-off-by: Etienne Millon <etienne@cryptosense.com>
2018-07-06 18:46:09 +07:00
Rudi Grinberg 204b21f4fb Rename %{<} to %{deps[0]} and implement %{deps[i]}
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-06 18:46:09 +07:00
Rudi Grinberg 13c12e9def Rename %{^} to %{deps}
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-06 18:45:43 +07:00
Rudi Grinberg a317fb0606 Rename %{@} to %{targets}
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-06 18:45:43 +07:00
Rudi Grinberg c290ad288f Rename scope_root to project_root
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-06 18:45:43 +07:00
Rudi Grinberg 7707872e54
Test Stanza Proposal (#822)
Add tests and test stanza

These stanzas are used to easily define tests. If a test has a corresponding .expect file, it will be immediately considered as an expect test.
2018-07-06 18:43:31 +07:00
Etienne Millon 35ff6466de Remove path-no-dep syntax
See #944

Signed-off-by: Etienne Millon <etienne@cryptosense.com>
2018-07-04 10:39:57 +02:00
Etienne Millon 628914fe28 Rename path to dep in dune files
See #842

Signed-off-by: Etienne Millon <etienne@cryptosense.com>
2018-07-03 15:59:52 +02:00
Rudi Grinberg 7a91a2b23b
Merge branch 'master' into subsystem-versioned 2018-07-03 16:49:05 +07:00
Rudi Grinberg 8e09749f12 Add missing words to syntax error message
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-03 16:12:01 +07:00
Rudi Grinberg 8b5e1a9a13 Add tests for fallback
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-03 16:12:01 +07:00
Rudi Grinberg f6fe5d20bb Generate dune file version correctly
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-03 01:01:06 +07:00
Rudi Grinberg f163f6197a
Merge branch 'master' into rename-build-profile 2018-07-02 13:45:00 +07:00
Rudi Grinberg d19e55bd4d Rename %{build_profile} to %{profile}
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-02 12:52:48 +07:00
Rudi Grinberg d53179a56e Make install tests less verbose (#936)
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-01 22:08:13 +01:00
Jeremie Dimino 30db63ef71 Support @@alias to build an alias non-recursively
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-07-01 21:50:44 +01:00
Rudi Grinberg 60c97ab365 disable opam workspace blackbox test
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-01 01:46:32 +07:00
Rudi Grinberg d229b7811b Cleanup test by creating dune-project file
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-01 01:46:32 +07:00
Rudi Grinberg aa981b3206 Fix error message when workspace file doesn't exist
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-01 01:46:32 +07:00
Rudi Grinberg 2b307bfe99 Use Option.some_if when checking for workspace file
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-01 01:46:32 +07:00
Rudi Grinberg 5cbf391a04 Add a test suite for workspaces
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-01 01:46:32 +07:00
Rudi Grinberg d7796156fd Use Sexp.Loc.none rather than reinventing in test
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-01 00:34:45 +07:00
Nathan Rebours 23717d1fd6 Drop findlib:x syntax in dune and display an error (#887)
Signed-off-by: Nathan Rebours <nathan@cryptosense.com>
2018-06-29 21:35:41 +01:00
Jérémie Dimino 7e79e2870d
Make the set language more future proof (#930)
- forbid list starting by an atom not starting with - or :
- allow to avoid the toplevel parentheses in dune files

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-29 21:11:47 +01:00
Jérémie Dimino e886e948b7
Add a test where an action modify one of its dependency (#923)
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-29 12:44:51 +01:00
Jeremie Dimino 2982567639 Make the default build profile be dev
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-28 11:23:10 +01:00
Jeremie Dimino 16d34f4a07 Add Which_program to know whether we are dune or jbuilder
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-28 11:23:10 +01:00
Jérémie Dimino 9585c8f79d
Move ocamldep output files to the object directory (#918)
- this avoid the need for the "already_used" business
- this will make it easier to support multi-dir libraries without copy_files

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-28 09:46:20 +01:00
Rudi Grinberg ec14661a01 Update tests for new variables syntax
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-28 09:48:35 +06:30
Rudi Grinberg 2257a2057b Add templates to Usexp.t directly
Templates are now directly in dune's sexp language. The syntax is change to %{}
from ${} and $(). Old templates are still supported in jbuild files.

Other changes in this PR:

* Removal of ! patterns in variables
* Strict expansion for templates in dune files. Missing vars are now an error
* Using the correct syntax to parse included files in dune
* Improvements to the tests
* Syntax aware pretty printing of sexps. Now you must pass Dune vs. Jbuild to
  print sexps

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-28 09:46:10 +06:30
Jérémie Dimino 0f68e56f64
Remove most useless parentheses from the syntax (#915) 2018-06-27 16:38:05 +01:00
Jérémie Dimino 90cdae96b2
Add a script to help making bulk updates of the tests (#914)
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-27 12:21:41 +01:00
Jeremie Dimino f46a6aae53 Make (diff ...) work on Windows
- make (diff ...) trailing cr on Win32
- add a (cmp ...) action for comparing binary files
- add a test and run it in AppVeyor

Fix #844

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-25 08:14:27 +01:00
Jérémie Dimino 0eb302252e
Improve the syntax of ppx rewriters and flags (#910)
- old syntax: (pps (ppx1 -arg1 ppx2 (-foo x)))
- new syntax: (pps ppx1 -arg ppx2 -- -foo x)

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-25 07:56:35 +01:00
Jeremie Dimino 58997d9df7 Present menhir as an extension
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-20 16:06:38 +01:00
Rudi Grinberg d7ab3d962c Harmonize names in dune and jbuild lexers
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-20 19:50:50 +06:30
Rudi Grinberg 53d9c64468 Print atom using atom constructor
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-20 18:23:23 +06:30
Rudi Grinberg 7d2c7d9579 Parameterize sexp_tests on dune and jbuild syntax
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-20 18:23:23 +06:30
Rudi Grinberg 99fbac26ab Remove constructor side validation
And make the tests reflect back Invalid_argument

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-20 18:23:23 +06:30
Rudi Grinberg ad3a95655d Dune & Jbuild validation for atoms
Atoms can now be constructed and pretty printed with a syntax = Jbuild | Dune.
The syntax controls validation that will be used to make sure we are printing
something/reading valid

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-20 18:23:23 +06:30
Jérémie Dimino 94c921f9c4
Rename files_recursively_in to source_tree (#899)
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-20 10:45:54 +01:00
Jeremie Dimino 41f4b89f85 Added tests for syntax versioning
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-19 16:26:27 +01:00
Jeremie Dimino 0c6edde131 Add a user context to Of_sexp.t
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-19 16:26:00 +01:00
Jeremie Dimino 30d20d6143 Use a single S-expression parser monad
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-19 11:29:27 +01:00
Rudi Grinberg 065e2bb26f Make Sexp.Of_sexp.t abstract
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-19 11:29:27 +01:00
Rudi Grinberg ec8860d0be Add more tests with regards to escaping
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-19 01:00:50 +07:00
Rudi Grinberg a9142840fd Add tests for % and $ chars in atoms
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-17 12:49:08 +07:00
Etienne Millon 96b01c569c Add link_deps field
In some cases, the linking step requires some dependencies. For example,
passing a version script to the linker. The new `(link_deps)` field
uses the dependency DSL already used in other places.

Closes #852

Signed-off-by: Etienne Millon <etienne@cryptosense.com>
2018-06-13 14:38:47 +02:00
Jeremie Dimino 5d6e919f04 Turn warning about modules being used multiple times into errors
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-13 11:51:41 +01:00