From: Garrett C. <ris...@li...> - 2010-07-06 00:40:28
|
The branch, pu, has been updated via 7da13d4fc396f5c2e0afa4cd37ab2a9236607c12 (commit) via f993a1dcedee2b60bdb1731507b5c063af060490 (commit) via a6a5dba5a420896edf184669d871971e1cf52c56 (commit) via dd845c2f6209f370c89b28d34ff6d204fa32c0c7 (commit) via 84e052d5087dd3bc469f6a02de3b7abd774c4df5 (commit) via d8dd9700830563280c60dcabe5b9c13bc11763b0 (commit) via e7160e77fc728e7defab7574f60713d9e33a0d49 (commit) via 3b808b433b22516d2eecd95aa2ba67dbf057e975 (commit) via 0cc96ccac4c9ea57f7c64934af42c8cd43ad6da4 (commit) via a3acfa7e5751f5c93aff5685fb1c0997bd3d7311 (commit) from 070138c410944469346ff6823fc3df58a5e2da6f (commit) - Log ----------------------------------------------------------------- commit 7da13d4fc396f5c2e0afa4cd37ab2a9236607c12 Author: Garrett Cooper <yan...@gm...> Date: Mon Jul 5 17:36:32 2010 -0700 Remove another [now] autogenerated file. Signed-off-by: Garrett Cooper <yan...@gm...> commit f993a1dcedee2b60bdb1731507b5c063af060490 Author: Garrett Cooper <yan...@gm...> Date: Mon Jul 5 17:35:31 2010 -0700 Remove [now] autogenerated file. Signed-off-by: Garrett Cooper <yan...@gm...> commit a6a5dba5a420896edf184669d871971e1cf52c56 Author: Garrett Cooper <yan...@gm...> Date: Mon Jul 5 17:31:21 2010 -0700 Improve usability in test harness script. Signed-off-by: Garrett Cooper <yan...@gm...> commit dd845c2f6209f370c89b28d34ff6d204fa32c0c7 Author: Garrett Cooper <yan...@gm...> Date: Mon Jul 5 17:24:52 2010 -0700 You aren't needed anymore. Signed-off-by: Garrett Cooper <yan...@gm...> commit 84e052d5087dd3bc469f6a02de3b7abd774c4df5 Author: Garrett Cooper <yan...@gm...> Date: Mon Jul 5 17:23:39 2010 -0700 Bye bye useless script... Signed-off-by: Garrett Cooper <yan...@gm...> commit d8dd9700830563280c60dcabe5b9c13bc11763b0 Author: Garrett Cooper <yan...@gm...> Date: Mon Jul 5 17:23:07 2010 -0700 Clean up run.sh, fix shebang, whitespace. Signed-off-by: Garrett Cooper <yan...@gm...> commit e7160e77fc728e7defab7574f60713d9e33a0d49 Author: Garrett Cooper <yan...@gm...> Date: Mon Jul 5 17:18:41 2010 -0700 Remove some run.sh scripts. Signed-off-by: Garrett Cooper <yan...@gm...> commit 3b808b433b22516d2eecd95aa2ba67dbf057e975 Author: Garrett Cooper <yan...@gm...> Date: Mon Jul 5 17:02:52 2010 -0700 Add install target; shuffle around/cleanup code. Signed-off-by: Garrett Cooper <yan...@gm...> commit 0cc96ccac4c9ea57f7c64934af42c8cd43ad6da4 Author: Garrett Cooper <yan...@gm...> Date: Mon Jul 5 17:02:00 2010 -0700 Use generated run.sh instead in Makefile for test. Signed-off-by: Garrett Cooper <yan...@gm...> commit a3acfa7e5751f5c93aff5685fb1c0997bd3d7311 Author: Garrett Cooper <yan...@gm...> Date: Mon Jul 5 16:59:23 2010 -0700 Shuffle around code; generate run.sh for install. Signed-off-by: Garrett Cooper <yan...@gm...> ----------------------------------------------------------------------- Summary of changes: testcases/open_posix_testsuite/Makefile | 28 ++++++--- .../open_posix_testsuite/functional/mqueues/run.sh | 53 ----------------- .../functional/semaphores/run.sh | 53 ----------------- .../functional/threads/pi_test/run.sh | 49 --------------- .../functional/threads/robust_test/run.sh | 33 ---------- .../open_posix_testsuite/functional/timers/run.sh | 62 -------------------- .../open_posix_testsuite/scripts/exec-func.sh | 8 --- .../scripts/generate-makefiles.sh | 40 ++++++------- .../open_posix_testsuite/scripts/print-prefix.sh | 10 +++ testcases/open_posix_testsuite/scripts/run-test.sh | 61 +++++++++++++++----- .../open_posix_testsuite/stress/mqueues/run.sh | 50 ---------------- .../open_posix_testsuite/stress/semaphores/run.sh | 48 --------------- 12 files changed, 95 insertions(+), 400 deletions(-) delete mode 100755 testcases/open_posix_testsuite/functional/mqueues/run.sh delete mode 100755 testcases/open_posix_testsuite/functional/semaphores/run.sh delete mode 100755 testcases/open_posix_testsuite/functional/threads/pi_test/run.sh delete mode 100755 testcases/open_posix_testsuite/functional/threads/robust_test/run.sh delete mode 100755 testcases/open_posix_testsuite/functional/timers/run.sh delete mode 100644 testcases/open_posix_testsuite/scripts/exec-func.sh create mode 100755 testcases/open_posix_testsuite/scripts/print-prefix.sh mode change 100644 => 100755 testcases/open_posix_testsuite/scripts/run-test.sh delete mode 100755 testcases/open_posix_testsuite/stress/mqueues/run.sh delete mode 100755 testcases/open_posix_testsuite/stress/semaphores/run.sh diff --git a/testcases/open_posix_testsuite/Makefile b/testcases/open_posix_testsuite/Makefile index 5661d6a..1c08bae 100644 --- a/testcases/open_posix_testsuite/Makefile +++ b/testcases/open_posix_testsuite/Makefile @@ -51,12 +51,9 @@ generate-makefiles: distclean-makefiles @export top_srcdir=$(top_srcdir); \ $(top_srcdir)/scripts/generate-makefiles.sh -$(CRITICAL_MAKEFILES): \ - $(top_srcdir)/scripts/generate-makefiles.sh \ - $(top_srcdir)/CFLAGS \ - $(top_srcdir)/LDFLAGS \ - $(top_srcdir)/LDLIBS - $(MAKE) generate-makefiles +install: conformance-install functional-install stress-install + install -m 0755 scripts/run-test.sh \ + $(DESTDIR)/`$(SHELL) $(top_srcdir)/scripts/print-prefix.sh`/. tools: $(MAKE) -C tools all @@ -66,25 +63,38 @@ conformance-all: $(CRITICAL_CONFORMANCE_MAKEFILE) @rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@ @$(BUILD_MAKE) -C conformance all +conformance-install: + $(MAKE) -C conformance install + conformance-test: - @rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@ $(MAKE) -C conformance test functional-all: $(CRITICAL_FUNCTIONAL_MAKEFILE) @rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@ @$(BUILD_MAKE) -C functional all +functional-install: + $(MAKE) -C functional install + functional-test: - @rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@ $(MAKE) -C functional test stress-all: $(CRITICAL_STRESS_MAKEFILE) @rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@ @$(BUILD_MAKE) -C stress all +stress-install: + $(MAKE) -C stress install + stress-test: - @rm -f `if echo "$(LOGFILE)" | grep -q '^/'; then echo "$(LOGFILE)"; else echo "\`pwd\`/$(LOGFILE)"; fi`.$@ $(MAKE) -C stress test +$(CRITICAL_MAKEFILES): \ + $(top_srcdir)/scripts/generate-makefiles.sh \ + $(top_srcdir)/CFLAGS \ + $(top_srcdir)/LDFLAGS \ + $(top_srcdir)/LDLIBS + $(MAKE) generate-makefiles + #tests-pretty: # $(MAKE) all | column -t -s: diff --git a/testcases/open_posix_testsuite/functional/mqueues/run.sh b/testcases/open_posix_testsuite/functional/mqueues/run.sh deleted file mode 100755 index 95606df..0000000 --- a/testcases/open_posix_testsuite/functional/mqueues/run.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh -# Copyright (c) 2002, Intel Corporation. All rights reserved. -# Created by: crystal.xiong REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. -# -# Run all the tests in the message queues functional area. - -# Helper functions -RunTest() -{ - echo "TEST: " $1 - : $(( TOTAL += 1 )) - ./$1 - if [ $? -eq 0 ]; then - : $(( PASS += 1 )) - echo " ***TEST PASSED***" - echo "" - else - : $(( FAIL += 1 )) - echo " ***TEST FAILED***" - echo "" - fi -} - -# Main program - -TOTAL=0 -PASS=0 -FAIL=0 - -# Add lists of tests to these variables for execution -TESTS="notify.test send_rev_1.test send_rev_2.test" - -echo "Run the message queue functional tests" -echo "=====================" - -for test in $TESTS; do - RunTest $test -done - -cat <<EOF - **************** - * TOTAL: $TOTAL - * PASSED: $PASS - * FAILED: $FAIL - **************** -EOF - -exit 0 - - diff --git a/testcases/open_posix_testsuite/functional/semaphores/run.sh b/testcases/open_posix_testsuite/functional/semaphores/run.sh deleted file mode 100755 index 282c64e..0000000 --- a/testcases/open_posix_testsuite/functional/semaphores/run.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh -# Copyright (c) 2002, Intel Corporation. All rights reserved. -# Created by: crystal.xiong REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. -# -# Run all the tests in the semaphore functional area. - -# Helper functions -RunTest() -{ - echo "TEST: " $1 - : $(( TOTAL += 1 )) - ./$1 - if [ $? -eq 0 ]; then - : $(( PASS += 1 )) - echo " ***TEST PASSED***" - echo "" - else - : $(( FAIL += 1 )) - echo " ***TEST FAILED***" - echo "" - fi -} - -# Main program - -TOTAL=0 -PASS=0 -FAIL=0 - -# Add lists of tests to these variables for execution -TESTS="sem_conpro.test sem_lock.test sem_philosopher.test sem_readerwriter.test sem_sleepingbarber.test" - -echo "Run the semaphore functional tests" -echo "=====================" - -for test in $TESTS; do - RunTest $test -done - -cat <<EOF - **************** - * TOTAL: $TOTAL - * PASSED: $PASS - * FAILED: $FAIL - **************** -EOF - -exit 0 - - diff --git a/testcases/open_posix_testsuite/functional/threads/pi_test/run.sh b/testcases/open_posix_testsuite/functional/threads/pi_test/run.sh deleted file mode 100755 index 1f95c55..0000000 --- a/testcases/open_posix_testsuite/functional/threads/pi_test/run.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -PRIORITY=20 -# If users run pi tests from sshd, they need to improve the priority -# sshd using the following command. - -# chrt -p -f $PRIORITY $PPID - -# If users run pi test from console, they need to add the prioirity -# of the shell using the following command. - -# chrt -p -f $PRIORITY $$ - -killall -9 watchdogtimer.sh -rm -rf output.* -../tools/watchdogtimer.sh & - -TOTAL=0 -FAIL=0 -PASS=0 - -Run() -{ - echo "TEST: " $1 - : $(( TOTAL += 1 )) - ./$1 > output.$1 - if [ $? -eq 0 ]; then - : $(( PASS += 1 )) - echo " ***TEST PASSED***" - echo "" - else - : $(( FAIL += 1 )) - echo " ***TEST FAILED***" - echo "" - fi -} - -TESTS="pitest-1 pitest-2 pitest-3 pitest-4 pitest-5 pitest-6" - -for test in $TESTS; do - Run $test -done - -cat <<EOF - ***************** - * TOTAL: $TOTAL * - * PASSED: $PASS * - * FAILED: $FAIL * - ***************** -EOF diff --git a/testcases/open_posix_testsuite/functional/threads/robust_test/run.sh b/testcases/open_posix_testsuite/functional/threads/robust_test/run.sh deleted file mode 100755 index bb04519..0000000 --- a/testcases/open_posix_testsuite/functional/threads/robust_test/run.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -TOTAL=0 -FAIL=0 -PASS=0 -Run() -{ - echo "TEST: " $1 - : $(( TOTAL += 1 )) - ./$1 - if [ $? -eq 0 ]; then - : $(( PASS += 1 )) - echo " ***TEST PASSED***" - echo "" - else - : $(( FAIL += 1 )) - echo " ***TEST FAILED***" - echo "" - fi -} -TESTS="robust1-sun robust2-sun robust1-mode2 robust2-mode2 robust3-mode2" - -for test in $TESTS; do - Run $test -done - -cat <<EOF - ***************** - * TOTAL: $TOTAL * - * PASSED: $PASS * - * FAILED: $FAIL * - ***************** -EOF diff --git a/testcases/open_posix_testsuite/functional/timers/run.sh b/testcases/open_posix_testsuite/functional/timers/run.sh deleted file mode 100755 index 8832eca..0000000 --- a/testcases/open_posix_testsuite/functional/timers/run.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/sh -# Copyright (c) 2002, Intel Corporation. All rights reserved. -# Created by: julie.n.fleischer REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. -# -# Run all the tests in the functional/timers area. - -# Helper functions -RunTest() -{ - echo "TEST: " $1 - : $(( TOTAL += 1 )) - $1 - if [ $? -eq 0 ]; then - : $(( PASS += 1 )) - echo " ***TEST PASSED***" - echo "" - else - : $(( FAIL += 1 )) - echo " ***TEST FAILED***" - echo "" - fi -} - -# Main program - -TOTAL=0 -PASS=0 -FAIL=0 - -# Add lists of tests to these variables for execution -CLOCKSTESTS="clocks/twopsetclock.test" -TIMERSTESTS="timers/twoevtimers.test timers/twoptimers.test" - -echo "Run the clocks and timers functional tests" -echo "=====================" - -echo "Run clocks tests" -echo "========" - -for test in $CLOCKSTESTS; do - RunTest $test -done - -echo "Run timers tests" -echo "========" - -for test in $TIMERSTESTS; do - RunTest $test -done - -cat <<EOF - **************** - * TOTAL: $TOTAL - * PASSED: $PASS - * FAILED: $FAIL - **************** -EOF - -exit 0 diff --git a/testcases/open_posix_testsuite/scripts/exec-func.sh b/testcases/open_posix_testsuite/scripts/exec-func.sh deleted file mode 100644 index 82c228e..0000000 --- a/testcases/open_posix_testsuite/scripts/exec-func.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -for d in $(./locate-test --frun); do - echo "Testing $d" - pushd $d >/dev/null - ./run.sh - popd >/dev/null -done diff --git a/testcases/open_posix_testsuite/scripts/generate-makefiles.sh b/testcases/open_posix_testsuite/scripts/generate-makefiles.sh index 6127a2d..925bfe4 100755 --- a/testcases/open_posix_testsuite/scripts/generate-makefiles.sh +++ b/testcases/open_posix_testsuite/scripts/generate-makefiles.sh @@ -103,8 +103,8 @@ EOF fi cat >> "$makefile.2" <<EOF -INSTALL_TARGETS+= ${prereq_cache} +INSTALL_TARGETS+= ${prereq_cache} MAKE_TARGETS+= ${make_target_prereq_cache} EOF @@ -115,19 +115,26 @@ EOF all: \$(MAKE_TARGETS) clean: - rm -f \$(MAKE_TARGETS) logfile* *.core - -install: \$(INSTALL_DIR) - for i in \$(INSTALL_TARGETS); do \\ - install \$\$i \$(INSTALL_DIR)/\$\$i;\\ + rm -f \$(MAKE_TARGETS) logfile* run.sh *.core + +install: \$(INSTALL_DIR) run.sh + set -e; for file in \$(INSTALL_TARGETS); do \\ + if [ -f "\$\$file" ] ; then \\ + install -m 00755 \$\$file \\ + \$(INSTALL_DIR)/\$\$file; \\ + fi; \\ done -test: all - \$(top_srcdir)/scripts/run-test.sh \$(MAKE_TARGETS) +test: all run.sh + \$(SHELL) ./run.sh \$(INSTALL_DIR): mkdir -p \$@ +run.sh: + @echo '#/bin/sh' > \$@ + @echo '\$(top_srcdir)/run-test.sh \$(INSTALL_TARGETS)' >> \$@ + EOF fi @@ -135,7 +142,7 @@ EOF # Produce _awesome_ target rules for everything that needs it. for prereq in ${make_target_prereq_cache}; do - test_name=$(echo "$prereq" | sed -e "s,.$suffix,,") + test_name=`echo "$prereq" | sed -e "s,.$suffix,,"` c_file="$test_name.c" case "$suffix" in @@ -176,7 +183,7 @@ generate_makefiles() { while read filename; do - prereq_dir=$(dirname "$filename") + prereq_dir=`dirname "$filename"` # First run. if [ "$prereq_cache_dir" = "" ] ; then @@ -196,7 +203,7 @@ generate_makefiles() { if [ "$prereq_cache" != "" ] ; then prereq_cache="$prereq_cache " fi - prereq_cache="$prereq_cache$(basename "$filename" | sed "s,.c\$,.$suffix,g")" + prereq_cache="$prereq_cache"`basename "$filename" | sed "s,.c\$,.$suffix,g"` done < $make_gen_list @@ -205,19 +212,10 @@ generate_makefiles() { } -DEFAULT_PREFIX= - -if uname -a | grep -iq linux -then - DEFAULT_PREFIX=/opt -else - DEFAULT_PREFIX=/usr/local -fi - export PATH="$PATH:`dirname "$0"`" AUTHORDATE=`grep "Garrett Cooper" "$0" | head -n 1 | sed 's,# *,,'` -PREFIX=${PREFIX:=$DEFAULT_PREFIX/openposix_testsuite} +PREFIX=`print-prefix.sh` EXEC_PREFIX="${PREFIX}/bin" TOP_SRCDIR=${TOP_SRCDIR:=`dirname "$0"`/..} diff --git a/testcases/open_posix_testsuite/scripts/print-prefix.sh b/testcases/open_posix_testsuite/scripts/print-prefix.sh new file mode 100755 index 0000000..5a552b8 --- /dev/null +++ b/testcases/open_posix_testsuite/scripts/print-prefix.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +if uname -a | grep -iq linux +then + DEFAULT_PREFIX=/opt +else + DEFAULT_PREFIX=/usr/local +fi + +echo ${PREFIX:=$DEFAULT_PREFIX/openposix_testsuite} diff --git a/testcases/open_posix_testsuite/scripts/run-test.sh b/testcases/open_posix_testsuite/scripts/run-test.sh old mode 100644 new mode 100755 index 88416bb..6c8720e --- a/testcases/open_posix_testsuite/scripts/run-test.sh +++ b/testcases/open_posix_testsuite/scripts/run-test.sh @@ -6,9 +6,38 @@ # run_test contains logic moved out of Makefile. # # Garrett Cooper, June 2010 +# + +LOGFILE=${LOGFILE:=logfile} + +NUM_FAIL=0 +NUM_PASS=0 +NUM_TESTS=0 run_test_loop() { - for i in + + for test in $*; do + + if run_test $test; then + : $(( NUM_PASS += 1 )) + else + : $(( NUM_FAIL += 1 )) + fi + : $(( NUM_TESTS += 1 )) + + done + + cat <<EOF +***************** +SUMMARY +***************** +PASS $NUM_PASS +FAIL $NUM_FAIL +***************** +TOTAL $NUM_TESTS +***************** +EOF + } run_test() { @@ -17,7 +46,7 @@ run_test() { complog=$testname.log.$$ - "$(dirname "$0")/t0" ./$1 > $complog 2>&1 + $SHELL -c "'$(dirname "$0")/t0' ./$1" > $complog 2>&1 ret_code=$? @@ -55,18 +84,22 @@ run_test() { } # SETUP -if [ "x$1" = x ]; then - LOGFILE=/dev/stdout -elif echo > "$1"; then - echo >&2 "ERROR: $1 not readable" +if echo > "$LOGFILE"; then + : else - LOGFILE=$1 -fi -TIMEOUT_RET=$(cat "$(dirname "$0")/t0.val") -TIMEOUT_VAL=${TIMEOUT_VAL:=240} -if [ -f test_defs ] ; then - . ./test_defs || exit $? + echo >&2 "ERROR: $LOGFILE not writable" + exit 1 fi +if TIMEOUT_RET=$(cat "$(dirname "$0")/t0.val"); then + TIMEOUT_VAL=${TIMEOUT_VAL:=240} + if [ -f test_defs ] ; then + . ./test_defs || exit $? + fi + trap '' INT -# RUN -run_test "$@" + # RUN + run_test_loop $@ + exit $NUM_FAIL +else + exit $? +fi diff --git a/testcases/open_posix_testsuite/stress/mqueues/run.sh b/testcases/open_posix_testsuite/stress/mqueues/run.sh deleted file mode 100755 index 37f34d8..0000000 --- a/testcases/open_posix_testsuite/stress/mqueues/run.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -# Copyright (c) 2002, Intel Corporation. All rights reserved. -# Created by: crystal.xiong REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. -# -# Run all the tests in the message queues stress area. - -# Helper functions -RunTest() -{ - echo "TEST: " $1 $2 - TOTAL=$TOTAL+1 - ./$1 $2 - if [ $? == 0 ]; then - PASS=$PASS+1 - echo -ne "\t\t\t***TEST PASSED***\n\n" - else - FAIL=$FAIL+1 - echo -ne "\t\t\t***TEST FAILED***\n\n" - fi -} - -# Main program - -declare -i TOTAL=0 -declare -i PASS=0 -declare -i FAIL=0 - -# Add lists of tests to these variables for execution -TESTS="multi_send_rev_1.test multi_send_rev_2.test" - -echo "Run the message queue stress tests" -echo "==========================================" - -RunTest multi_send_rev_1.test 10 -RunTest multi_send_rev_2.test 100 - - -echo -echo -ne "\t\t****************\n" -echo -ne "\t\t* TOTAL: " $TOTAL "\n" -echo -ne "\t\t* PASSED: " $PASS "\n" -echo -ne "\t\t* FAILED: " $FAIL "\n" -echo -ne "\t\t****************\n" - -exit 0 - - diff --git a/testcases/open_posix_testsuite/stress/semaphores/run.sh b/testcases/open_posix_testsuite/stress/semaphores/run.sh deleted file mode 100755 index 8812b56..0000000 --- a/testcases/open_posix_testsuite/stress/semaphores/run.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# Copyright (c) 2002, Intel Corporation. All rights reserved. -# Created by: crystal.xiong REMOVE-THIS AT intel DOT com -# This file is licensed under the GPL license. For the full content -# of this license, see the COPYING file at the top level of this -# source tree. -# -# Run all the tests in the semaphore stress area. - -# Helper functions -RunTest() -{ - echo "TEST: " $1 $2 - TOTAL=$TOTAL+1 - ./$1 $2 - if [ $? == 0 ]; then - PASS=$PASS+1 - echo -ne "\t\t\t***TEST PASSED***\n\n" - else - FAIL=$FAIL+1 - echo -ne "\t\t\t***TEST FAILED***\n\n" - fi -} - -# Main program - -declare -i TOTAL=0 -declare -i PASS=0 -declare -i FAIL=0 - -# Add lists of tests to these variables for execution -TESTS="multi_con_pro.test" - -echo "Run the semaphore stress tests" -echo "==========================================" - -RunTest $TESTS 100 - -echo -echo -ne "\t\t****************\n" -echo -ne "\t\t* TOTAL: " $TOTAL "\n" -echo -ne "\t\t* PASSED: " $PASS "\n" -echo -ne "\t\t* FAILED: " $FAIL "\n" -echo -ne "\t\t****************\n" - -exit 0 - - hooks/post-receive -- ltp |