summaryrefslogtreecommitdiff
path: root/ci/run.sh
diff options
context:
space:
mode:
authorPaul Osborne <osbpau@gmail.com>2016-03-07 00:22:03 -0600
committerPaul Osborne <osbpau@gmail.com>2016-03-13 00:41:07 -0600
commit14e2f766fea3fa74cf5070b1c4c4825a57bf2c0a (patch)
treee8c3042668f74e6392b4a5be19a4cea46794f594 /ci/run.sh
parent5ddd8b2e22f8b1f530975ce06614eabb491f28a2 (diff)
downloadnix-14e2f766fea3fa74cf5070b1c4c4825a57bf2c0a.zip
testing: export CC based on .cargo/config contents
We already need to test cargo about gcc locations so it can perfom linking -- we just parse this information out to tell rust where gcc is for complation (nix-test compiles some C code for testing). Signed-off-by: Paul Osborne <osbpau@gmail.com>
Diffstat (limited to 'ci/run.sh')
-rwxr-xr-xci/run.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/ci/run.sh b/ci/run.sh
index e39cc44b..d1ac5ad9 100755
--- a/ci/run.sh
+++ b/ci/run.sh
@@ -27,6 +27,17 @@ configure_cargo() {
cp "${BASE_DIR}/ci/cargo-config" .cargo/config
}
+#
+# We need to export CC for the tests to build properly (some C code is
+# compiled) to work. We already tell Cargo about the compiler in the
+# cargo config, so we just parse that info out of the cargo config
+#
+cc_for_target() {
+ awk "/\[target\.${TARGET}\]/{getline; print}" .cargo/config |
+ cut -d '=' -f2 | \
+ tr -d '"' | tr -d ' '
+}
+
cross_compile_tests() {
case "$TARGET" in
*-apple-ios)
@@ -99,6 +110,8 @@ test_binary() {
configure_cargo
+export CC="$(cc_for_target)"
+
# select the proper version
multirust override ${VERSION}