Skip to content

Commit

Permalink
* add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
brainpower committed Jun 1, 2014
1 parent 6af226d commit aff2e71
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
21 changes: 21 additions & 0 deletions cpp/tests/test01.bpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

name="checkarg"
type="cpp"
sources=("test_args.cpp" "../libcheckarg.a")

prepare(){
compile_sources
}

run(){

test_rc "--help return code" 0 --help
test_rc "-h return code" 0 -h

test_stdout "help output" test01_help.out --help

test_rc "missing value" 4 -i
test_rc "invalid option" 2 -x
test_rc "correct value" 0 -i input.in

}
5 changes: 5 additions & 0 deletions cpp/tests/test01_help.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Usage: test_args [options]

Options:
-h, --help show this help message and exit
-i, --input file to read from

0 comments on commit aff2e71

Please sign in to comment.