You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying dune runtest in the following toy project fails because during test runner generation, qtest does not add open Mylibrary at the top of the ML test file, which would be needed because Mylibrary is wrapped.
~/projets/test_qtest$ ls -lRt .
.:
total 8
drwxr-xr-x 2 me me 4096 22 déc. 09:56 lib
-rw-r--r-- 1 me me 46 22 déc. 09:48 dune-project
./lib:
total 8
-rw-r--r-- 1 matt matt 92 22 déc. 09:56 dune
-rw-r--r-- 1 matt matt 42 22 déc. 09:55 a.ml
~/projets/test_qtest$ cat dune-project
(lang dune 2.9)
(package
(name mylibrary)
)
~/projets/test_qtest$ cat lib/dune
(library
(public_name mylibrary)
; (wrapped false)
(inline_tests
(backend qtest.lib)))
~/projets/test_qtest$ cat lib/a.ml
let add = (+)
(*$= add
(add 1 2) 3
*)
I had a look at qtest.2.11.2 inline_tests backend definition:
Still experimenting, I then edited /home/me/.opam/4.13.1/lib/qtest/dune-package, replacing %{library-name} with Mylibrary: now, dune runtest is working.
So… What would be the right incantation to use (if there is one?), in order to get the Capitalized library name? And to get this added only if the tested library is wrapped?
This discussion was converted from issue #5305 on July 16, 2022 18:59.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Trying
dune runtestin the following toy project fails because during test runner generation,qtestdoes not addopen Mylibraryat the top of the ML test file, which would be needed becauseMylibraryis wrapped.I had a look at
qtest.2.11.2inline_tests backend definition:As an experiment, I added
--preamble "open %{library-name}"in thegenerate_runneraction, and pinned this modifiedqtest.Then, my test failed again:
Still experimenting, I then edited
/home/me/.opam/4.13.1/lib/qtest/dune-package, replacing%{library-name}withMylibrary: now,dune runtestis working.So… What would be the right incantation to use (if there is one?), in order to get the Capitalized library name? And to get this added only if the tested library is wrapped?
Best regards
All reactions