#!/bin/bash # Usage: # ./run_tests.sh 2>&1 | tee log.run_tests.txt THISSCRIPT=${0##*/} VERSION=1.0.2 APP_HOME=${APP_HOME:-Undefined} if [[ $APP_HOME == Undefined ]]; then cd .. || exit 1 source ./env.sh || exit 1 fi jobNewScriptVer=$(grep VERSION= $APP_HOME/../src/job-new.sh|cut -d '=' -f 2) echo "$THISSCRIPT v$VERSION testing job-new.sh v$jobNewScriptVer" echo Remove any jobs from the test server. for job in $(p4 -ztag -F %Job% jobs); do p4 job -d $job done echo "Running 7 tests (Pass 1)" for f in 1 2 3 4 5 6 7; do testFile=$APP_DATA/test-$f.job echo "Processing test file $testFile with job $job." cp -p -f $testFile foo.txt $APP_HOME/../src/job-new.sh foo.txt cat foo.txt p4 job -i < foo.txt done echo "Running 5 tests (Pass 2)" for f in 3 4 5 6 7; do testFile=$APP_DATA/test-$f.job job=$(grep Job: $testFile) job=${job#Job:} job=$(echo $job) echo "Re-Processing test file $testFile with job $job." cp -p -f $testFile foo.txt $APP_HOME/../src/job-new.sh foo.txt cat foo.txt p4 job -i < foo.txt done echo "Running 3 tests (Pass 3)" for f in 5 6 7; do testFile=$APP_DATA/test-$f.job job=$(grep Job: $testFile) job=${job#Job:} job=$(echo $job) echo "Re-Re-Processing test file $testFile with job $job." cp -p -f $testFile foo.txt $APP_HOME/../src/job-new.sh foo.txt cat foo.txt p4 job -i < foo.txt done /bin/rm -f foo.txt
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#4 | 12555 | C. Thomas Tyler |
Test suite improvements: * Test cases now describe expected results. * Removed junk files (log and foo.txt). * Removed 'p4s' utility script, made obsolete by using the P4PORT 'rsh hack' for the test suite. * URLs for wget recommendations updated to refer to 2015.1. * Enhanced run_tests.sh to fix ugly output to make test verification more readable. |
||
#3 | 12539 | C. Thomas Tyler |
Implemened features to transform job-new.sh into a general purpose job name validation script, in addition to the original mission of incrementing '-new' features, per requirements from Thomas Gray. Updated test suite accordingly. Also simplified the test suite, which now uses the P4PORT 'rsh hack' to avoid needing to fire up a test server. #review-12540 @thomas_gray @lester_cheung |
||
#2 | 12094 | C. Thomas Tyler |
Added version tags to job-new.sh and run-tests.sh. Removed debug statements from job-new.sh. Updated .p4ignore to avoid adding log file. Updated test suite to run multi-pass test. Added APP_DATA setting to env.sh. |
||
#1 | 12093 | C. Thomas Tyler | Added job-new.sh and friends. |