Skip to content

Test suite improvement #95

Open
Open
@liyishuai

Description

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:
    - name: Test dependants
    if: >
    (matrix.ocaml-version >= '4.05') && (matrix.os != 'windows-latest')
    run: |
    PACKAGES=`opam list -s --color=never --installable --depends-on cppo,cppo_ocamlbuild`
    echo "Dependants:" $PACKAGES
    for PACKAGE in $PACKAGES
    do
    echo $SKIP_BUILD | tr ' ' '\n' | grep ^$PACKAGE$ > /dev/null &&
    echo Skip $PACKAGE && continue
    OPAMWITHTEST=true
    echo $SKIP_TEST | tr ' ' '\n' | grep ^$PACKAGE$ > /dev/null &&
    OPAMWITHTEST=false
    ([ $OPAMWITHTEST == false ] &&
    echo ::group::Build $PACKAGE) ||
    echo ::group::Build and test $PACKAGE
    DEPS_FAILED=false
    (opam depext $PACKAGE &&
    opam install --deps-only $PACKAGE) || DEPS_FAILED=true
    [ $DEPS_FAILED == false ] && opam install $PACKAGE
    echo ::endgroup::
    [ $DEPS_FAILED == false ] || echo Dependencies broken
    done
    • 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).

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions