modular icon indicating copy to clipboard operation
modular copied to clipboard

[BUG] inconsistent FileCheck check-prefix usage

Open VMois opened this issue 1 year ago • 3 comments

Bug description

This line has a single -: https://github.com/modularml/mojo/blob/6d2a7b552769358ec68a94b8fd1f6c2126d59ad9/stdlib/test/builtin/test_debug_assert.mojo#L17

This line has two --: https://github.com/modularml/mojo/blob/6d2a7b552769358ec68a94b8fd1f6c2126d59ad9/stdlib/test/sys/test_paramenv.mojo#L14

Official FileCheck docs use -- https://llvm.org/docs/CommandGuide/FileCheck.html. The Python version I am using uses two as well - https://filecheck.readthedocs.io/en/stable/01-what-is-filecheck.html

Steps to reproduce

Try to run-tests.sh. Install lit and FileCheck using pip.

System information

- What OS did you do install Mojo on ? macOS Monterey 12.6 Apple M1
- Provide version information for Mojo by pasting the output of `mojo -v` mojo 24.2.0 (c2427bc5)
- Provide Modular CLI version by pasting the output of `modular -v` modular 0.6.0 (04c05243)

VMois avatar Mar 29 '24 01:03 VMois

I think those two files:

  • stdlib/test/builtin/test_debug_assert.mojo
  • stdlib/test/builtin/test_debug_assert_warning.mojo

Should use -- (double)

VMois avatar Mar 29 '24 01:03 VMois

I don't know if this is a bug since FileCheck permits both uses as far as I know (both single and double dash). Internally, I see a mix of both in other (non-standard-library) code. I'd welcome a PR to use -- consistently in the standard library code though if you're up for it.

JoeLoser avatar Apr 01 '24 17:04 JoeLoser

I forgot to mention (sorry about that) in the issue that tests failed for me where "-" (single) was present. It might be because I used the Python package FileCheck instead of the original tool.

VMois avatar Apr 02 '24 02:04 VMois