1 From bba0896a05e6406076893dd2f4c3b330e41082a6 Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Wed, 22 Feb 2017 17:01:18 -0800
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>
11 [ Andrey Smirnov: ported to Python 3.6 ]
12 Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
14 Makefile.pre.in | 55 ++++++++++++++++++++++++++++++++++++-------------------
15 configure.ac | 5 +++++
16 2 files changed, 41 insertions(+), 19 deletions(-)
18 diff --git a/Makefile.pre.in b/Makefile.pre.in
19 index 4ce917ab8d..4110fff4ac 100644
22 @@ -1194,8 +1194,28 @@ maninstall: altmaninstall
25 XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax
26 -LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \
27 - tkinter/test/test_ttk site-packages test \
29 +LIBSUBDIRS= tkinter site-packages \
31 + collections concurrent concurrent/futures encodings \
33 + ensurepip ensurepip/_bundled \
34 + html json http dbm xmlrpc \
36 + logging csv wsgiref urllib \
37 + lib2to3 lib2to3/fixes lib2to3/pgen2 \
38 + ctypes ctypes/macholib \
39 + idlelib idlelib/Icons \
40 + distutils distutils/command $(XMLLIBSUBDIRS) \
43 + multiprocessing multiprocessing/dummy \
45 + venv venv/scripts venv/scripts/common venv/scripts/posix \
48 +TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \
49 + tkinter/test/test_ttk test \
51 test/capath test/data \
52 test/cjkencodings test/decimaltestdata test/xmltestdata \
53 @@ -1229,29 +1249,26 @@ 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 \
66 + test/test_email test/test_email/data \
70 lib2to3/tests/data lib2to3/tests/data/fixers \
71 lib2to3/tests/data/fixers/myfixes \
72 - ctypes ctypes/test ctypes/macholib \
73 - idlelib idlelib/Icons idlelib/idle_test \
74 - distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
75 - importlib test/test_importlib test/test_importlib/builtin \
79 + test/test_importlib test/test_importlib/builtin \
80 test/test_importlib/extension test/test_importlib/frozen \
81 test/test_importlib/import_ test/test_importlib/source \
82 test/test_tools test/test_warnings test/test_warnings/data \
84 - multiprocessing multiprocessing/dummy \
85 - unittest unittest/test unittest/test/testmock \
86 - venv venv/scripts venv/scripts/common venv/scripts/posix \
88 + unittest/test unittest/test/testmock
90 +ifeq (@TEST_MODULES@,yes)
91 +LIBSUBDIRS += $(TESTSUBDIRS)
94 libinstall: build_all $(srcdir)/Modules/xxmodule.c
95 @for i in $(SCRIPTDIR) $(LIBDEST); \
97 diff --git a/configure.ac b/configure.ac
98 index d5ee2aedfb..f924937fe1 100644
101 @@ -3112,6 +3112,11 @@ if test "$posix_threads" = "yes"; then
102 AC_CHECK_FUNCS(pthread_atfork)
105 +AC_SUBST(TEST_MODULES)
107 +AC_ARG_ENABLE(test-modules,
108 + AS_HELP_STRING([--disable-test-modules], [disable test modules]),
109 + [ TEST_MODULES="${enableval}" ], [ TEST_MODULES=yes ])
111 # Check for enable-ipv6
112 AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])