Browse Source

Move integration tests into src/tools/tests.

The integration tests use both libcretonne and libreader, so moving them avoids
the circular dev-dependency.

Also go back to building everything under src/tools/target to avoid rebuilding
the libraries when cargo is invoked in different subdirectories. This speeds up
test-all.sh quite a bit.

Finally, skip the pure debug build. We build "cargo test" and "cargo build
--release" which should cover everything we need.
pull/3/head
Jakob Stoklund Olesen 8 years ago
parent
commit
84a154a8ca
  1. 5
      src/libcretonne/Cargo.toml
  2. 0
      src/tools/tests/cfg_traversal.rs
  3. 0
      src/tools/tests/dominator_tree.rs
  4. 0
      src/tools/tests/lib.rs
  5. 24
      test-all.sh

5
src/libcretonne/Cargo.toml

@ -11,8 +11,3 @@ build = "build.rs"
[lib]
name = "cretonne"
path = "lib.rs"
[dev-dependencies]
cretonne-reader = { path = "../libreader" }
[dependencies]

0
src/libcretonne/tests/cfg_traversal.rs → src/tools/tests/cfg_traversal.rs

0
src/libcretonne/tests/dominator_tree.rs → src/tools/tests/dominator_tree.rs

0
src/libcretonne/tests/lib.rs → src/tools/tests/lib.rs

24
test-all.sh

@ -17,29 +17,33 @@ set -e
cd $(dirname "$0")
topdir=$(pwd)
PKGS="libcretonne libreader tools"
echo ====== Rust unit tests and debug builds ======
function banner() {
echo "====== $@ ======"
}
PKGS="cretonne cretonne-reader cretonne-tools"
cd "$topdir/src/tools"
for PKG in $PKGS
do
(
cd $topdir/src/$PKG
cargo test
cargo build
)
banner "Rust $PKG unit tests"
cargo test -p $PKG
done
# Build cton-util for parser testing.
echo ====== Rust release build and documentation ======
cd "$topdir/src/tools"
banner "Rust documentation"
echo "open $topdir/src/tools/target/doc/cretonne/index.html"
cargo doc
banner "Rust release build"
cargo build --release
export CTONUTIL="$topdir/src/tools/target/release/cton-util"
# Run the parser tests.
echo ====== Parser tests ======
cd "$topdir/tests"
banner "Parser tests"
parser/run.sh
banner "CFG tests"
cfg/run.sh
echo ====== OK ======
banner "OK"

Loading…
Cancel
Save