diff options
author | Daniel Gröber <dxld@darkboxed.org> | 2013-12-26 00:27:13 +0000 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2014-01-04 21:39:28 +0400 |
commit | bc732f562d82fcfacfff277c0e5c39c742eb2920 (patch) | |
tree | d19399f652751c7802141d7825d8f9da009a1c0e /tests/Main.hs | |
parent | 2471173e557f930a872606cdbf21f4f6df74d53e (diff) |
Run bittorrent-client in res/ so it can seed the testfile
Diffstat (limited to 'tests/Main.hs')
-rw-r--r-- | tests/Main.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/Main.hs b/tests/Main.hs index 66283339..32ee3992 100644 --- a/tests/Main.hs +++ b/tests/Main.hs | |||
@@ -4,6 +4,7 @@ import Spec | |||
4 | import System.Exit | 4 | import System.Exit |
5 | import System.Environment | 5 | import System.Environment |
6 | import System.Process | 6 | import System.Process |
7 | import System.Directory | ||
7 | import Control.Exception | 8 | import Control.Exception |
8 | import Data.List | 9 | import Data.List |
9 | import Data.Maybe | 10 | import Data.Maybe |
@@ -11,7 +12,7 @@ import Data.Functor | |||
11 | 12 | ||
12 | clients :: [(String, String)] | 13 | clients :: [(String, String)] |
13 | clients = [ | 14 | clients = [ |
14 | ("rtorrent","rtorrent -p 51234-51234 res/testfile.torrent") ] | 15 | ("rtorrent","rtorrent -p 51234-51234 testfile.torrent") ] |
15 | 16 | ||
16 | main :: IO () | 17 | main :: IO () |
17 | main = do | 18 | main = do |
@@ -24,7 +25,9 @@ main = do | |||
24 | return cmd | 25 | return cmd |
25 | case cmd' of | 26 | case cmd' of |
26 | Just cmd -> do _ <- system "screen -S bittorrent-testsuite -X quit" | 27 | Just cmd -> do _ <- system "screen -S bittorrent-testsuite -X quit" |
27 | createProcess (shell cmd) >> return () | 28 | dir <- getCurrentDirectory |
29 | _ <- createProcess (shell cmd) { cwd = Just (dir ++ "/res") } | ||
30 | return () | ||
28 | Nothing -> return () | 31 | Nothing -> return () |
29 | 32 | ||
30 | let args' = (filter (not . isPrefixOf "--bittorrent-client=") args) | 33 | let args' = (filter (not . isPrefixOf "--bittorrent-client=") args) |