Fixed tests makefile and script

This commit is contained in:
Kevin K 2015-03-26 14:20:55 -04:00
parent b8f42fa824
commit 8de3908458
4 changed files with 14 additions and 30 deletions

View file

@ -6,4 +6,4 @@ authors = ["Kevin K. <kbknapp@gmail.com>"]
[dependencies.clap]
git = "https://github.com/kbknapp/clap-rs"
branch = "dev"
branch = "master"

View file

@ -1,5 +1,7 @@
THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)
URL:=
BRANCH:=
build:
cargo update
@ -8,18 +10,17 @@ build:
test:
cd "$(THIS_DIR)"
cp Cargo.toml cargo.bak
read -p "fork url: " FORK
read -p "branch [master]: " BRANCH
sed "s/^git/git = \"$FORK\"/" cargo.bak > Cargo.toml
if [ "$BRANCH" == "" ]; then
sed -i "s/^git/branch = \"master\"/" Cargo.toml
else
sed -i "s/^branch/branch = \"$BRANCH\"/" Cargo.toml
fi
@read -p "Fork URL: " URL; \
sed "/^git/c\git = \"$$URL\"" cargo.bak > Cargo.toml
@read -p "Branch [master]: " BRANCH; \
$(if $(strip $(BRANCH)), \
sed -i "/^branch/c\branch = \"master\"" Cargo.toml, \
sed -i "/^branch/c\branch = \"$$BRANCH\"" Cargo.toml)
(make clean) || (make clean && false)
cd "$(THIS_DIR)"
(make build) || (make clean && false)
./run_tests.py || (make clean && false)
echo "All tests pass!"
cd "$(THIS_DIR)"
(./run_tests.py) || (make clean && false)
mv cargo.bak Cargo.toml
make clean

View file

@ -1,19 +0,0 @@
#!/usr/bin/env python2
import hashlib
import sys
import subprocess
failed = False
def pass_fail(good, check):
print(good)
if check == good:
return "Pass"
failed = True
return "Fail"
def main():
pass
if __name__ == '__main__':
sys.exit(main())

View file

@ -67,6 +67,8 @@ fn main() {
if let Some(p) = matches.value_of("positional") {
println!("positional present with value: {}", p);
} else {
println!("positional NOT present");
}
if matches.is_present("subcmd") {