diff options
author | Alec Theriault <alec.theriault@gmail.com> | 2019-02-04 22:06:07 -0800 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-02-16 22:55:16 -0500 |
commit | 4a09d30bffa0c9df10ab5e7d22293c1f39c75728 (patch) | |
tree | 3bf20a10b3ec9fc265c2f5ff7326051a1ff0e591 | |
parent | af7b0fdb64ad1c57f5829e8bd89e8e0fa96b11d2 (diff) | |
download | haskell-4a09d30bffa0c9df10ab5e7d22293c1f39c75728.tar.gz |
Run some of Haddock's tests in the testsuite
The 4 main testsuites in Haddock don't have many dependencies, but are
regularly broken in small ways by changes to the GHC AST or the GHC API.
The main gotcha is that we'll have to make sure that `haddock-test` and
the test suite don't add modules without modifying this test. Then again,
if that happens, the test will fail and someone will noticed.
-rw-r--r-- | testsuite/tests/haddock/haddock_testsuite/Makefile | 70 | ||||
-rw-r--r-- | testsuite/tests/haddock/haddock_testsuite/all.T | 19 | ||||
m--------- | utils/haddock | 0 |
3 files changed, 89 insertions, 0 deletions
diff --git a/testsuite/tests/haddock/haddock_testsuite/Makefile b/testsuite/tests/haddock/haddock_testsuite/Makefile new file mode 100644 index 0000000000..59a4a17928 --- /dev/null +++ b/testsuite/tests/haddock/haddock_testsuite/Makefile @@ -0,0 +1,70 @@ +TOP=../../.. +include $(TOP)/mk/boilerplate.mk +include $(TOP)/mk/test.mk + +# Remark: these should be synced up with the testsuites listed in `utils/haddock/haddock.cabal` +# See #16206 + + +# Corresponds to files in the `haddock-test` package +haddockTest=$(TOP)/../utils/haddock/haddock-test/src/Test/Haddock.hs \ + $(TOP)/../utils/haddock/haddock-test/src/Test/Haddock/Config.hs \ + $(TOP)/../utils/haddock/haddock-test/src/Test/Haddock/Utils.hs \ + $(TOP)/../utils/haddock/haddock-test/src/Test/Haddock/Xhtml.hs \ + $(TOP)/../utils/haddock/haddock-test/src/Test/Haddock/Process.hs + +# Corresponds to the `html-test` testsuite +.PHONY: htmlTest +htmlTest: + '$(TEST_HC)' \ + -odir . \ + -package Cabal \ + -o html-test \ + $(haddockTest) \ + $(TOP)/../utils/haddock/html-test/Main.hs + ./html-test \ + --ghc-path=$(TEST_HC) \ + --haddock-path=$(HADDOCK) \ + --haddock-stdout=haddock-out.log + +# Corresponds to the `latex-test` testsuite +.PHONY: latexTest +latexTest: + '$(TEST_HC)' \ + -odir . \ + -package Cabal \ + -o latex-test \ + $(haddockTest) \ + $(TOP)/../utils/haddock/latex-test/Main.hs + ./latex-test \ + --ghc-path=$(TEST_HC) \ + --haddock-path=$(HADDOCK) \ + --haddock-stdout=haddock-out.log + +# Corresponds to the `hoogle-test` testsuite +.PHONY: hoogleTest +hoogleTest: + '$(TEST_HC)' \ + -odir . \ + -package Cabal \ + -o hoogle-test \ + $(haddockTest) \ + $(TOP)/../utils/haddock/hoogle-test/Main.hs + ./hoogle-test \ + --ghc-path=$(TEST_HC) \ + --haddock-path=$(HADDOCK) \ + --haddock-stdout=haddock-out.log + +# Corresponds to the `hypsrc-test` testsuite +.PHONY: hypsrcTest +hypsrcTest: + '$(TEST_HC)' \ + -odir . \ + -package Cabal \ + -o hypsrc-test \ + $(haddockTest) \ + $(TOP)/../utils/haddock/hypsrc-test/Main.hs + ./hypsrc-test \ + --ghc-path=$(TEST_HC) \ + --haddock-path=$(HADDOCK) \ + --haddock-stdout=haddock-out.log diff --git a/testsuite/tests/haddock/haddock_testsuite/all.T b/testsuite/tests/haddock/haddock_testsuite/all.T new file mode 100644 index 0000000000..1aa387b6b4 --- /dev/null +++ b/testsuite/tests/haddock/haddock_testsuite/all.T @@ -0,0 +1,19 @@ +test('haddockHtmlTest', + [ignore_stdout, unless(in_tree_compiler(), skip), req_haddock], + makefile_test, + ['htmlTest']) + +test('haddockLatexTest', + [ignore_stdout, unless(in_tree_compiler(), skip), req_haddock], + makefile_test, + ['latexTest']) + +test('haddockHoogleTest', + [ignore_stdout, unless(in_tree_compiler(), skip), req_haddock], + makefile_test, + ['hoogleTest']) + +test('haddockHypsrcTest', + [ignore_stdout, unless(in_tree_compiler(), skip), req_haddock], + makefile_test, + ['hypsrcTest']) diff --git a/utils/haddock b/utils/haddock -Subproject 3ee6526d4ae7bf4deb7cd1caf24b3d735557357 +Subproject 33cdd810e4222b92bc22f7f5b7196fc97fd3cea |