From aff2e7137b343c9642f4a921ea713d300a920a19 Mon Sep 17 00:00:00 2001 From: brainpower Date: Mon, 2 Jun 2014 01:02:04 +0200 Subject: [PATCH] * add a test --- cpp/tests/test01.bpt | 21 +++++++++++++++++++++ cpp/tests/test01_help.out | 5 +++++ 2 files changed, 26 insertions(+) create mode 100755 cpp/tests/test01.bpt create mode 100644 cpp/tests/test01_help.out diff --git a/cpp/tests/test01.bpt b/cpp/tests/test01.bpt new file mode 100755 index 0000000..6a7a152 --- /dev/null +++ b/cpp/tests/test01.bpt @@ -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 + +} diff --git a/cpp/tests/test01_help.out b/cpp/tests/test01_help.out new file mode 100644 index 0000000..04adb1d --- /dev/null +++ b/cpp/tests/test01_help.out @@ -0,0 +1,5 @@ +Usage: test_args [options] + +Options: + -h, --help show this help message and exit + -i, --input file to read from