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.
This commit is contained in:
@@ -11,8 +11,3 @@ build = "build.rs"
|
|||||||
[lib]
|
[lib]
|
||||||
name = "cretonne"
|
name = "cretonne"
|
||||||
path = "lib.rs"
|
path = "lib.rs"
|
||||||
|
|
||||||
[dev-dependencies]
|
|
||||||
cretonne-reader = { path = "../libreader" }
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
|
|||||||
@@ -17,29 +17,33 @@ set -e
|
|||||||
cd $(dirname "$0")
|
cd $(dirname "$0")
|
||||||
topdir=$(pwd)
|
topdir=$(pwd)
|
||||||
|
|
||||||
PKGS="libcretonne libreader tools"
|
function banner() {
|
||||||
echo ====== Rust unit tests and debug builds ======
|
echo "====== $@ ======"
|
||||||
|
}
|
||||||
|
|
||||||
|
PKGS="cretonne cretonne-reader cretonne-tools"
|
||||||
|
cd "$topdir/src/tools"
|
||||||
for PKG in $PKGS
|
for PKG in $PKGS
|
||||||
do
|
do
|
||||||
(
|
banner "Rust $PKG unit tests"
|
||||||
cd $topdir/src/$PKG
|
cargo test -p $PKG
|
||||||
cargo test
|
|
||||||
cargo build
|
|
||||||
)
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# Build cton-util for parser testing.
|
# Build cton-util for parser testing.
|
||||||
echo ====== Rust release build and documentation ======
|
|
||||||
cd "$topdir/src/tools"
|
cd "$topdir/src/tools"
|
||||||
|
banner "Rust documentation"
|
||||||
|
echo "open $topdir/src/tools/target/doc/cretonne/index.html"
|
||||||
cargo doc
|
cargo doc
|
||||||
|
banner "Rust release build"
|
||||||
cargo build --release
|
cargo build --release
|
||||||
|
|
||||||
export CTONUTIL="$topdir/src/tools/target/release/cton-util"
|
export CTONUTIL="$topdir/src/tools/target/release/cton-util"
|
||||||
|
|
||||||
# Run the parser tests.
|
# Run the parser tests.
|
||||||
echo ====== Parser tests ======
|
|
||||||
cd "$topdir/tests"
|
cd "$topdir/tests"
|
||||||
|
banner "Parser tests"
|
||||||
parser/run.sh
|
parser/run.sh
|
||||||
|
banner "CFG tests"
|
||||||
cfg/run.sh
|
cfg/run.sh
|
||||||
|
|
||||||
echo ====== OK ======
|
banner "OK"
|
||||||
|
|||||||
Reference in New Issue
Block a user