@@ -37,43 +37,70 @@ import qualified Semantic.Stat.Spec
3737import Semantic.Config (defaultOptions , optionsLogLevel )
3838import Semantic.Task (withOptions , TaskSession (.. ))
3939import Test.Hspec
40+ import Test.Tasty as Tasty
41+ import Test.Tasty.Hspec as Tasty
42+ import Test.Tasty.Options as Tasty
43+
44+ tests :: TaskSession -> [TestTree ]
45+ tests session =
46+ [ Integration.Spec. spec session
47+ ]
48+
49+ -- We can't bring this out of the IO monad until we divest
50+ -- from hspec, since testSpec operates in IO.
51+ allTests :: TaskSession -> IO TestTree
52+ allTests session = do
53+ let nativeSpecs = tests session
54+ asTastySpecs <- Tasty. testSpecs $ legacySpecs session
55+ let allSpecs = nativeSpecs <> asTastySpecs
56+ pure . Tasty. localOption Tasty. Success $ testGroup " semantic" allSpecs
57+
58+ -- If you're writing new test modules, please don't add to this
59+ -- stanza: it is only there to prevent massive rewrites, and is
60+ -- converted into a Tasty TestTree in 'main'. (Quoth the tasty-hspec
61+ -- documentation: "hspec and tasty serve similar purposes; consider
62+ -- using one or the other.") Instead,
63+ legacySpecs :: TaskSession -> Spec
64+ legacySpecs args = do
65+ describe " Semantic.Stat" Semantic.Stat.Spec. spec
66+ parallel $ do
67+ describe " Analysis.Go" (Analysis.Go.Spec. spec args)
68+ describe " Analysis.PHP" (Analysis.PHP.Spec. spec args)
69+ describe " Analysis.Python" (Analysis.Python.Spec. spec args)
70+ describe " Analysis.Ruby" (Analysis.Ruby.Spec. spec args)
71+ describe " Analysis.TypeScript" (Analysis.TypeScript.Spec. spec args)
72+ describe " Assigning.Assignment" Assigning.Assignment.Spec. spec
73+ describe " Control.Abstract.Evaluator" Control.Abstract.Evaluator.Spec. spec
74+ describe " Data.Diff" Data.Diff.Spec. spec
75+ describe " Data.Graph" Data.Graph.Spec. spec
76+ describe " Data.Abstract.Path" Data.Abstract.Path.Spec. spec
77+ describe " Data.Abstract.Name" Data.Abstract.Name.Spec. spec
78+ describe " Data.Functor.Classes.Generic" Data.Functor.Classes.Generic.Spec. spec
79+ describe " Data.Range" Data.Range.Spec. spec
80+ describe " Data.Scientific" Data.Scientific.Spec. spec
81+ describe " Data.Semigroup.App" Data.Semigroup.App.Spec. spec
82+ describe " Data.Source" Data.Source.Spec. spec
83+ describe " Data.Term" Data.Term.Spec. spec
84+ describe " Diffing.Algorithm.RWS" Diffing.Algorithm.RWS.Spec. spec
85+ describe " Diffing.Algorithm.SES" Diffing.Algorithm.SES.Spec. spec
86+ describe " Diffing.Interpreter" Diffing.Interpreter.Spec. spec
87+ describe " Graphing.Calls" Graphing.Calls.Spec. spec
88+ describe " Numeric" Numeric.Spec. spec
89+ describe " Rendering.TOC" Rendering.TOC.Spec. spec
90+ describe " Reprinting.Spec" Reprinting.Spec. spec
91+ describe " Rewriting.Go" Rewriting.Go.Spec. spec
92+ describe " Rewriting.JSON" Rewriting.JSON.Spec. spec
93+ describe " Rewriting.Python" Rewriting.Python.Spec. spec
94+ describe " Tags.Spec" Tags.Spec. spec
95+ describe " Semantic" Semantic.Spec. spec
96+ describe " Semantic.CLI" Semantic.CLI.Spec. spec
97+ describe " Semantic.IO" Semantic.IO.Spec. spec
98+ describe " Parsing" Parsing.Spec. spec
99+
40100
41101main :: IO ()
42102main = do
43- withOptions defaultOptions { optionsLogLevel = Nothing } $ \ config logger statter -> hspec $ do
44- let args = TaskSession config " -" False logger statter
45- describe " Semantic.Stat" Semantic.Stat.Spec. spec
46- parallel $ do
47- describe " Analysis.Go" (Analysis.Go.Spec. spec args)
48- describe " Analysis.PHP" (Analysis.PHP.Spec. spec args)
49- describe " Analysis.Python" (Analysis.Python.Spec. spec args)
50- describe " Analysis.Ruby" (Analysis.Ruby.Spec. spec args)
51- describe " Analysis.TypeScript" (Analysis.TypeScript.Spec. spec args)
52- describe " Assigning.Assignment" Assigning.Assignment.Spec. spec
53- describe " Control.Abstract.Evaluator" Control.Abstract.Evaluator.Spec. spec
54- describe " Data.Diff" Data.Diff.Spec. spec
55- describe " Data.Graph" Data.Graph.Spec. spec
56- describe " Data.Abstract.Path" Data.Abstract.Path.Spec. spec
57- describe " Data.Abstract.Name" Data.Abstract.Name.Spec. spec
58- describe " Data.Functor.Classes.Generic" Data.Functor.Classes.Generic.Spec. spec
59- describe " Data.Range" Data.Range.Spec. spec
60- describe " Data.Scientific" Data.Scientific.Spec. spec
61- describe " Data.Semigroup.App" Data.Semigroup.App.Spec. spec
62- describe " Data.Source" Data.Source.Spec. spec
63- describe " Data.Term" Data.Term.Spec. spec
64- describe " Diffing.Algorithm.RWS" Diffing.Algorithm.RWS.Spec. spec
65- describe " Diffing.Algorithm.SES" Diffing.Algorithm.SES.Spec. spec
66- describe " Diffing.Interpreter" Diffing.Interpreter.Spec. spec
67- describe " Graphing.Calls" Graphing.Calls.Spec. spec
68- describe " Numeric" Numeric.Spec. spec
69- describe " Rendering.TOC" Rendering.TOC.Spec. spec
70- describe " Reprinting.Spec" Reprinting.Spec. spec
71- describe " Rewriting.Go" Rewriting.Go.Spec. spec
72- describe " Rewriting.JSON" Rewriting.JSON.Spec. spec
73- describe " Rewriting.Python" Rewriting.Python.Spec. spec
74- describe " Tags.Spec" Tags.Spec. spec
75- describe " Semantic" Semantic.Spec. spec
76- describe " Semantic.CLI" Semantic.CLI.Spec. spec
77- describe " Semantic.IO" Semantic.IO.Spec. spec
78- describe " Integration" (Integration.Spec. spec args)
79- describe " Parsing" Parsing.Spec. spec
103+ withOptions defaultOptions { optionsLogLevel = Nothing } $ \ config logger statter ->
104+ let session = TaskSession config " -" False logger statter
105+ in allTests session >>= defaultMain
106+
0 commit comments