@@ -19,12 +19,12 @@ import Data.Version
20import Language.PureScript.Docs
20import Language.PureScript.Docs
21import Language.PureScript.Publish
21import Language.PureScript.Publish
22+import Language.PureScript.Publish.ErrorsWarnings as Publish
23import TestUtils
24import TestUtils
25main :: IO ()
26main :: IO ()
27− testPackage "tests/support/prelude"
27+main = testPackage "tests/support/prelude"
29data TestResult
29data TestResult
30 = ParseFailed String
30 = ParseFailed String
@@ -53,10 +53,11 @@ testRunOptions = defaultPublishOptions
53-- | Given a directory which contains a package, produce JSON from it, and then
53-- | Given a directory which contains a package, produce JSON from it, and then
54-- | attempt to parse it again, and ensure that it doesn't change.
54-- | attempt to parse it again, and ensure that it doesn't change.
55testPackage :: String -> IO ()
55testPackage :: String -> IO ()
56−testPackage dir = do
56+testPackage dir = pushd dir $ do
58− r <- roundTrip <$> preparePackage testRunOptions
57+ res <- preparePackage testRunOptions
59− case r of
58+ case res of
59+ Left e -> preparePackageError e
60+ Right package -> case roundTrip package of
60 Pass _ -> do
61 Pass _ -> do
61 putStrLn ("psc-publish test passed for: " ++ dir)
62 putStrLn ("psc-publish test passed for: " ++ dir)
@@ -64,3 +65,14 @@ testPackage dir = do
64 putStrLn ("psc-publish tests failed on " ++ dir ++ ":")
65 putStrLn ("psc-publish tests failed on " ++ dir ++ ":")
65 print other
66 print other
66 exitFailure
67 exitFailure
69+ preparePackageError e@(UserError BowerJSONNotFound) = do
70+ Publish.printErrorToStdout e
72+ putStrLn "=========================================="
73+ putStrLn "Did you forget to update the submodules?"
74+ putStrLn "$ git submodule sync; git submodule update"
75+ putStrLn "=========================================="
78+ preparePackageError e = Publish.printErrorToStdout e >> exitFailure