summaryrefslogtreecommitdiff
path: root/src/test/include.am
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-06-18 17:08:23 -0400
committerNick Mathewson <nickm@torproject.org>2018-06-19 12:01:13 -0400
commitbd9ebb3763b90a8ef429376ee578e0571371145f (patch)
tree06a8e6fd20118ec47e87dc36a4b9780f809360d6 /src/test/include.am
parentd27745d81de8829d1a6da851fe9be057458e86df (diff)
downloadtor-bd9ebb3763b90a8ef429376ee578e0571371145f.tar.gz
tor-bd9ebb3763b90a8ef429376ee578e0571371145f.zip
Use a rust build script to set linker options correctly for tests.
We need this trick because some of our Rust tests depend on our C code, which in turn depend on other native libraries, which thereby pulls a whole mess of our build system into "cargo test". To solve this, we add a build script (build.rs) to set most of the options that we want based on the contents of config.rust. Some options can't be set, and need to go to the linker directly: we use a linker replacement (link_rust.sh) for these. Both config.rust and link_rust.sh are generated by autoconf for us. This patch on its own should enough to make the crypto test build, but not necessarily enough to make it pass.
Diffstat (limited to 'src/test/include.am')
-rw-r--r--src/test/include.am7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/test/include.am b/src/test/include.am
index 2ae598b224..4146de73b1 100644
--- a/src/test/include.am
+++ b/src/test/include.am
@@ -10,7 +10,10 @@ TESTS_ENVIRONMENT = \
export TESTING_TOR_BINARY="$(TESTING_TOR_BINARY)"; \
export CARGO="$(CARGO)"; \
export EXTRA_CARGO_OPTIONS="$(EXTRA_CARGO_OPTIONS)"; \
- export CARGO_ONLINE="$(CARGO_ONLINE)";
+ export CARGO_ONLINE="$(CARGO_ONLINE)"; \
+ export CCLD="$(CCLD)"; \
+ chmod +x "$(abs_top_builddir)/link_rust.sh"; \
+ export RUSTFLAGS="-C linker=$(abs_top_builddir)/link_rust.sh";
TESTSCRIPTS = \
src/test/fuzz_static_testcases.sh \
@@ -347,7 +350,7 @@ src_test_test_bt_cl_LDADD = src/common/libor-testing.a \
src/trace/libor-trace.a \
$(rust_ldadd) \
@TOR_LIB_MATH@ \
- @TOR_LIB_WS32@ @TOR_LIB_GDI@ @TOR_LIB_USERENV@
+ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @TOR_LIB_USERENV@
src_test_test_bt_cl_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
src_test_test_bt_cl_CPPFLAGS= $(src_test_AM_CPPFLAGS) $(TEST_CPPFLAGS)