[PATCH] D156436: [llvm/OptTable] Print options without documentation

Jan Ole Hüser via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 28 07:21:48 PDT 2023


j0le added a comment.

Now that the Flang tests are fixed, I can think about how to write the unit tests.

Should we add a little executable, that uses the Option support library and has all sorts of options (hidden, aliases, long, short, ...)? The output of that executable can then be checked by FileCheck. Or should we use gtest.h? (I guess that's Google Test.)

I see there is already `llvm/unittests/Option/Opts.td`. Maybe that can be reused.

I believe checking with FileCheck is the easiest.



================
Comment at: flang/test/Driver/driver-help-hidden.f90:102
+! CHECK-NEXT: -x <language>           Treat subsequent input files as having type <language>
+! CHECK-EMPTY:
 
----------------
How do check for the end of file (EOF) with FileCheck? I didn't find anything better that `CHECK-EMPTY` in https://www.llvm.org/docs/CommandGuide/FileCheck.html . Maybe we should use a special regex.

The reason, why we should check for EOF is, that we don't want to miss new options that start with a letter at the end of the alphabet.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156436/new/

https://reviews.llvm.org/D156436



More information about the llvm-commits mailing list