* The installation script was modified to recognize when its running on windows,
as well as tweaking how it downloads and installs snapshots. The goal here was
to make the script runnable on buildbot for mac/linux/windows with 32/64 bit
options on mac/linux.
* The installation script now install rustc to `rustc/bin` in the local
directory to have parallel builds on buildbot.
* The tests now store all their temporary state locally in the build directory
to enable parallel builds on buildbot.
* A shell test is ignored which assumed the presence of a TTY output.
+++ /dev/null
-echo "checking for lines over 100 characters..."
-find src tests -name '*.rs' | xargs grep '.\{101,\}' && exit 1
-echo "ok"
-set -ex
+set -x
-if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
+if [ "${TRAVIS_OS_NAME}" = "osx" ] || [ "${PLATFORM}" = "mac" ]; then
target=apple-darwin
-else
+elif [ "${TRAVIS_OS_NAME}" = "linux" ] || [ "${PLATFORM}" = "linux" ]; then
+ target=unknown-linux-gnu
+elif [ "${OS}" = "Windows_NT" ] || [ "${PLATFORM}" = "win" ]; then
+ target=pc-mingw32
+ windows=1
+fi
+
+if [ "${TRAVIS}" = "true" ] && [ "${target}" = "unknown-linux-gnu" ]; then
# Install a 32-bit compiler for linux
sudo apt-get update
- sudo apt-get install gcc-multilib
- target=unknown-linux-gnu
+ sudo apt-get install gcc-multilib lib32stdc++6
fi
# Install both 64 and 32 bit libraries. Apparently travis barfs if you try to
# just install the right ones? This should enable cross compilation in the
# future anyway.
-curl -O http://static.rust-lang.org/dist/rust-nightly-x86_64-$target.tar.gz
-curl -O http://static.rust-lang.org/dist/rust-nightly-i686-$target.tar.gz
-tar xfz rust-nightly-x86_64-$target.tar.gz
-tar xfz rust-nightly-i686-$target.tar.gz
-cp -r rust-nightly-i686-$target/lib/rustlib/i686-$target \
- rust-nightly-x86_64-$target/lib/rustlib
-(cd rust-nightly-x86_64-$target && \
- find lib/rustlib/i686-$target/lib -type f >> \
- lib/rustlib/manifest.in)
-sudo ./rust-nightly-x86_64-$target/install.sh
+if [ -z "${windows}" ]; then
+ curl -O http://static.rust-lang.org/dist/rust-nightly-i686-$target.tar.gz
+ tar xfz rust-nightly-i686-$target.tar.gz
+ curl -O http://static.rust-lang.org/dist/rust-nightly-x86_64-$target.tar.gz
+ tar xfz rust-nightly-x86_64-$target.tar.gz
-export RUSTC="rustc --target=${ARCH}-${target}"
+ if [ "${BITS}" = "32" ]; then
+ src=x86_64
+ dst=i686
+ else
+ src=i686
+ dst=x86_64
+ fi
+ cp -r rust-nightly-$src-$target/lib/rustlib/$src-$target \
+ rust-nightly-$dst-$target/lib/rustlib
+ (cd rust-nightly-$dst-$target && \
+ find lib/rustlib/$src-$target/lib -type f >> \
+ lib/rustlib/manifest.in)
-set +ex
+ ./rust-nightly-$dst-$target/install.sh --prefix=rustc
+ rm -rf rust-nightly-$src-$target
+ rm -rf rust-nightly-$dst-$target
+else
+ rm -rf *.exe rustc
+ curl -O http://static.rust-lang.org/dist/rust-nightly-install.exe
+ innounp -y -x rust-nightly-install.exe
+ mv '{app}' rustc
+fi
+set +x
language: rust
install:
- - . ./.travis.install.deps.sh
+ - sh ./.travis.install.deps.sh
script:
- - ./.travis.check.style.sh
- - make CC="$CC" RUSTC="$RUSTC" -j4
- - make CC="$CC" RUSTC="$RUSTC" test -j4
+ - make
+ - make test -j4
- make install DESTDIR=${PWD}/destdir
env:
- - ARCH=i686 CC='cc -m32'
- - ARCH=x86_64 CC=cc
+ - BITS=32
+ - BITS=64
os:
- linux
-RUSTC ?= rustc
RUSTC_FLAGS ?=
DESTDIR ?=
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
+ifeq ($(wildcard rustc/bin),)
+export RUSTC := rustc
+else
+export RUSTC := $(CURDIR)/rustc/bin/rustc
+endif
+
+export PATH := $(PATH):$(CURDIR)/rustc/bin
+
# Link flags to pull in dependencies
BINS = cargo \
cargo-build \
SRC = $(shell find src -name '*.rs' -not -path 'src/bin*')
DEPS = -L libs/hammer.rs/target -L libs/toml-rs/build
-TOML = libs/toml-rs/build/$(shell rustc --crate-file-name libs/toml-rs/src/toml.rs)
-HAMMER = libs/hammer.rs/target/$(shell rustc --crate-type=lib --crate-file-name libs/hammer.rs/src/hammer.rs)
+TOML = libs/toml-rs/build/$(shell $(RUSTC) --crate-file-name libs/toml-rs/src/toml.rs)
+HAMMER = libs/hammer.rs/target/$(shell $(RUSTC) --crate-type=lib --crate-file-name libs/hammer.rs/src/hammer.rs)
HAMCREST = libs/hamcrest-rust/target/libhamcrest.timestamp
LIBCARGO = target/libcargo.timestamp
BIN_TARGETS = $(patsubst %,target/%,$(BINS))
test-integration: target/tests/test-integration
$< $(only)
-test: test-unit test-integration
+test: test-unit test-integration style
+
+style:
+ sh tests/check-style.sh
clean:
rm -rf target
install target/cargo target/cargo-* $(DESTDIR)$(BINDIR)
# Setup phony tasks
-.PHONY: all clean distclean test test-unit test-integration libcargo
+.PHONY: all clean distclean test test-unit test-integration libcargo style
# Disable unnecessary built-in rules
.SUFFIXES:
+
-Subproject commit 0baf235e24d6c3e20f3ae8368d1c0fce08138bd4
+Subproject commit d2467aa7a6da51945bce72c3ede891d00b11c78f
-Subproject commit 66c83483f880c87e44c57617bec2615e945cce14
+Subproject commit 7ba80c5ac4a3f6bc3801bb4ac86fd65a569a07ba
--- /dev/null
+echo "checking for lines over 100 characters..."
+find src tests -name '*.rs' | xargs grep '.\{101,\}' && exit 1
+echo "ok"
pub fn root() -> Path {
let my_id = *task_id.get().unwrap();
- let path = os::tmpdir().join(CARGO_INTEGRATION_TEST_DIR)
- .join(format!("test-{}", my_id));
+ let path = os::self_exe_path().unwrap()
+ .join(CARGO_INTEGRATION_TEST_DIR)
+ .join(format!("test-{}", my_id));
realpath(&path).unwrap()
}
"#).assert();
// This shouldn't recompile `bar`
- assert_that(p.process("cargo-build"),
+ assert_that(p.process(cargo_dir().join("cargo-build")),
execs().with_stdout(format!("{} bar v0.5.0 (file:{})\n\
{} foo v0.5.0 (file:{})\n",
FRESH, bar.display(),
-#![cfg(not(windows))] // getting the actual colored output is a little different
- // on windows, so it's tough to get a reference copy of all
- // the color
-
use support::{ResultTest,Tap,shell_writes};
use hamcrest::{assert_that};
use std::io::{MemWriter, BufWriter, IoResult};
})
test!(colored_shell {
+ let term: Option<TerminfoTerminal<MemWriter>> =
+ Terminal::new(MemWriter::new());
+ if term.is_none() { return }
+
let config = ShellConfig { color: true, verbose: true, tty: true };
let mut buf: Vec<u8> = Vec::from_elem(100, 0 as u8);