-
Notifications
You must be signed in to change notification settings - Fork 7
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
Enhancement: floating point capture and tolerance. #190
Comments
The policy is very simple: there are very minor differences so far but the Python version is definitely ok to diverge further as long as the documentation clearly explains it. I was recently thinking of adding a I like both of your options but if I had to choose one, I would probably implement your full version. But having both implemented is certainly great to have too! |
We'd like to use FileCheck to check log files with floating point numbers (in scientific computing). Apparently neither the C++ filecheck nor the
FileCheck.py
knows about floating point numbers.Here I propose a capture based syntax for checking if floating points numbers are within a tolerance range:
inlined tolerance check:
Pass:
Fail:
The capture expression is extended with an extra ":" segment, where if the segment is
tolerance(val, atol, rtol)
then the captured string is converted to floating point and checked against val with the given tolerance Refer to numpy.allclose().full tolerance check:
A new CHECK-TOLERANCE check for captured variables, The right hand side of
=
can be several tolerance expressions joined byor
.Implementation:
I think it is relatively easy to add both or either form of floating point checks to FileCheck.py, but doing so will break the compatibility with LLVM filecheck. What is FileCheck.py's policy on this?
The text was updated successfully, but these errors were encountered: