diff options
author | Csaba Hruska <csaba.hruska@gmail.com> | 2016-02-13 14:20:06 +0100 |
---|---|---|
committer | Csaba Hruska <csaba.hruska@gmail.com> | 2016-02-13 14:20:19 +0100 |
commit | a8ece97efac68c03b3eb9c9e962b8a9b1d994519 (patch) | |
tree | c8f3354c86b6d448bf9c3ae143e6b819d7ba7772 /backendtest | |
parent | b7290dc2434daea24e848bc83a7e16d97945ce8f (diff) |
cabalize backend test server
Diffstat (limited to 'backendtest')
-rw-r--r-- | backendtest/EditorExamplesTest.hs | 4 | ||||
-rw-r--r-- | backendtest/TestServer.hs (renamed from backendtest/server.hs) | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/backendtest/EditorExamplesTest.hs b/backendtest/EditorExamplesTest.hs index 2fe861c2..742b3e59 100644 --- a/backendtest/EditorExamplesTest.hs +++ b/backendtest/EditorExamplesTest.hs | |||
@@ -74,7 +74,7 @@ scene wh = Scene | |||
74 | in mat4ToM44F $ mm .*. cm .*. pm | 74 | in mat4ToM44F $ mm .*. cm .*. pm |
75 | 75 | ||
76 | getRenderJob = do | 76 | getRenderJob = do |
77 | let path = "../testdata/editor-examples" | 77 | let path = "./testdata/editor-examples" |
78 | tests <- filter ((".lc" ==) . takeExtension) <$> getDirectoryContents path | 78 | tests <- filter ((".lc" ==) . takeExtension) <$> getDirectoryContents path |
79 | print tests | 79 | print tests |
80 | ppls <- forM tests $ \name -> do | 80 | ppls <- forM tests $ \name -> do |
@@ -86,7 +86,7 @@ getRenderJob = do | |||
86 | , pipeline = ppl | 86 | , pipeline = ppl |
87 | } | 87 | } |
88 | 88 | ||
89 | img <- unpack . B64.encode <$> BS.readFile "logo256x256.png" | 89 | img <- unpack . B64.encode <$> BS.readFile "./backendtest/logo256x256.png" |
90 | 90 | ||
91 | return $ RenderJob | 91 | return $ RenderJob |
92 | { meshes = V.fromList [cubeMesh] | 92 | { meshes = V.fromList [cubeMesh] |
diff --git a/backendtest/server.hs b/backendtest/TestServer.hs index c2d13555..58e49254 100644 --- a/backendtest/server.hs +++ b/backendtest/TestServer.hs | |||
@@ -53,7 +53,7 @@ application pending = do | |||
53 | Nothing -> putStrLn "invalid RenderJobResult" | 53 | Nothing -> putStrLn "invalid RenderJobResult" |
54 | Just (RenderJobError e) -> fail $ "render error:\n" ++ e -- TODO: test failed | 54 | Just (RenderJobError e) -> fail $ "render error:\n" ++ e -- TODO: test failed |
55 | Just (RenderJobResult FrameResult{..}) -> do | 55 | Just (RenderJobResult FrameResult{..}) -> do |
56 | let name = "out/output_ppl" ++ printf "%02d" pIdx ++ "_scn" ++ printf "%02d" sIdx ++ "_" ++ printf "%02d" fIdx ++ ".png" | 56 | let name = "backend-test-images/ppl" ++ printf "%02d" pIdx ++ "_scn" ++ printf "%02d" sIdx ++ "_" ++ printf "%02d" fIdx ++ ".png" |
57 | createDirectoryIfMissing True (takeDirectory name) | 57 | createDirectoryIfMissing True (takeDirectory name) |
58 | compareOrSaveImage name =<< toImage frImageWidth frImageHeight . either error id . B64.decode =<< WS.receiveData conn | 58 | compareOrSaveImage name =<< toImage frImageWidth frImageHeight . either error id . B64.decode =<< WS.receiveData conn |
59 | putStrLn $ name ++ "\t" ++ unwords (map showTime . V.toList $ frRenderTimes) | 59 | putStrLn $ name ++ "\t" ++ unwords (map showTime . V.toList $ frRenderTimes) |