1 From 1d2891204c6bf05d5e2eb0e5fa2ee78f6a2b755b Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Wed, 23 Dec 2015 11:47:00 +0100
4 Subject: [PATCH] Add an option to disable installation of test modules
6 The Python standard distribution comes with many test modules, that
7 are not necessarly useful on embedded targets.
9 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
10 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
12 Makefile.pre.in | 56 ++++++++++++++++++++++++++++++++++++--------------------
13 configure.ac | 6 ++++++
14 2 files changed, 42 insertions(+), 20 deletions(-)
16 diff --git a/Makefile.pre.in b/Makefile.pre.in
17 index 9420860..d4c771a 100644
20 @@ -1166,8 +1166,30 @@ maninstall: altmaninstall
23 XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax
24 -LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \
25 - tkinter/test/test_ttk site-packages test \
26 +LIBSUBDIRS= tkinter \
29 + collections concurrent concurrent/futures encodings \
31 + ensurepip ensurepip/_bundled \
32 + html json http dbm xmlrpc \
34 + logging csv wsgiref urllib \
35 + lib2to3 lib2to3/fixes lib2to3/pgen2 \
36 + ctypes ctypes/macholib \
37 + idlelib idlelib/Icons \
38 + distutils distutils/command $(XMLLIBSUBDIRS) \
41 + multiprocessing multiprocessing/dummy \
43 + venv venv/scripts venv/scripts/posix \
44 + curses pydoc_data $(MACHDEPS)
46 +TESTSUBDIRS = tkinter/test tkinter/test/test_tkinter tkinter/test/test_ttk \
47 + test test/test_asyncio \
48 + test/test_email test/test_email/data \
51 test/capath test/data \
52 test/cjkencodings test/decimaltestdata test/xmltestdata \
53 @@ -1199,28 +1221,22 @@ LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \
54 test/test_importlib/namespace_pkgs/project3/parent/child \
55 test/test_importlib/namespace_pkgs/module_and_namespace_package \
56 test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test \
59 - collections concurrent concurrent/futures encodings \
60 - email email/mime test/test_email test/test_email/data \
61 - ensurepip ensurepip/_bundled \
62 - html json test/test_json http dbm xmlrpc \
63 - sqlite3 sqlite3/test \
64 - logging csv wsgiref urllib \
65 - lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \
68 lib2to3/tests/data lib2to3/tests/data/fixers \
69 lib2to3/tests/data/fixers/myfixes \
70 - ctypes ctypes/test ctypes/macholib \
71 - idlelib idlelib/Icons idlelib/idle_test \
72 - distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
73 - importlib test/test_importlib test/test_importlib/builtin \
77 + test/test_importlib test/test_importlib/builtin \
78 test/test_importlib/extension test/test_importlib/frozen \
79 test/test_importlib/import_ test/test_importlib/source \
81 - multiprocessing multiprocessing/dummy \
82 - unittest unittest/test unittest/test/testmock \
83 - venv venv/scripts venv/scripts/posix \
84 - curses pydoc_data $(MACHDEPS)
85 + unittest/test unittest/test/testmock
87 +ifeq (@TEST_MODULES@,yes)
88 +LIBSUBDIRS += $(TESTSUBDIRS)
91 libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
92 @for i in $(SCRIPTDIR) $(LIBDEST); \
94 diff --git a/configure.ac b/configure.ac
95 index bfb599e..9f3d226 100644
98 @@ -2895,6 +2895,12 @@ if test "$posix_threads" = "yes"; then
102 +AC_SUBST(TEST_MODULES)
104 +AC_ARG_ENABLE(test-modules,
105 + AS_HELP_STRING([--disable-test-modules], [disable test modules]),
106 + [ TEST_MODULES="${enableval}" ], [ TEST_MODULES=yes ])
108 # Check for enable-ipv6
109 AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
110 AC_MSG_CHECKING([if --enable-ipv6 is specified])