clap/claptests/Makefile

29 lines
708 B
Makefile
Raw Normal View History

2015-03-25 21:02:21 +00:00
THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)
build:
cargo update
cargo build --release
test:
cd "$(THIS_DIR)"
cp Cargo.toml cargo.bak
read -p "fork url: " FORK
read -p "branch [master]: " BRANCH
2015-03-25 21:08:45 +00:00
sed -e "s/^\#FORK/git=\"$FORK\"/" cargo.bak > Cargo.toml
2015-03-25 21:02:21 +00:00
if [ "$BRANCH" == "" ]; then
2015-03-25 21:08:45 +00:00
sed -i "s/^\#BRANCH/branch=\"master\"/" Cargo.toml
2015-03-25 21:02:21 +00:00
else
2015-03-25 21:08:45 +00:00
sed -i "s/^\#BRNACH/branch=\"$BRANCH\"/" Cargo.toml
2015-03-25 21:02:21 +00:00
fi
(make clean) || (make clean && false)
(make build) || (make clean && false)
./run_tests.py || (make clean && false)
echo "All tests pass!"
mv cargo.bak Cargo.toml
make clean
clean:
cd "$(THIS_DIR)"
cargo clean