0013-Add-an-option-to-disable-installation-of-test-module.patch 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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
  5. The Python standard distribution comes with many test modules, that
  6. are not necessarly useful on embedded targets.
  7. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  8. Signed-off-by: Samuel Martin <s.martin49@gmail.com>
  9. [ Andrey Smirnov: ported to Python 3.6 ]
  10. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
  11. ---
  12. Makefile.pre.in | 55 ++++++++++++++++++++++++++++++++++++-------------------
  13. configure.ac | 5 +++++
  14. 2 files changed, 41 insertions(+), 19 deletions(-)
  15. diff --git a/Makefile.pre.in b/Makefile.pre.in
  16. index 4ce917ab8d..4110fff4ac 100644
  17. --- a/Makefile.pre.in
  18. +++ b/Makefile.pre.in
  19. @@ -1259,8 +1259,28 @@ maninstall: altmaninstall
  20. # Install the library
  21. XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax
  22. -LIBSUBDIRS= tkinter tkinter/test tkinter/test/test_tkinter \
  23. - tkinter/test/test_ttk site-packages test \
  24. +
  25. +LIBSUBDIRS= tkinter site-packages \
  26. + asyncio \
  27. + collections concurrent concurrent/futures encodings \
  28. + email email/mime \
  29. + ensurepip ensurepip/_bundled \
  30. + html json http dbm xmlrpc \
  31. + sqlite3 \
  32. + logging csv wsgiref urllib \
  33. + lib2to3 lib2to3/fixes lib2to3/pgen2 \
  34. + ctypes ctypes/macholib \
  35. + idlelib idlelib/Icons \
  36. + distutils distutils/command $(XMLLIBSUBDIRS) \
  37. + importlib \
  38. + turtledemo \
  39. + multiprocessing multiprocessing/dummy \
  40. + unittest \
  41. + venv venv/scripts venv/scripts/common venv/scripts/posix \
  42. + curses pydoc_data
  43. +
  44. +TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \
  45. + tkinter/test/test_ttk test \
  46. test/audiodata \
  47. test/capath test/data \
  48. test/cjkencodings test/decimaltestdata test/xmltestdata \
  49. diff --git a/Makefile.pre.in b/Makefile.pre.in
  50. index 1ff2362..194dbfc 100644
  51. --- a/Makefile.pre.in
  52. +++ b/Makefile.pre.in
  53. @@ -1334,26 +1334,24 @@ TESTSUBDIRS= tkinter/test tkinter/test/test_tkinter \
  54. test/test_importlib/source \
  55. test/test_importlib/zipdata01 \
  56. test/test_importlib/zipdata02 \
  57. - asyncio \
  58. test/test_asyncio \
  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 \
  67. + test/test_json \
  68. + sqlite3/test \
  69. + lib2to3/tests \
  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. + ctypes/test \
  76. + idlelib/idle_test \
  77. + distutils/tests \
  78. + test/test_importlib test/test_importlib/builtin \
  79. test/test_tools test/test_warnings test/test_warnings/data \
  80. - turtledemo \
  81. - multiprocessing multiprocessing/dummy \
  82. - unittest unittest/test unittest/test/testmock \
  83. - venv venv/scripts venv/scripts/common venv/scripts/posix \
  84. - curses pydoc_data
  85. + unittest/test unittest/test/testmock
  86. +
  87. +ifeq (@TEST_MODULES@,yes)
  88. +LIBSUBDIRS += $(TESTSUBDIRS)
  89. +endif
  90. +
  91. libinstall: build_all $(srcdir)/Modules/xxmodule.c
  92. @for i in $(SCRIPTDIR) $(LIBDEST); \
  93. do \
  94. diff --git a/configure.ac b/configure.ac
  95. index d5ee2aedfb..f924937fe1 100644
  96. --- a/configure.ac
  97. +++ b/configure.ac
  98. @@ -3226,6 +3226,11 @@ if test "$posix_threads" = "yes"; then
  99. AC_CHECK_FUNCS(pthread_getcpuclockid)
  100. fi
  101. +AC_SUBST(TEST_MODULES)
  102. +
  103. +AC_ARG_ENABLE(test-modules,
  104. + AS_HELP_STRING([--disable-test-modules], [disable test modules]),
  105. + [ TEST_MODULES="${enableval}" ], [ TEST_MODULES=yes ])
  106. # Check for enable-ipv6
  107. AH_TEMPLATE(ENABLE_IPV6, [Define if --enable-ipv6 is specified])
  108. --
  109. 2.13.5