summaryrefslogtreecommitdiff
path: root/testsuite/tests/count-deps/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/count-deps/Makefile')
-rw-r--r--testsuite/tests/count-deps/Makefile23
1 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/tests/count-deps/Makefile b/testsuite/tests/count-deps/Makefile
new file mode 100644
index 0000000000..41911c47df
--- /dev/null
+++ b/testsuite/tests/count-deps/Makefile
@@ -0,0 +1,23 @@
+TOP=../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+LIBDIR := "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`"
+
+# Calculate the number of module dependencies of 'Parser.' If that
+# number exceeds a threshold, that indicates that the dependencies
+# have significantly gone up via the commit under test (and the test
+# is deemed to fail). In that case, this most likely means a cycle
+# has arisen that pulls in modules for Core generation. The
+# motivation for not allowing that to happen is so that the
+# 'ghc-lib-parser' package subset of the GHC API can continue to be
+# provided with as small a number of modules as possible for when the
+# need exists to produce ASTs and nothing more.
+
+.PHONY: count-deps-parser
+count-deps-parser:
+ $(COUNT_DEPS) $(LIBDIR) "GHC.Parser"
+
+.PHONY: count-deps-ast
+count-deps-ast:
+ $(COUNT_DEPS) $(LIBDIR) "Language.Haskell.Syntax"