cppo icon indicating copy to clipboard operation
cppo copied to clipboard

Test suite improvement

Open liyishuai opened this issue 1 year ago • 8 comments

As of v1.7.0, the test suite consists of two parts:

  1. https://github.com/ocaml-community/cppo/tree/master/test, where *.cppo is expected to produce *.ref.
    • Limitation: Code/feature coverage not yet measured.
  2. CI that tests downstream dependants: https://github.com/ocaml-community/cppo/blob/21f05862d6b800e72914d37a7cefa3269442baca/.github/workflows/build.yml#L176-L198
    • Limitation 1: Only checks compilation and package-specified test; might break the semantics of under-tested packages.
    • Limitation 2: Skipping build/test for packages, for various reasons: Some packages are out of maintenance; others are failing in specific OCaml*OS versions.

Possible directions:

  • [ ] For users: Document each feature with a test case.
  • [ ] For devs: Annotate each branch condition with a test case.
  • [ ] For CI: Refine the exclusion list from (package + OCamlVersion + OSVersion) to (package * OCamlVersion * OSVersion).

liyishuai avatar Sep 11 '24 01:09 liyishuai

Perhaps we could single out a few source files, in these packages, that use cppo in a heavy way (or in an interesting way, in some sense) and add these source files directly to our test suite. This would ensure that any change in the output of cppo, for these specific files, is detected.

fpottier avatar Sep 11 '24 06:09 fpottier

By the way, I notice that the files *.yml seem to mention several old OCaml versions, up to 4.07, but no newer version. Is this intended? Should we update these files so as to test cppo on 4.08-4.14 and 5.x?

fpottier avatar Dec 03 '24 08:12 fpottier

(I could also add a Makefile entry that runs make test in several local opam switches.)

fpottier avatar Dec 03 '24 08:12 fpottier

By the way, I notice that the files *.yml seem to mention several old OCaml versions, up to 4.07, but no newer version. Is this intended? Should we update these files so as to test cppo on 4.08-4.14 and 5.x?

Did you mean https://github.com/ocaml-community/cppo/blob/master/.github/workflows/build.yml ? The exclusions there are due to ocaml/setup-ocaml#828.

liyishuai avatar Dec 03 '24 18:12 liyishuai

No, I meant the files .travis.yml and appveyor.yml at the root of the cppo repository. (I must say that I don't know what these files are used for.)

fpottier avatar Dec 03 '24 21:12 fpottier

Those files are obsoleted since #79. Should be safe to remove.

liyishuai avatar Dec 04 '24 03:12 liyishuai

Thanks, I have removed these files. By the way (sorry if this is a bit off topic here), I see that many CI runs currently fail with make: dune: No such file or directory, but I have no idea why that is.

fpottier avatar Dec 04 '24 07:12 fpottier

Let's track it in #99

liyishuai avatar Dec 04 '24 07:12 liyishuai