Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testsuite Reorganisation #330

Open
1 of 4 tasks
zilinc opened this issue Dec 19, 2019 · 1 comment
Open
1 of 4 tasks

Testsuite Reorganisation #330

zilinc opened this issue Dec 19, 2019 · 1 comment
Labels
TASK An umbrella ticket. Mostly used in the kanban board.

Comments

@zilinc
Copy link

zilinc commented Dec 19, 2019

Description

Currently in the Cogent testsuite (https://github.com/NICTA/cogent/tree/master/cogent/tests), we only have two categories of test files, named pass_* and fail_*, which are tests which should pass or fail respectively. However Cogent has many phases, and many different configurations, and for any individual test case, we want to have finer-grained specification, indicating in what context and at which stage of compilation it should fail or pass.

This requires a way to specify a testing matrix, detailing the aforementioned information. The test driver should be itself easy to setup (for that reason I prefer some lightweight scripting language instead of a dependency-heavy language, e.g. Haskell). It's currently a shell script (https://github.com/NICTA/cogent/blob/master/cogent/scripts/cogent_validate.sh) invoked by a top-level Makefile (https://github.com/NICTA/cogent/blob/master/cogent/Makefile).

Progress

The new testing script has been merged to master and is in cogent/tests. See the README file for instructions on how to use it. #350 records the new feature requests.

TODOs

  • Include all test files in cogent/tests/tests in the new test system.
  • Reorganise the test files. Rename them properly to reflect the features get tested.
  • Also include antiquoted c tests, and those which require customised commands.
  • Include Isabelle tests.
@zilinc zilinc added the TASK An umbrella ticket. Mostly used in the kanban board. label Dec 19, 2019
@cmcl
Copy link
Collaborator

cmcl commented Dec 23, 2019

I implemented a small test harness for the Frank programming language using Python. The framework supports a minimal set of directives which occur within comments of a test file. The intention of my framework was to support the aforementioned pass/fail files as well as specify files tied to compiler regressions, e.g. a file rX.cogent would correspond to issue #X on the Github tracker. A summary would split the results of testing into a number of categories: (un)expected passes/fails, and failed regressions.

I have described the main ideas in a document:

https://github.com/frank-lang/frank/blob/master/TestingIdeas

and the code is available here:

https://github.com/frank-lang/frank/blob/master/testharness.py

The small language of directives would need to be extended to support testing different compiler phases as currently it only compares the final return value against the expected output. However, the harness is not specific to Frank and I believe could be used as the basis of a more rigorous testing framework for the Cogent compiler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TASK An umbrella ticket. Mostly used in the kanban board.
Projects
None yet
Development

No branches or pull requests

3 participants