[libc-commits] [PATCH] D105843: [libc] Add option to run specific tests

Caitlyn Cano via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Jul 13 11:31:00 PDT 2021


caitlyncano marked an inline comment as done.
caitlyncano added inline comments.


================
Comment at: libc/utils/UnitTest/LibcTest.cpp:146
 
-int Test::runTests() {
+int Test::runTests(int argc, char *argv[]) {
   int TestCount = 0;
----------------
sivachandra wrote:
> aeubanks wrote:
> > it's kinda weird to pass argc/argv directly to a function besides `main`. maybe just passing a `std::optional<std::string> Filter` is better
> I agree - we should move the `argv` parsing code to a separate helper function. It would be cleaner and also scale (we plan to add ability to run flaky tests with run count etc.) @aeubanks' suggestion to use `std::optional` for the argument is perfect.
So the goal is to make a separate function to generate a Filter string that may/may not exist depending on the argc/argv conditions? I've never used the std::optional template so this is taking me a bit longer than expected to write out, many apologies!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105843



More information about the libc-commits mailing list