diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2011-05-23 17:31:11 +0100 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2011-05-23 17:31:11 +0100 |
commit | 2767e913ac7949dcfae06c367bd5560de988bc1c (patch) | |
tree | 4c2af06593c96d894da077ed55057539d5624574 | |
parent | f40bf230953d754577437143a919012d160f91c8 (diff) |
Make bare `tt` equivalent to `make check`
This helps prevent mishaps where people run the twisted tests but skip,
for example, the coding style checks.
-rwxr-xr-x | tt.hs | 24 |
1 files changed, 13 insertions, 11 deletions
@@ -96,20 +96,22 @@ rep :: Repetitions -> IO () -> IO () rep Forever = forever rep (Times n) = replicateM_ n -runTests :: FilePath -> String -> Bool -> [String] -> [Flag] -> Repetitions - -> IO () -runTests testDir testVar inTree tests flags reps = do +makeArgs :: [String] -> [Flag] -> FilePath -> String -> Bool -> IO [String] +makeArgs [] [] _ _ _ = return ["check"] +makeArgs tests flags testDir testVar inTree = do let buildPaths = expand testDir inTree . unprefix testDir tests' <- concat <$> mapM buildPaths tests - let t = case tests' of - [] -> [] - _ -> [ testVar ++ "=" ++ (intercalate " " tests') - -- This is because Mission Control is crap and has - -- two different sets of tests. - , "TWISTED_SEPARATE_TESTS=" - ] - args = [ "check-twisted", "-s", "-C", testDir ] ++ t ++ flags + let t = [ testVar ++ "=" ++ (intercalate " " tests') + -- This is because Mission Control is crap and has + -- two different sets of tests. + , "TWISTED_SEPARATE_TESTS=" + ] + return $ [ "check-twisted", "-s", "-C", testDir ] ++ t ++ flags +runTests :: FilePath -> String -> Bool -> [String] -> [Flag] -> Repetitions + -> IO () +runTests testDir testVar inTree tests flags reps = do + args <- makeArgs tests flags testDir testVar inTree rep reps $ invokeMake args unprefix :: FilePath -> String -> String |