mirror of
https://github.com/clap-rs/clap
synced 2024-12-13 14:22:34 +00:00
Fixed tests makefile and script
This commit is contained in:
parent
b8f42fa824
commit
8de3908458
4 changed files with 14 additions and 30 deletions
|
@ -6,4 +6,4 @@ authors = ["Kevin K. <kbknapp@gmail.com>"]
|
||||||
|
|
||||||
[dependencies.clap]
|
[dependencies.clap]
|
||||||
git = "https://github.com/kbknapp/clap-rs"
|
git = "https://github.com/kbknapp/clap-rs"
|
||||||
branch = "dev"
|
branch = "master"
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
|
THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
|
||||||
THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)
|
THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)
|
||||||
|
URL:=
|
||||||
|
BRANCH:=
|
||||||
|
|
||||||
build:
|
build:
|
||||||
cargo update
|
cargo update
|
||||||
|
@ -8,18 +10,17 @@ build:
|
||||||
test:
|
test:
|
||||||
cd "$(THIS_DIR)"
|
cd "$(THIS_DIR)"
|
||||||
cp Cargo.toml cargo.bak
|
cp Cargo.toml cargo.bak
|
||||||
read -p "fork url: " FORK
|
@read -p "Fork URL: " URL; \
|
||||||
read -p "branch [master]: " BRANCH
|
sed "/^git/c\git = \"$$URL\"" cargo.bak > Cargo.toml
|
||||||
sed "s/^git/git = \"$FORK\"/" cargo.bak > Cargo.toml
|
@read -p "Branch [master]: " BRANCH; \
|
||||||
if [ "$BRANCH" == "" ]; then
|
$(if $(strip $(BRANCH)), \
|
||||||
sed -i "s/^git/branch = \"master\"/" Cargo.toml
|
sed -i "/^branch/c\branch = \"master\"" Cargo.toml, \
|
||||||
else
|
sed -i "/^branch/c\branch = \"$$BRANCH\"" Cargo.toml)
|
||||||
sed -i "s/^branch/branch = \"$BRANCH\"/" Cargo.toml
|
|
||||||
fi
|
|
||||||
(make clean) || (make clean && false)
|
(make clean) || (make clean && false)
|
||||||
|
cd "$(THIS_DIR)"
|
||||||
(make build) || (make clean && false)
|
(make build) || (make clean && false)
|
||||||
./run_tests.py || (make clean && false)
|
cd "$(THIS_DIR)"
|
||||||
echo "All tests pass!"
|
(./run_tests.py) || (make clean && false)
|
||||||
mv cargo.bak Cargo.toml
|
mv cargo.bak Cargo.toml
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
|
|
|
@ -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())
|
|
|
@ -67,6 +67,8 @@ fn main() {
|
||||||
|
|
||||||
if let Some(p) = matches.value_of("positional") {
|
if let Some(p) = matches.value_of("positional") {
|
||||||
println!("positional present with value: {}", p);
|
println!("positional present with value: {}", p);
|
||||||
|
} else {
|
||||||
|
println!("positional NOT present");
|
||||||
}
|
}
|
||||||
|
|
||||||
if matches.is_present("subcmd") {
|
if matches.is_present("subcmd") {
|
||||||
|
|
Loading…
Reference in a new issue