Create a special category for 'benchmarks' test, and don't run
  them by default unless we are told to.

  Also some really minor cosmetic changes to the ock_test.sh script

Signed-off-by: Klaus Heinrich Kiwi <[email protected]>
---
 testcases/driver/Makefile.am |    4 ++--
 testcases/ock_tests.sh.in    |   26 +++++++++++++++++++++++---
 2 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/testcases/driver/Makefile.am b/testcases/driver/Makefile.am
index c395d82..050165c 100755
--- a/testcases/driver/Makefile.am
+++ b/testcases/driver/Makefile.am
@@ -1,7 +1,7 @@
 noinst_PROGRAMS=aes_tests des_tests des3_tests digest_tests \
                dsa_tests misc_tests obj_mgmt_tests rsa_tests \
                dh_tests ssl3_tests rijndael_tests sess_mgmt_tests \
-               sess_perf_tests
+               sess_bench
 
 AM_CFLAGS=-I. -I../../usr/include/pkcs11 -I../include 
-I../../usr/lib/pkcs11/common -Wall
 
@@ -19,4 +19,4 @@ rsa_tests_SOURCES = rsa_func.c
 ssl3_tests_SOURCES = ssl3_func.c
 obj_mgmt_tests_SOURCES = obj_mgmt.c
 sess_mgmt_tests_SOURCES = sess_mgmt.c
-sess_perf_tests_SOURCES = sess_perf.c
+sess_bench_SOURCES = sess_perf.c
diff --git a/testcases/ock_tests.sh.in b/testcases/ock_tests.sh.in
index bfbd47f..3f04560 100755
--- a/testcases/ock_tests.sh.in
+++ b/testcases/ock_tests.sh.in
@@ -57,6 +57,7 @@ TOKTYPE=""
 # v2.11/login MUST come last if it appears in this list
 #
 OCK_TESTS="oc-digest/digest_tests.sh driver/*tests"
+OCK_BENCHS="driver/*bench"
 
 usage()
 {
@@ -68,6 +69,7 @@ usage()
                -q        run quietly - display only total number of tests 
passed/failed
                -s <slot> slot against which the testcases will run
                -n        don't stop in case one of the testcases fail
+                -b        also run benchmarks or performance tests
        END
        exit -1
 }
@@ -228,19 +230,33 @@ check_env()
 
 ###
 ## run_tests() - run tests for a specific slot,
-##               following $OCK_DEST order
+##               following $OCK_TEST order
 ## $1 - the slot
 ###
 run_tests()
 {
-       echo "Will run the following tests for slot $1: $(ls -U $OCK_TESTS)"
+       echo "***** Will run the following tests for slot $1: $(ls -U 
$OCK_TESTS)"
        for i in $( ls -U $OCK_TESTS )
        do
-               echo "=====Now executing '$i'======"
+               echo "** Now executing '$i'"
                $i -slot $1 $NO_STOP 2>&1
        done
 }
 
+###
+## run_benchs() - run benchmarks for a specific slot,
+##                following $OCK_BENCH order
+## $1 - the slot
+###
+run_benchs()
+{
+       echo "***** Will run the following benchmarks for slot $1: $(ls -U 
$OCK_BENCHS)"
+       for i in $( ls -U $OCK_BENCHS )
+       do
+               echo "** Now executing '$i"
+               $i -slot $1 $NO_STOP 2>&1
+       done
+}
 main_script()
 {
         # check generic stuff first
@@ -259,6 +275,7 @@ main_script()
                 check_slot $i || { echo "SKIPPING slot $i"; continue; }
                 init_slot $i || { echo "SKIPPING slot $i"; continue; }
                 run_tests $i
+                [ -n "$BENCHMARK" ] && run_benchs $i
         done
 }
 
@@ -286,6 +303,9 @@ do
                s)
                        SLOT="$OPTARG"
                        ;;
+                b)
+                        BENCHMARK="yes"
+                        ;;
        esac
 done
 
-- 
1.7.2.2


------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Opencryptoki-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opencryptoki-tech

Reply via email to