From 86a354d6e83e84b5a834af826f6c4a174e1714d9 Mon Sep 17 00:00:00 2001 From: Potato Hatsue <1793913507@qq.com> Date: Tue, 6 Apr 2021 23:41:45 +0800 Subject: [PATCH] Wrap test suite of tactics plugin into tasty test tree --- .github/workflows/test.yml | 2 +- plugins/hls-tactics-plugin/hls-tactics-plugin.cabal | 2 ++ plugins/hls-tactics-plugin/test/Main.hs | 9 ++++++++- plugins/hls-tactics-plugin/test/Spec.hs | 1 + 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 plugins/hls-tactics-plugin/test/Spec.hs diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e088b782ad..1cee10c47e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -166,4 +166,4 @@ jobs: - if: ${{ needs.pre_job.outputs.should_skip != 'true' && matrix.test }} name: Test hls-tactics-plugin test suite - run: LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-tactics-plugin --test-options="-j1" + run: cabal test hls-tactics-plugin --test-options="-j1 --rerun-update" || cabal test hls-tactics-plugin --test-options="-j1 --rerun" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-tactics-plugin --test-options="-j1 --rerun" diff --git a/plugins/hls-tactics-plugin/hls-tactics-plugin.cabal b/plugins/hls-tactics-plugin/hls-tactics-plugin.cabal index 1c2f1e399b..dea03a562b 100644 --- a/plugins/hls-tactics-plugin/hls-tactics-plugin.cabal +++ b/plugins/hls-tactics-plugin/hls-tactics-plugin.cabal @@ -119,6 +119,7 @@ test-suite tests CodeAction.IntrosSpec CodeAction.UseDataConSpec ProviderSpec + Spec UnificationSpec Utils hs-source-dirs: @@ -144,6 +145,7 @@ test-suite tests , text , deepseq , tasty-hunit + , tasty-hspec build-tool-depends: hspec-discover:hspec-discover default-language: Haskell2010 diff --git a/plugins/hls-tactics-plugin/test/Main.hs b/plugins/hls-tactics-plugin/test/Main.hs index 9bc8683d3c..00a71905e1 100644 --- a/plugins/hls-tactics-plugin/test/Main.hs +++ b/plugins/hls-tactics-plugin/test/Main.hs @@ -1 +1,8 @@ -{-# OPTIONS_GHC -F -pgmF hspec-discover -optF --module-name=Main #-} +module Main where + +import qualified Spec +import Test.Hls +import Test.Tasty.Hspec + +main :: IO () +main = testSpecs Spec.spec >>= defaultTestRunner . testGroup "tactics" diff --git a/plugins/hls-tactics-plugin/test/Spec.hs b/plugins/hls-tactics-plugin/test/Spec.hs new file mode 100644 index 0000000000..5416ef6a86 --- /dev/null +++ b/plugins/hls-tactics-plugin/test/Spec.hs @@ -0,0 +1 @@ +{-# OPTIONS_GHC -F -pgmF hspec-discover -optF --module-name=Spec #-}