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

Improve Test Runner #377

Merged
merged 4 commits into from
Jan 27, 2024
Merged

Improve Test Runner #377

merged 4 commits into from
Jan 27, 2024

Conversation

b-studios
Copy link
Collaborator

@b-studios b-studios commented Jan 27, 2024

This PR addresses #375 and supports the following formats:

Running tests in examples/neg depends on whether there is a check file or not:

  1. .check file exists: .effekt program will be compiled and run; output is compared against .check
  2. .check file does not exist: .effekt program will be compiled. The following checks will be performed
  • if no line has an error annotation, then it is checked whether an error exists at all.
  • for each line that ends in either // ERROR or // WARN a corresponding error or warning is searched for.

Additionally each // ERROR and // WARN comment can be followed by an excerpt of the error message that is expected.

module blocks_wrong_arguments
def foo { f : Int => Int } =
f(2)
def bar { f : (Int, Boolean) => Unit } =
f(2, true, 4) // ERROR Wrong number of value arguments
def main() = {
val r = foo { (x: Int, y: Boolean) =>
x + 1
};
println(r);
bar { (x: Int) =>
()
}
}

The trailing message will be searched verbatim in the error messages.

Additional errors that are not marked with a comment are currently ignored.

@b-studios
Copy link
Collaborator Author

@dvdvgt This might be helpful for you to test typer more easily.

@b-studios
Copy link
Collaborator Author

@jiribenes You mentioned the LLVM test runner. Is there anything you think would be super helpful in addition to what I implemented?

@b-studios
Copy link
Collaborator Author

Once the tests go through I will merge this since I already want to use it on another PR :)

@b-studios b-studios merged commit d7c7171 into master Jan 27, 2024
2 checks passed
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.

None yet

1 participant