Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lab3 runner: change option -t to -g #1

Open
andreasabel opened this issue Dec 17, 2024 · 0 comments
Open

Lab3 runner: change option -t to -g #1

andreasabel opened this issue Dec 17, 2024 · 0 comments
Assignees

Comments

@andreasabel
Copy link
Contributor

usage = do
hPutStrLn stderr "Usage: plt-test-lab3 [--debug] [--no-doubles] [--no-make] [-t|--test DIRECTORY]..."
hPutStrLn stderr " compiler_code_directory"
exitFailure
parseArgs :: [String] -> Maybe Options
parseArgs argv =
case getOpt RequireOrder optDescr argv of
(o,[progdir],[]) -> do
let options = foldr ($) defaultOptions o
let testSuite = replaceNull (testSuiteOption options) defaultTestSuite
return options{ testSuiteOption = testSuite, progDir = progdir }
(_,_,_) -> Nothing
where
optDescr :: [OptDescr (Options -> Options)]
optDescr = [ Option [] ["debug"] (NoArg enableDebug ) "print debug messages"
, Option [] ["doubles"] (NoArg enableDoubles ) "include double tests" -- default
, Option [] ["no-doubles"] (NoArg disableDoubles ) "exclude double tests"
, Option [] ["no-make"] (NoArg disableMake ) "do not run make"
, Option ['t'] ["test"] (ReqArg addTest "FILE") "good test case FILE" -- many
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants