From f93e2335aea6f20af143347defd07a214206c11d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Mon, 12 May 2025 20:29:49 +0200 Subject: Select tests from project configuration by name Changelog: Select tests from project configuration using only test name on command line without script path. --- src/Main.hs | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/Main.hs b/src/Main.hs index abc96ac..48f95df 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -123,15 +123,21 @@ main = do } args <- getArgs - (opts, ofiles) <- case getOpt Permute (options ++ hiddenOptions) args of + (opts, oselection) <- case getOpt Permute (options ++ hiddenOptions) args of (o, files, []) -> return (foldl (flip id) initOpts o, files) (_, _, errs) -> do hPutStrLn stderr $ concat errs <> "Try `erebos-tester --help' for more information." exitFailure + let ( ofiles, otests ) + | any (any isPathSeparator) oselection = ( oselection, [] ) + | otherwise = ( [], map T.pack oselection ) + when (optShowHelp opts) $ do let header = unlines - [ "Usage: erebos-tester [