Failed 6 times to create symlink, and a dangling latest link (#479, @samoht, fixes #471 and #472 in 1.10.0)EACCES on a read-only source tree or with DUNE_BUILD_DIR (#480, @samoht, fixes #471 in 1.10.0)ALCOTEST_SOURCE_CODE_POSITION when set by the program before run (#481, @samoht, fixes #451 in 1.10.0)check in a helper at the check, as in 1.9.1, not at the test that calls the helper (#488, @samoht, fixes #451 in 1.10.0)--junit or ALCOTEST_JUNIT=1, write a JUnit XML report of each run to junit/<name>-<time>-<id>.xml of the log directory, with the file and line of each test, or of its failure (#449, #476, fixes #130, @samoht, report by @pbiggar)run, and write it as the file of the <testsuite> of the JUnit report (#449, @samoht)Platform.S now requires timestamp and write_file (#449, @samoht)_build/_tests of the workspace, where dune does not delete it, rather than in _build/default. With #472, each dune test adds its runs to _build/_tests/run/<name>/<time>-<id>, which gives a local history of test results (#471, @samoht)alcotest-mirage, which failed with Assertion failed in every run without --verbose since 1.5.0 (#473, @samoht)run/<name>/<time>-<id>, where <name> is the name given to run, so that the runs of each test executable are listed in order. latest still points to the last run (#472, @samoht)run/<name> folder (#472, @samoht)suite or group is longer than a file name can be (#472, @samoht)suite or group starts with a dot (#472, @samoht)prepare_log_trap takes the name given to run and returns the folder of the run (#472, @samoht)/ on Windows, as in -o a/b, which failed with ENOENT (#470, @samoht)test ?tags name f and suite name cases, to write suite "a" [ test "b" f ] instead of ("a", [ test_case "b" Quick f ]). tagsdefaults to ``Always `` (#468, @samoht, combinators suggested by @yawaramin in #393)?tags to group: its cases only run when these tags hold as well as their own (#468, @samoht, API from #294 by @craigfe)group name cases, a test_case that nests cases to any depth. They run in place, are reported as parent.name and are selected with test '^parent\.name' (#453, fixes #275, @samoht, API from #294 by @craigfe, dotted names suggested by @mjambon)check. A failure in a helper points to the line of the test that calls it. ALCOTEST_SOURCE_CODE_POSITION still turns this off (#451, @samoht, based on B0_testing by @dbuenzli and the b0 programmers)ASSERT now only shows the checks that passed (#465, @samoht)alcotest-js package, which had no code and only added dependencies. To test with js_of_ocaml, depend on js_of_ocaml-compiler directly (#463, @samoht)uutf with the stdlib UTF-8 decoder. Test names with invalid UTF-8 can get a different log file name (#456, @samoht)string failures, when the output supports it (#456, fixes #408, @samoht, report by @feverdreme, suggestion by @lindig)iarray, a testable for Iarray.t, available from OCaml 5.4 (#455, fixes #434, @samoht, report by @JanBeh)Fmt.if_utf_8 printers always took the non-UTF-8 branch. LC_ALL now overrides LC_CTYPE and LANG, as in POSIX, and UTF8 also counts (#457, @samoht)Alcotest.skip and failed checks in alcotest-async tests: Async wrapped the exceptions, so a skip counted as a failure (#278, @vbmithr)alcotest-async unavailable on Windows, so that ocaml-ci tests the other packages there (#454, @samoht, suggested by @mtelvers)uchar, a testable for Uchar.t (#435, @emengd, review by @dinosaure)success count in --json output, which included failures (#432, fixes #431, @1zumiSagiri, review by @MisterDA)test_case and test tuples accept `Tag, `And, `Or, `Not and `Always, also as Tag combinators, which hold in a context set by a new --tags option or ALCOTEST_TAGS, as with Go build tags. A new tags subcommand lists them. speed_level is now an alias of the new tag type, which breaks code matching on it exhaustively or restating it as [ `Quick | `Slow ]. A term passed to run_with_args that defines --tags, or --junit from #449, fails at startup (#448, fixes #124, #151 and #316, @samoht, report by @hannesm and @arvidj)mkdir_p turned /foo into //foo, which fails with EROFS on Cygwin (#405, fixes #404, @bbonf, review by @MisterDA and @samoht)and_exit and record_backtrace in the test subcommand (#439, fixes #438, @edwintorok)Unix.stdout and Unix.stderr valid during tests on Windows (#444, fixes #443, @ngorogiannis)alcotest-async exception handling (#279, @craigfe)alcotest-async example (#458, #421, @dannywillems)cmdliner to be compatible with cmdliner.2.0.0 (@MisterDA, #424)seq, a testable for Seq.t and contramap (#412 @xvw)V1.Skip exception (#415, #416, @Khady)match_raises now expects the user-defined function to return true for expected exceptions. Previously false was interpreted as an expected exception. (#418, #419, @psafont)match_raises, a generalized version of check_raises (#88, #386, @JoanThibault)ALCOTEST_COLUMNS env var. (#322, #381, @MisterDA)CI env var to detect CIs. Improve CI detection. (#397, @MisterDA)alcotest_stubs.c to compile with MSVC (#369, @jonahbeckford, review by @TheLortex and @MisterDA)dune >= 3.0. (#360, @MisterDA)async>=v0.15.0 (#352, @crackcomm)js_of_ocaml.3.11.0. Users can depend on the new virtual alcotest-js Opam library to pick up the right js_of_ocaml version automatically. (#326 #328, @hhugo @smorimoto)~record_backtrace:false to Alcotest.run. (#317, @CraigFe)Alcotest.{char,string} pretty-printers to use OCaml syntax on assertion failures (i.e. wrap with quotes and escape control characters). (#318, @CraigFe)test alpha 1-4), as advertised in the manpage. The previously-used '..' separator is also supported. (#312, @CraigFe)Alcotest.V1 module that aliases the existing Alcotest API and provides a stability guarantee over major version changes. Similar versioned aliases also exist for the backends: Alcotest_{async,lwt}.V1. (#306, @CraigFe)~filter argument to Alcotest.run to be a predicate over tests. (#305, @CraigFe)Renamed / removed some less frequently used modules used by the test backends:
Alcotest.Unix -> Alcotest.Unix_platformAlcotest_engine.{Cli,Core,Test} -> Alcotest_engine.V1.{Cli,Core,Test}Alcotest.{Cli,Core} are now gone. Use Alcotest_engine.V1.{Cli,Core}.Make (Alcotest.Unix_platform) instead. (#306 #309, @CraigFe)list_tests in the main test APIs (Alcotest{,_lwt,_async}). Use Alcotest_engine directly if you want this function. (#310, @CraigFe)?here and ?pos arguments to the test assertion functions. These can be used to pass information about the location of the call-site, which is displayed in failing test output. (#291, @CraigFe)Alcotest.check and related functions. This allows them to be used outside of an Alcotest test runner for making general assertions. (#296, @CraigFe)--bail option (and corresponding ALCOTEST_BAIL environment variable), which causes Alcotest to terminate after the first test failure. (#298, @CraigFe)Alcotest.triple for testing 3-tuples. (#288, @sheepduke)~and_exit:false option when the test suite fails. (#271, @CraigFe)fmt.0.8.8+dune by adding a missing fmt dependency in alcotest's dune file (#266, @NathanReb). characters to appear unescaped in symlinks and test directories. (#259, @CraigFe)alcotest-mirage package, allowing the construction of MirageOS unikernels that run Alcotest test suites. (#238, @hannesm @linse)Alcotest.check', a variant of Alcotest.check with labeled arguments. (#239, @hartmut27)bytes type. (#253, @mefyl)--color=always when running inside Dune (#242, @CraigFe). The value can be overridden by setting the ALCOTEST_COLOR variable in a dune file, for example:(env
(_
(env-vars
(ALCOTEST_COLOR auto))))Alcotest_{async,lwt}.run. (#222, @CraigFe)ALCOTEST_COLOR={auto,always,never} environment variable to control the colorization of terminal output. (#209, @mjambon)Alcotest_{async,lwt}. (#212, @CraigFe @talex5)Alcotest_{async,lwt}.test_case to return monadic values. These must be run with the new Alcotest_{async,lwt}.run functions. See examples/lwt/test.ml for an example of the new API. (#167, @CraigFe)latest symlinks in the _test directory which point to the most recent test output directory. (#155, @cfcs)Alcotest.{run,run_with_args} without use of the argv parameter. (#182, @CraigFe)--compact option for more concise result reporting. (#149, @andersfugmann)--tail-errors option for limiting the size of error logs printed to standard output. (#200, @mjambon)test subcommand. (#158, @CraigFe)float check to include equality of isNaN and infinities. See examples/floats.ml for demonstrations of the new semantics. (#152, @psafont)?argv parameter. (#164, @ian-barnes)tput. (#189, @samoht)Pervasives.compare. (#173, @CraigFe)Async support: there is a new alcotest-async package containing an Alcotest_async module (#104, @rgrinberg)failf (#105, @hcarty)float combinator to compare its epsilon using <= instead of <. This allows to use float 0. for "exact" float comparison (#107, @samoht, @talex5)--verbose. Be clearer that no new output logs are actually created and do not try to display outdated information (#108, @samoht)float combinator to take a mandatory 'epsilon' parameter (#89, @superbobry)test_case function (#94, @samoht)alcotest-lwt package, containing an Alcotet_lwt module with an Alcotest_lwt.test_case function to better deal with lwt tests (#94, @talex5, @samoht)Alcotest.neg to negate test results (#95, @samoht)test_case type from unit -> unit to 'a -> unit. The 'a parameter can be built using as a Cmdliner term using the new run_with_args function. This is useful to configure the tests using the CLI (#96, @samoht)_build/_tests by default (#77, @pqwy)unit testable (useful for functions with side-effects) (#79, @avsm)testable combinator to easily build 'a testable values (#75, @pqwy)pp and equal to extract the pretty-printer and equality functions from an 'a testable (#75, @pqwy)array testable (#75, @pqwy)topkg (#68, @samoht)Alcotest.reject to always fail tests (#64, @talex5)Alcotest.list (#53, #65, @talex5)argv optional argument to run to use custom command-line arguments (#63, @dinosaure)Astring for the unit tests (#62, @hannesm)Alcotest.pass a testable combinator which always pass (#50, @seliopou)index out of bounds for empty test doc string (#51, @dariusf)--color flag to tweak color usage on the command-line and use Fmt (#52, #55, @samoht)check_raises (#48, by @yallop)Alcotest.bool (#33, by @zjhmale)Alcotest.slist (#34, by @samoht)Alcotest.pair (#34, by @samoht)Pervasive.compare and a pretty-printing function: Alcotest.of_pp (#34, by @samoht)Alcotest.check (#27, by @edwintorok)run function multiple times is much more consistent.OUnit. Programs using OUnit and Alcotest should continue to work.TESTABLE signature and a check function to check invariants in the tested libraries.--show-errors using the ALCOTEST_SHOW_ERRORS env variable (#9)and_exit optional argument to Alcotest.run to control the exit behavior of the main test function (#4)--version--json argument to show the test results as a JSON object (#14, by @eowzukw)Alcotest.result to turn a test into a resultBytes module instead of String