Files
git-upstream/functional-tests/020-test_help.sh
Davide Guerri f2e38df455 Rename hpgit to git-upstream, also changing its license
* rename hpgit to git-upstream
* rename import-upstream commadn to import
* change all occurrences of hpgit and import-upstream in code,
  comments and tests
* code cleanup (remove some typos, improve PEP8 compliance)
* change license from "HP propietary" to "Apache License v2.0"

Change-Id: Ia4f00d662d79ac9725316027a65f4d23ebbd0f02
JIRA:CICD-1319
JIRA:CICD-1318
2014-03-03 14:32:26 +00:00

26 lines
773 B
Bash
Executable File

#!/bin/bash
BASE_DIR=$(cd $(dirname $0); pwd -P)
# Include and run common test functions and initializations
source $BASE_DIR/libs/logging.lib
source $BASE_DIR/libs/utils.lib
function test_help_output() {
local com="$1"
log DEBUG "Starting $TEST_NAME::$FUNCNAME command $com"
help1=$(git-upstream${com:+ }${com} --help)
help2=$(git-upstream${com:+ }${com} -h)
help3=$(git-upstream help${com:+ }${com})
[ -z "$help1" -o -z "$help2" -o -z "$help3" -o \
"$help1" != "$help2" -o "$help2" != "$help3" ] && return 1 || return 0
}
for com in "" "import" "drop" "supersede" ; do
test_help_output $com && log INFO "test_help_output::${com:-null} passed." || \
log ERROR "test_help_output::${com:-null} failed!"
done