Skip to content

Extend testsuite to allow for FileCheck assertions#221

Merged
nomeata merged 1 commit intomasterfrom
filecheck
Mar 7, 2019
Merged

Extend testsuite to allow for FileCheck assertions#221
nomeata merged 1 commit intomasterfrom
filecheck

Conversation

@nomeata
Copy link
Contributor

@nomeata nomeata commented Mar 7, 2019

FileCheck is a tool
created by the LLVM folks to embed textual assertions about the output
code in test cases. This comment sets up our test suite so that we can
put CHECK directives into the test files, and run.sh will use
FileCheck to see if the resulting .wat file matches the specs.

I am using this in one example to assert that the mutually recursive
functions in mutrec2.as are compiled to direct calls (and not
closures).

This requires you to have FileCheck in your PATH. The easiest way of
doing that is to run

nix-env -i -f . -A filecheck

[FileCheck](https://llvm.org/docs/CommandGuide/FileCheck.html) is a tool
created by the LLVM folks to embed textual assertions about the output
code in test cases. This comment sets up our test suite so that we can
put `CHECK` directives into the test files, and `run.sh` will use
`FileCheck` to see if the resulting `.wat` file matchs the specs.

I am using this in one example to assert that the mutually recursive
functions in `mutrec2.as` are compiled to direct calls (and not
closures).

This requires you to have `FileCheck` in your PATH. The easiest way of
doing that is to run

    nix-env -i -f . -A filecheck
@nomeata nomeata requested a review from ggreif March 7, 2019 16:36
Copy link
Contributor

@ggreif ggreif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is cool. I can certainly use it for my codegen work.

@nomeata nomeata merged commit c958f91 into master Mar 7, 2019
@nomeata nomeata deleted the filecheck branch March 7, 2019 22:19
dfinity-bot added a commit that referenced this pull request Apr 21, 2021
mergify bot pushed a commit that referenced this pull request Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants