on master help sign in
Incluse test data in cabal
8183784iko
compaREST.cabal+4
@@ -14,6 +14,9 @@ extra-doc-files: README.md
14 CHANGELOG.md
14 CHANGELOG.md
15tested-with: GHC == 8.10.4
15tested-with: GHC == 8.10.4
16extra-source-files: awsm-css/dist/awsm.min.css
16extra-source-files: awsm-css/dist/awsm.min.css
17+data-files:
18+ test/golden/**/*.yaml
19+ test/golden/**/*.md
17
20
18common common-options
21common common-options
19 ghc-options:
22 ghc-options:
@@ -203,6 +206,7 @@ test-suite compaREST-tests
203 other-modules:
206 other-modules:
204 Spec.Golden.Extra
207 Spec.Golden.Extra
205 Spec.Golden.TraceTree
208 Spec.Golden.TraceTree
209+ Paths_compaREST
206 build-depends:
210 build-depends:
207 , compaREST
211 , compaREST
208 , tasty-golden
212 , tasty-golden
test/Spec/Golden/TraceTree.hs+5−3
@@ -1,5 +1,5 @@
1module Spec.Golden.TraceTree
1module Spec.Golden.TraceTree
2− ( tests,
2+ ( tests
3 )
3 )
4where
4where
5
5
@@ -12,6 +12,7 @@ import Data.OpenApi.Compare.Validate.OpenApi ()
12import Data.Text (Text)
12import Data.Text (Text)
13import qualified Data.Text.Encoding as T
13import qualified Data.Text.Encoding as T
14import qualified Data.Yaml as Yaml
14import qualified Data.Yaml as Yaml
15+import Paths_compaREST
15import Spec.Golden.Extra
16import Spec.Golden.Extra
16import Test.Tasty (TestTree, testGroup)
17import Test.Tasty (TestTree, testGroup)
17import Text.Pandoc.Builder
18import Text.Pandoc.Builder
@@ -22,10 +23,11 @@ import Prelude hiding (id, (.))
22
23
23tests :: IO TestTree
24tests :: IO TestTree
24tests = do
25tests = do
26+ dir <- getDataDir
25 traceTreeTests <-
27 traceTreeTests <-
26 goldenInputsTreeUniform
28 goldenInputsTreeUniform
27 "TraceTree"
29 "TraceTree"
28− "test/golden/common"
30+ dir
29 "trace-tree.yaml"
31 "trace-tree.yaml"
30 ("a.yaml", "b.yaml")
32 ("a.yaml", "b.yaml")
31 Yaml.decodeFileThrow
33 Yaml.decodeFileThrow
@@ -34,7 +36,7 @@ tests = do
34 reportTests <-
36 reportTests <-
35 goldenInputsTreeUniform
37 goldenInputsTreeUniform
36 "Report"
38 "Report"
37− "test/golden/common"
39+ dir
38 "report.md"
40 "report.md"
39 ("a.yaml", "b.yaml")
41 ("a.yaml", "b.yaml")
40 Yaml.decodeFileThrow
42 Yaml.decodeFileThrow