Commit 60a369a3 authored by simonmar's avatar simonmar
Browse files

[project @ 2001-08-16 13:30:06 by simonmar]

--tool is no longer a formal option: you can get the same effect by
just saying tool=<tool> on the command line.  This means it can also
be set in a config file instead.
parent 16e9c498
...@@ -67,15 +67,12 @@ scrub (c:cs) = c : scrub cs ...@@ -67,15 +67,12 @@ scrub (c:cs) = c : scrub cs
data Opt data Opt
= OptTool String = OptConfig String
| OptConfig String
| OptRootDir String | OptRootDir String
| OptSaveSummary String | OptSaveSummary String
| OptCompareSummary String | OptCompareSummary String
option_descrs = [ option_descrs = [
Option "" ["tool"] (ReqArg OptTool "PATH")
"compiler to test",
Option "" ["config"] (ReqArg OptConfig "FILE") Option "" ["config"] (ReqArg OptConfig "FILE")
"config file", "config file",
Option "" ["rootdir"] (ReqArg OptRootDir "DIR") Option "" ["rootdir"] (ReqArg OptRootDir "DIR")
...@@ -94,7 +91,6 @@ extra_info ...@@ -94,7 +91,6 @@ extra_info
" command line:\n" ++ " command line:\n" ++
concatMap (\w -> " $" ++ w ++ "\n") special_var_names concatMap (\w -> " $" ++ w ++ "\n") special_var_names
getToolOpt os = exactlyOne "-tool" [ t | OptTool t <- os ]
getConfigOpt os = exactlyOne "-config" [ t | OptConfig t <- os ] getConfigOpt os = exactlyOne "-config" [ t | OptConfig t <- os ]
getRootOpt os = upToOne "-rootdir" [ t | OptRootDir t <- os ] getRootOpt os = upToOne "-rootdir" [ t | OptRootDir t <- os ]
getSaveSuOpt os = upToOne "-save-summary" [ t | OptSaveSummary t <- os ] getSaveSuOpt os = upToOne "-save-summary" [ t | OptSaveSummary t <- os ]
...@@ -113,7 +109,7 @@ main ...@@ -113,7 +109,7 @@ main
imain arg_str imain arg_str
= main_really (words arg_str) = main_really (words arg_str)
test test
= imain ("--tool=ghc --config=../config/msrc/cam-02-unx.T " = imain ("tool=ghc --config=../config/msrc/cam-02-unx.T "
++ "--rootdir=../tests/codeGen") ++ "--rootdir=../tests/codeGen")
main_really arg_ws0 main_really arg_ws0
...@@ -123,8 +119,7 @@ main_really arg_ws0 ...@@ -123,8 +119,7 @@ main_really arg_ws0
(_, _, errs) -> die (concat errs ++ usage) (_, _, errs) -> die (concat errs ++ usage)
got_args opts args start_time got_args opts args start_time
= do tool <- getToolOpt opts = do conf <- getConfigOpt opts
conf <- getConfigOpt opts
maybe_root <- getRootOpt opts maybe_root <- getRootOpt opts
maybe_save_su <- getSaveSuOpt opts maybe_save_su <- getSaveSuOpt opts
maybe_cmp_su <- getCompareSuOpt opts maybe_cmp_su <- getCompareSuOpt opts
...@@ -144,9 +139,8 @@ got_args opts args start_time ...@@ -144,9 +139,8 @@ got_args opts args start_time
(confdir, conffile) = splitPathname conf (confdir, conffile) = splitPathname conf
base_genv = [("tool", tool), base_genv = [("confdir", confdir),
("confdir", confdir), ("conffilename", conffile)] ++ cmd_binds
("conffilename", conffile)]
tests_to_run tests_to_run
= if null not_binds then Nothing{-all of them-} = if null not_binds then Nothing{-all of them-}
...@@ -383,8 +377,7 @@ getBinds args = f args [] [] ...@@ -383,8 +377,7 @@ getBinds args = f args [] []
-- These vars have special meanings and may not be set from the -- These vars have special meanings and may not be set from the
-- command line. -- command line.
special_var_names special_var_names
= ["testfilename", "testdir", "conffilename", "confdir", = ["testfilename", "testdir", "conffilename", "confdir", "testname"]
"tool", "testname"]
-- (eg) "foo/bar/xyzzy.ext" --> ("foo/bar", "xyzzy", "ext") -- (eg) "foo/bar/xyzzy.ext" --> ("foo/bar", "xyzzy", "ext")
--splitPathname3 full --splitPathname3 full
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment