summaryrefslogtreecommitdiff
path: root/testsuite/tests/count-deps/Makefile
diff options
context:
space:
mode:
authorShayne Fletcher <shayne@shaynefletcher.org>2021-06-03 20:34:39 +1000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-06-05 03:47:48 -0400
commit1713cbb038116c2d703238b47f78c4861232db8e (patch)
tree9ef7ba336a7c36defe90ce31c5211666f715b47e /testsuite/tests/count-deps/Makefile
parent737b0ae194ca33f9bea9a150dada0c933fd75d4d (diff)
downloadhaskell-1713cbb038116c2d703238b47f78c4861232db8e.tar.gz
Make 'count-deps' a ghc/util standalone program
- Move 'count-deps' into 'ghc/utils' so that it can be called standalone. - Move 'testsuite/tests/parser/should_run/' tests 'CountParserDeps' and 'CountAstDeps' to 'testsuite/tests/count-deps' and reimplement in terms of calling the utility - Document how to use 'count-deps' in 'ghc/utils/count-deps/README'
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"