[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 06/10] iotests: add testfinder.py
From: |
Kevin Wolf |
Subject: |
Re: [PATCH v3 06/10] iotests: add testfinder.py |
Date: |
Wed, 22 Apr 2020 15:06:59 +0200 |
Am 22.04.2020 um 14:49 hat Vladimir Sementsov-Ogievskiy geschrieben:
> 22.04.2020 14:53, Kevin Wolf wrote:
> > Am 22.04.2020 um 07:35 hat Vladimir Sementsov-Ogievskiy geschrieben:
> > > 21.04.2020 19:56, Kevin Wolf wrote:
> > > > Am 21.04.2020 um 09:35 hat Vladimir Sementsov-Ogievskiy geschrieben:
> > > > > +if __name__ == '__main__':
> > > > > + if len(sys.argv) == 2 and sys.argv[1] in ['-h', '--help']:
> > > > > + TestFinder.argparser.print_help()
> > > > > + exit()
> > > > > +
> > > > > + tests, remaining_argv = find_tests(sys.argv[1:])
> > > > > + print('\n'.join(tests))
> > > > > + if remaining_argv:
> > > > > + print('\nUnhandled options: ', remaining_argv)
> > > >
> > > > I think unhandled options shouldn't be considered an error and we
> > > > shouldn't even try to find and display any tests then. I'd either print
> > > > the help text or have an error message that refers to --help.
> > >
> > > As I considered running this script as executable for testing purposes,
> > > it's
> > > good to know, which options are not handled..
> >
> > Yes, that makes sense. I just think it should be an error and not just
> > an additional hint at the end.
> >
>
> It's not and error, as usual case will leave some arguments for
> TestEnv and TestRunner. Assume you run ./check with some arguments..
>
> And it works bad. You assume that problem is in testfinder.py. Then,
> you just take the entire list of options and call ./testfinder.py with
> them. And it shows, how it parses its arguments, and what is reminded.
> Seems correct and shouldn't be an error.
Hm, I didn't consider this use case. Fair enough then.
> Still, maybe better to print unhandled options first, to be more
> noticeable.
Actually, I think it's more noticeable at the end when you execute the
script standalone, especially when it prints a long list.
Kevin
- [PATCH v3 02/10] iotests: fix some whitespaces in test output files, (continued)
[PATCH v3 08/10] iotests: add testrunner.py, Vladimir Sementsov-Ogievskiy, 2020/04/21
[PATCH v3 07/10] iotests: add testenv.py, Vladimir Sementsov-Ogievskiy, 2020/04/21
[PATCH v3 03/10] iotests/283: make executable, Vladimir Sementsov-Ogievskiy, 2020/04/21
[PATCH v3 09/10] iotests: rewrite check into python, Vladimir Sementsov-Ogievskiy, 2020/04/21
[PATCH v3 05/10] iotests: define group in each iotest, Vladimir Sementsov-Ogievskiy, 2020/04/21