include.am 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. # When the day comes that Tor requires Automake >= 1.12 change
  2. # TESTS_ENVIRONMENT to AM_TESTS_ENVIRONMENT because the former is reserved for
  3. # users while the later is reserved for developers.
  4. TESTS_ENVIRONMENT = \
  5. export PYTHON="$(PYTHON)"; \
  6. export SHELL="$(SHELL)"; \
  7. export abs_top_srcdir="$(abs_top_srcdir)"; \
  8. export builddir="$(builddir)"; \
  9. export TESTING_TOR_BINARY="$(TESTING_TOR_BINARY)";
  10. TESTSCRIPTS = src/test/test_zero_length_keys.sh \
  11. src/test/test_workqueue_cancel.sh \
  12. src/test/test_workqueue_efd.sh \
  13. src/test/test_workqueue_efd2.sh \
  14. src/test/test_workqueue_pipe.sh \
  15. src/test/test_workqueue_pipe2.sh \
  16. src/test/test_workqueue_socketpair.sh \
  17. src/test/test_switch_id.sh
  18. if USEPYTHON
  19. TESTSCRIPTS += src/test/test_ntor.sh src/test/test_bt.sh
  20. endif
  21. TESTS += src/test/test src/test/test-slow src/test/test-memwipe \
  22. src/test/test_workqueue \
  23. src/test/test_keygen.sh \
  24. src/test/test-timers \
  25. $(TESTSCRIPTS)
  26. # These flavors are run using automake's test-driver and test-network.sh
  27. TEST_CHUTNEY_FLAVORS = basic-min bridges-min hs-min single-onion
  28. # only run if we can ping6 ::1 (localhost)
  29. TEST_CHUTNEY_FLAVORS_IPV6 = bridges+ipv6-min ipv6-exit-min hs-ipv6 \
  30. single-onion-ipv6
  31. # only run if we can find a stable (or simply another) version of tor
  32. TEST_CHUTNEY_FLAVORS_MIXED = mixed
  33. ### This is a lovely feature, but it requires automake >= 1.12, and Tor
  34. ### doesn't require that yet.
  35. ###
  36. # TEST_EXTENSIONS = .sh
  37. # SH_LOG_COMPILER = $(SHELL)
  38. noinst_PROGRAMS+= src/test/bench
  39. if UNITTESTS_ENABLED
  40. noinst_PROGRAMS+= \
  41. src/test/test \
  42. src/test/test-slow \
  43. src/test/test-memwipe \
  44. src/test/test-child \
  45. src/test/test_workqueue \
  46. src/test/test-switch-id \
  47. src/test/test-timers
  48. endif
  49. src_test_AM_CPPFLAGS = -DSHARE_DATADIR="\"$(datadir)\"" \
  50. -DLOCALSTATEDIR="\"$(localstatedir)\"" \
  51. -DBINDIR="\"$(bindir)\"" \
  52. -I"$(top_srcdir)/src/or" -I"$(top_srcdir)/src/ext" \
  53. -I"$(top_srcdir)/src/trunnel" \
  54. -I"$(top_srcdir)/src/ext/trunnel" \
  55. -DTOR_UNIT_TESTS
  56. # -L flags need to go in LDFLAGS. -l flags need to go in LDADD.
  57. # This seems to matter nowhere but on Windows, but I assure you that it
  58. # matters a lot there, and is quite hard to debug if you forget to do it.
  59. src_test_test_SOURCES = \
  60. src/test/log_test_helpers.c \
  61. src/test/rend_test_helpers.c \
  62. src/test/test.c \
  63. src/test/test_accounting.c \
  64. src/test/test_addr.c \
  65. src/test/test_address.c \
  66. src/test/test_buffers.c \
  67. src/test/test_cell_formats.c \
  68. src/test/test_cell_queue.c \
  69. src/test/test_channel.c \
  70. src/test/test_channeltls.c \
  71. src/test/test_checkdir.c \
  72. src/test/test_circuitlist.c \
  73. src/test/test_circuitmux.c \
  74. src/test/test_circuituse.c \
  75. src/test/test_compat_libevent.c \
  76. src/test/test_config.c \
  77. src/test/test_connection.c \
  78. src/test/test_containers.c \
  79. src/test/test_controller.c \
  80. src/test/test_controller_events.c \
  81. src/test/test_crypto.c \
  82. src/test/test_data.c \
  83. src/test/test_dir.c \
  84. src/test/test_dir_common.c \
  85. src/test/test_dir_handle_get.c \
  86. src/test/test_entryconn.c \
  87. src/test/test_entrynodes.c \
  88. src/test/test_guardfraction.c \
  89. src/test/test_extorport.c \
  90. src/test/test_hs.c \
  91. src/test/test_hs_service.c \
  92. src/test/test_hs_intropoint.c \
  93. src/test/test_handles.c \
  94. src/test/test_hs_cache.c \
  95. src/test/test_hs_descriptor.c \
  96. src/test/test_introduce.c \
  97. src/test/test_keypin.c \
  98. src/test/test_link_handshake.c \
  99. src/test/test_logging.c \
  100. src/test/test_microdesc.c \
  101. src/test/test_nodelist.c \
  102. src/test/test_oom.c \
  103. src/test/test_oos.c \
  104. src/test/test_options.c \
  105. src/test/test_policy.c \
  106. src/test/test_procmon.c \
  107. src/test/test_protover.c \
  108. src/test/test_pt.c \
  109. src/test/test_pubsub.c \
  110. src/test/test_relay.c \
  111. src/test/test_relaycell.c \
  112. src/test/test_rendcache.c \
  113. src/test/test_replay.c \
  114. src/test/test_routerkeys.c \
  115. src/test/test_routerlist.c \
  116. src/test/test_routerset.c \
  117. src/test/test_scheduler.c \
  118. src/test/test_shared_random.c \
  119. src/test/test_socks.c \
  120. src/test/test_status.c \
  121. src/test/test_threads.c \
  122. src/test/test_tortls.c \
  123. src/test/test_util.c \
  124. src/test/test_util_format.c \
  125. src/test/test_util_process.c \
  126. src/test/test_helpers.c \
  127. src/test/test_dns.c \
  128. src/test/testing_common.c \
  129. src/test/testing_rsakeys.c \
  130. src/ext/tinytest.c
  131. src_test_test_slow_SOURCES = \
  132. src/test/test_slow.c \
  133. src/test/test_crypto_slow.c \
  134. src/test/test_util_slow.c \
  135. src/test/testing_common.c \
  136. src/test/testing_rsakeys.c \
  137. src/ext/tinytest.c
  138. src_test_test_memwipe_SOURCES = \
  139. src/test/test-memwipe.c
  140. src_test_test_timers_SOURCES = \
  141. src/test/test-timers.c
  142. src_test_test_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
  143. src_test_test_CPPFLAGS= $(src_test_AM_CPPFLAGS) $(TEST_CPPFLAGS)
  144. src_test_bench_SOURCES = \
  145. src/test/bench.c
  146. src_test_test_workqueue_SOURCES = \
  147. src/test/test_workqueue.c
  148. src_test_test_workqueue_CPPFLAGS= $(src_test_AM_CPPFLAGS)
  149. src_test_test_workqueue_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
  150. src_test_test_switch_id_SOURCES = \
  151. src/test/test_switch_id.c
  152. src_test_test_switch_id_CPPFLAGS= $(src_test_AM_CPPFLAGS)
  153. src_test_test_switch_id_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
  154. src_test_test_switch_id_LDFLAGS = @TOR_LDFLAGS_zlib@
  155. src_test_test_switch_id_LDADD = \
  156. src/common/libor-testing.a \
  157. src/common/libor-ctime-testing.a \
  158. @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@
  159. src_test_test_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ \
  160. @TOR_LDFLAGS_libevent@
  161. src_test_test_LDADD = src/or/libtor-testing.a \
  162. src/common/libor-crypto-testing.a \
  163. $(LIBKECCAK_TINY) \
  164. $(LIBDONNA) \
  165. src/common/libor-testing.a \
  166. src/common/libor-ctime-testing.a \
  167. src/common/libor-event-testing.a \
  168. src/trunnel/libor-trunnel-testing.a \
  169. @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ \
  170. @TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ \
  171. @TOR_SYSTEMD_LIBS@
  172. src_test_test_slow_CPPFLAGS = $(src_test_test_CPPFLAGS)
  173. src_test_test_slow_CFLAGS = $(src_test_test_CFLAGS)
  174. src_test_test_slow_LDADD = $(src_test_test_LDADD)
  175. src_test_test_slow_LDFLAGS = $(src_test_test_LDFLAGS)
  176. src_test_test_memwipe_CPPFLAGS = $(src_test_test_CPPFLAGS)
  177. # Don't use bugtrap cflags here: memwipe tests require memory violations.
  178. src_test_test_memwipe_CFLAGS = $(TEST_CFLAGS)
  179. src_test_test_memwipe_LDADD = $(src_test_test_LDADD)
  180. # The LDFLAGS need to include the bugtrap cflags, or else we won't link
  181. # successfully with the libraries built with them.
  182. src_test_test_memwipe_LDFLAGS = $(src_test_test_LDFLAGS) @CFLAGS_BUGTRAP@
  183. src_test_bench_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ \
  184. @TOR_LDFLAGS_libevent@
  185. src_test_bench_LDADD = src/or/libtor.a src/common/libor.a \
  186. src/common/libor-ctime.a \
  187. src/common/libor-crypto.a $(LIBKECCAK_TINY) $(LIBDONNA) \
  188. src/common/libor-event.a src/trunnel/libor-trunnel.a \
  189. @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ \
  190. @TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ \
  191. @TOR_SYSTEMD_LIBS@
  192. src_test_test_workqueue_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@ \
  193. @TOR_LDFLAGS_libevent@
  194. src_test_test_workqueue_LDADD = src/or/libtor-testing.a \
  195. src/common/libor-testing.a \
  196. src/common/libor-ctime-testing.a \
  197. src/common/libor-crypto-testing.a $(LIBKECCAK_TINY) $(LIBDONNA) \
  198. src/common/libor-event-testing.a \
  199. @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ \
  200. @TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@
  201. src_test_test_timers_CPPFLAGS = $(src_test_test_CPPFLAGS)
  202. src_test_test_timers_CFLAGS = $(src_test_test_CFLAGS)
  203. src_test_test_timers_LDADD = \
  204. src/common/libor-testing.a \
  205. src/common/libor-ctime-testing.a \
  206. src/common/libor-event-testing.a \
  207. src/common/libor-crypto-testing.a $(LIBKECCAK_TINY) $(LIBDONNA) \
  208. @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ \
  209. @TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@
  210. src_test_test_timers_LDFLAGS = $(src_test_test_LDFLAGS)
  211. noinst_HEADERS+= \
  212. src/test/fakechans.h \
  213. src/test/log_test_helpers.h \
  214. src/test/rend_test_helpers.h \
  215. src/test/test.h \
  216. src/test/test_helpers.h \
  217. src/test/test_dir_common.h \
  218. src/test/test_descriptors.inc \
  219. src/test/example_extrainfo.inc \
  220. src/test/failing_routerdescs.inc \
  221. src/test/ed25519_vectors.inc \
  222. src/test/test_descriptors.inc \
  223. src/test/vote_descriptors.inc
  224. noinst_PROGRAMS+= src/test/test-ntor-cl
  225. src_test_test_ntor_cl_SOURCES = src/test/test_ntor_cl.c
  226. src_test_test_ntor_cl_LDFLAGS = @TOR_LDFLAGS_zlib@ @TOR_LDFLAGS_openssl@
  227. src_test_test_ntor_cl_LDADD = src/or/libtor.a src/common/libor.a \
  228. src/common/libor-ctime.a \
  229. src/common/libor-crypto.a $(LIBKECCAK_TINY) $(LIBDONNA) \
  230. @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ \
  231. @TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@
  232. src_test_test_ntor_cl_AM_CPPFLAGS = \
  233. -I"$(top_srcdir)/src/or"
  234. noinst_PROGRAMS += src/test/test-bt-cl
  235. src_test_test_bt_cl_SOURCES = src/test/test_bt_cl.c
  236. src_test_test_bt_cl_LDADD = src/common/libor-testing.a \
  237. src/common/libor-ctime-testing.a \
  238. @TOR_LIB_MATH@ \
  239. @TOR_LIB_WS32@ @TOR_LIB_GDI@
  240. src_test_test_bt_cl_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
  241. src_test_test_bt_cl_CPPFLAGS= $(src_test_AM_CPPFLAGS) $(TEST_CPPFLAGS)
  242. EXTRA_DIST += \
  243. src/test/bt_test.py \
  244. src/test/ntor_ref.py \
  245. src/test/slownacl_curve25519.py \
  246. src/test/zero_length_keys.sh \
  247. src/test/test_keygen.sh \
  248. src/test/test_zero_length_keys.sh \
  249. src/test/test_ntor.sh src/test/test_bt.sh \
  250. src/test/test-network.sh \
  251. src/test/test_switch_id.sh \
  252. src/test/test_workqueue_cancel.sh \
  253. src/test/test_workqueue_efd.sh \
  254. src/test/test_workqueue_efd2.sh \
  255. src/test/test_workqueue_pipe.sh \
  256. src/test/test_workqueue_pipe2.sh \
  257. src/test/test_workqueue_socketpair.sh