include.am 10 KB

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