diff options
22 files changed, 97 insertions, 94 deletions
diff --git a/fsa/src/alltest/alltest.sh b/fsa/src/alltest/alltest.sh index 37274721e25..9225a9dafec 100755 --- a/fsa/src/alltest/alltest.sh +++ b/fsa/src/alltest/alltest.sh @@ -1,11 +1,22 @@ #!/bin/bash -./detector_test.sh -./fsa_test.sh +set -e + +# first create the FSA ./fsa_fsa_create_test_app -./fsa_fsa_perf_test_app -./fsa_fsamanager_test_app . __testfsa__.__fsa__ + +# simple tests ./lookup_test.sh +./fsa_test.sh +./detector_test.sh + +# advanced tests ./ngram_test.sh ./segmenter_test.sh ./vectorizer_test.sh + +# manager test +./fsa_fsamanager_test_app . __testfsa__.__fsa__ + +# perf tests ./fsa_vectorizer_perf_test_app +./fsa_fsa_perf_test_app diff --git a/jrt_test/src/tests/echo/dotest.sh b/jrt_test/src/tests/echo/dotest.sh index a4b9cc4d313..91b26c7f425 100644 --- a/jrt_test/src/tests/echo/dotest.sh +++ b/jrt_test/src/tests/echo/dotest.sh @@ -1,16 +1,17 @@ #!/bin/bash # Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -set -e + +fail=0 . ../../binref/env.sh export PORT_2 -sh $BINREF/progctl.sh progdefs.sh start javaserver 1 -$BINREF/runjava PollRPCServer tcp/localhost:$PORT_2 -$VALGRIND ./jrt_test_echo-client_app tcp/localhost:$PORT_2 > out.txt -sh $BINREF/progctl.sh progdefs.sh stop javaserver 1 +$BINREF/progctl.sh progdefs.sh start javaserver 1 +$BINREF/runjava PollRPCServer tcp/localhost:$PORT_2 || fail=1 +$VALGRIND ./jrt_test_echo-client_app tcp/localhost:$PORT_2 > out.txt || fail=1 +$BINREF/progctl.sh progdefs.sh stop javaserver 1 if diff -u out.txt ref.txt; then - exit 0 + exit $fail else exit 1 fi diff --git a/jrt_test/src/tests/echo/echo_test.sh b/jrt_test/src/tests/echo/echo_test.sh index 8b68357e606..997d8d42996 100755 --- a/jrt_test/src/tests/echo/echo_test.sh +++ b/jrt_test/src/tests/echo/echo_test.sh @@ -1,5 +1,6 @@ #!/bin/bash -set -e +fail=0 . ../../binref/env.sh -bash -e dotest.sh || (bash -e $BINREF/progctl.sh progdefs.sh stop all; false) -bash -e $BINREF/progctl.sh progdefs.sh stop all +bash ./dotest.sh || fail=1 +$BINREF/progctl.sh progdefs.sh stop all +exit $fail diff --git a/jrt_test/src/tests/echo/progdefs.sh b/jrt_test/src/tests/echo/progdefs.sh index d405f525e33..4a3053ad64e 100644 --- a/jrt_test/src/tests/echo/progdefs.sh +++ b/jrt_test/src/tests/echo/progdefs.sh @@ -1,4 +1,2 @@ -#!/bin/bash # Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -set -e prog javaserver 1 "tcp/$PORT_2" "$BINREF/runjava SimpleServer" diff --git a/jrt_test/src/tests/mandatory-methods/dotest.sh b/jrt_test/src/tests/mandatory-methods/dotest.sh index 6c7dfb2bbea..8cbd99c6988 100644 --- a/jrt_test/src/tests/mandatory-methods/dotest.sh +++ b/jrt_test/src/tests/mandatory-methods/dotest.sh @@ -1,15 +1,16 @@ #!/bin/bash # Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -set -e -sh $BINREF/progctl.sh progdefs.sh start javaserver 1 +fail=0 -./jrt_test_extract-reflection_app tcp/localhost:$PORT_1 verbose > out.txt +$BINREF/progctl.sh progdefs.sh start javaserver 1 || fail=1 -sh $BINREF/progctl.sh progdefs.sh stop javaserver 1 +./jrt_test_extract-reflection_app tcp/localhost:$PORT_1 verbose > out.txt || fail=1 + +$BINREF/progctl.sh progdefs.sh stop javaserver 1 || fail=1 if diff -u out.txt ref.txt; then - exit 0 + exit $fail else exit 1 fi diff --git a/jrt_test/src/tests/mandatory-methods/mandatory-methods_test.sh b/jrt_test/src/tests/mandatory-methods/mandatory-methods_test.sh index 81eb00776c8..c6ffbe4d3a1 100755 --- a/jrt_test/src/tests/mandatory-methods/mandatory-methods_test.sh +++ b/jrt_test/src/tests/mandatory-methods/mandatory-methods_test.sh @@ -1,10 +1,14 @@ #!/bin/bash -set -e + +fail=0 . ../../binref/env.sh export PORT_1 -$BINREF/compilejava RPCServer.java +$BINREF/compilejava RPCServer.java || fail=1 + +bash ./dotest.sh || fail=1 + +$BINREF/progctl.sh progdefs.sh stop all -bash -e dotest.sh || (bash -e $BINREF/progctl.sh progdefs.sh stop all; false) -bash -e $BINREF/progctl.sh progdefs.sh stop all +exit $fail diff --git a/jrt_test/src/tests/mandatory-methods/progdefs.sh b/jrt_test/src/tests/mandatory-methods/progdefs.sh index a376f7585ab..aa7ae4ab3ca 100644 --- a/jrt_test/src/tests/mandatory-methods/progdefs.sh +++ b/jrt_test/src/tests/mandatory-methods/progdefs.sh @@ -1,4 +1,2 @@ -#!/bin/bash # Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -set -e prog javaserver 1 "tcp/$PORT_1" "$BINREF/runjava RPCServer" diff --git a/jrt_test/src/tests/mockup-invoke/dotest.sh b/jrt_test/src/tests/mockup-invoke/dotest.sh index fcbdc16f92e..f7fcf007c56 100644 --- a/jrt_test/src/tests/mockup-invoke/dotest.sh +++ b/jrt_test/src/tests/mockup-invoke/dotest.sh @@ -1,20 +1,19 @@ #!/bin/bash # Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -set -e -sh $BINREF/progctl.sh progdefs.sh start server 1 +fail=0 -$BINREF/runjava PollRPCServer tcp/localhost:$PORT_0 -$BINREF/runjava MockupInvoke tcp/localhost:$PORT_0 aaa bbb > out.txt -$BINREF/runjava MockupInvoke tcp/localhost:$PORT_0 bbb ccc >> out.txt -$BINREF/runjava MockupInvoke tcp/localhost:$PORT_0 ccc ddd >> out.txt -$BINREF/runjava MockupInvoke tcp/localhost:$PORT_0 ddd eee >> out.txt -$BINREF/runjava MockupInvoke tcp/localhost:$PORT_0 eee fff >> out.txt +$BINREF/progctl.sh progdefs.sh start server 1 -sh $BINREF/progctl.sh progdefs.sh stop server 1 +$BINREF/runjava PollRPCServer tcp/localhost:$PORT_0 || fail=1 +$BINREF/runjava MockupInvoke tcp/localhost:$PORT_0 aaa bbb > out.txt || fail=1 +$BINREF/runjava MockupInvoke tcp/localhost:$PORT_0 bbb ccc >> out.txt || fail=1 +$BINREF/runjava MockupInvoke tcp/localhost:$PORT_0 ccc ddd >> out.txt || fail=1 +$BINREF/runjava MockupInvoke tcp/localhost:$PORT_0 ddd eee >> out.txt || fail=1 +$BINREF/runjava MockupInvoke tcp/localhost:$PORT_0 eee fff >> out.txt || fail=1 -if diff -u out.txt ref.txt; then - exit 0 -else - exit 1 -fi +$BINREF/progctl.sh progdefs.sh stop server 1 + +diff -u out.txt ref.txt || fail=1 + +exit $fail diff --git a/jrt_test/src/tests/mockup-invoke/mockup-invoke_test.sh b/jrt_test/src/tests/mockup-invoke/mockup-invoke_test.sh index 84343a7a60b..516b6abef63 100755 --- a/jrt_test/src/tests/mockup-invoke/mockup-invoke_test.sh +++ b/jrt_test/src/tests/mockup-invoke/mockup-invoke_test.sh @@ -1,11 +1,15 @@ #!/bin/bash -set -e + +fail=0 . ../../binref/env.sh export PORT_0 -$BINREF/compilejava MockupInvoke.java +$BINREF/compilejava MockupInvoke.java || fail=1 + +bash ./dotest.sh || fail=1 + +$BINREF/progctl.sh progdefs.sh stop all -bash -e dotest.sh || (bash -e $BINREF/progctl.sh progdefs.sh stop all; false) -bash -e $BINREF/progctl.sh progdefs.sh stop all +exit $fail diff --git a/jrt_test/src/tests/mockup-invoke/progdefs.sh b/jrt_test/src/tests/mockup-invoke/progdefs.sh index 6898513badc..4c483b8060b 100644 --- a/jrt_test/src/tests/mockup-invoke/progdefs.sh +++ b/jrt_test/src/tests/mockup-invoke/progdefs.sh @@ -1,4 +1,2 @@ -#!/bin/bash # Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -set -e prog server 1 "tcp/$PORT_0" "./jrt_test_mockup-server_app" diff --git a/jrt_test/src/tests/rpc-error/dotest.sh b/jrt_test/src/tests/rpc-error/dotest.sh index 58f74247536..df9cb4ac62a 100644 --- a/jrt_test/src/tests/rpc-error/dotest.sh +++ b/jrt_test/src/tests/rpc-error/dotest.sh @@ -1,6 +1,7 @@ #!/bin/bash # Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -set -e + +fail=0 . ../../binref/env.sh @@ -11,36 +12,30 @@ CPP_PORT=$PORT_4 export JAVA_PORT export CPP_PORT -sh $BINREF/progctl.sh progdefs.sh start cppserver 1 +$BINREF/progctl.sh progdefs.sh start cppserver 1 || fail=1 +$BINREF/runjava PollRPCServer tcp/localhost:$CPP_PORT || fail=1 -$BINREF/runjava PollRPCServer tcp/localhost:$CPP_PORT echo "CPP CLIENT <-> CPP SERVER" -./jrt_test_test-errors_app tcp/localhost:$CPP_PORT -if [ $? -ne 0 ]; then STATUS=fail; fi +./jrt_test_test-errors_app tcp/localhost:$CPP_PORT || fail=1 echo "JAVA CLIENT <-> CPP SERVER" -$BINREF/runjava TestErrors tcp/localhost:$CPP_PORT -if [ $? -ne 0 ]; then STATUS=fail; fi - -sh $BINREF/progctl.sh progdefs.sh stop cppserver 1 - +$BINREF/runjava TestErrors tcp/localhost:$CPP_PORT || fail=1 -sh $BINREF/progctl.sh progdefs.sh start javaserver 1 +$BINREF/progctl.sh progdefs.sh stop cppserver 1 +$BINREF/progctl.sh progdefs.sh start javaserver 1 +$BINREF/runjava PollRPCServer tcp/localhost:$JAVA_PORT || fail=1 -$BINREF/runjava PollRPCServer tcp/localhost:$JAVA_PORT echo "CPP CLIENT <-> JAVA SERVER" -./jrt_test_test-errors_app tcp/localhost:$JAVA_PORT -if [ $? -ne 0 ]; then STATUS=fail; fi +./jrt_test_test-errors_app tcp/localhost:$JAVA_PORT || fail=1 echo "JAVA CLIENT <-> JAVA SERVER" -$BINREF/runjava TestErrors tcp/localhost:$JAVA_PORT -if [ $? -ne 0 ]; then STATUS=fail; fi +$BINREF/runjava TestErrors tcp/localhost:$JAVA_PORT || fail=1 -sh $BINREF/progctl.sh progdefs.sh stop javaserver 1 +$BINREF/progctl.sh progdefs.sh stop javaserver 1 -if [ $STATUS = "ok" ]; then +if [ $fail = "0" ]; then echo "OK" else echo "FAIL" - exit 1 fi +exit $fail diff --git a/jrt_test/src/tests/rpc-error/progdefs.sh b/jrt_test/src/tests/rpc-error/progdefs.sh index cd915602b9e..815aa5a960e 100644 --- a/jrt_test/src/tests/rpc-error/progdefs.sh +++ b/jrt_test/src/tests/rpc-error/progdefs.sh @@ -1,5 +1,3 @@ -#!/bin/bash # Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -set -e prog cppserver 1 "tcp/$CPP_PORT" "$BINREF/simpleserver" prog javaserver 1 "tcp/$JAVA_PORT" "$BINREF/runjava SimpleServer" diff --git a/jrt_test/src/tests/rpc-error/rpc-error_test.sh b/jrt_test/src/tests/rpc-error/rpc-error_test.sh index c9f47cf10fa..bee324273b1 100755 --- a/jrt_test/src/tests/rpc-error/rpc-error_test.sh +++ b/jrt_test/src/tests/rpc-error/rpc-error_test.sh @@ -1,5 +1,6 @@ #!/bin/bash -set -e + +fail=0 . ../../binref/env.sh @@ -10,7 +11,10 @@ CPP_PORT=$PORT_4 export JAVA_PORT export CPP_PORT -$BINREF/compilejava TestErrors.java +$BINREF/compilejava TestErrors.java || fail=1 + +bash ./dotest.sh || fail=1 + +$BINREF/progctl.sh progdefs.sh stop all -bash -e dotest.sh || (bash -e $BINREF/progctl.sh progdefs.sh stop all; false) -bash -e $BINREF/progctl.sh progdefs.sh stop all +exit $fail diff --git a/jrt_test/src/tests/slobrok-api/dotest.sh b/jrt_test/src/tests/slobrok-api/dotest.sh index 23fcc88edc5..d5a4a35647e 100755 --- a/jrt_test/src/tests/slobrok-api/dotest.sh +++ b/jrt_test/src/tests/slobrok-api/dotest.sh @@ -1,15 +1,15 @@ #!/bin/bash # Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -set -e -. ../../binref/env.sh +fail=0 -ret=true +. ../../binref/env.sh export PORT_8 -sh $BINREF/progctl.sh progdefs.sh start slobrok 1 -${BINREF}/runjava SlobrokAPITest tcp/localhost:${PORT_8} || ret=false -${BINREF}/sbcmd ${PORT_8} slobrok.system.stop -sh $BINREF/progctl.sh progdefs.sh stop slobrok 1 +$BINREF/progctl.sh progdefs.sh start slobrok 1 +$BINREF/runjava SlobrokAPITest tcp/localhost:${PORT_8} || fail=1 +$BINREF/sbcmd ${PORT_8} slobrok.system.stop +$BINREF/progctl.sh progdefs.sh stop slobrok 1 + +exit $fail -$ret diff --git a/jrt_test/src/tests/slobrok-api/progdefs.sh b/jrt_test/src/tests/slobrok-api/progdefs.sh index 52db8009183..af694ab8ad4 100644 --- a/jrt_test/src/tests/slobrok-api/progdefs.sh +++ b/jrt_test/src/tests/slobrok-api/progdefs.sh @@ -1,4 +1,2 @@ -#!/bin/bash # Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -set -e prog slobrok 1 "-p $PORT_8" diff --git a/messagebus/test/src/tests/error/ctl.sh b/messagebus/test/src/tests/error/ctl.sh index 22178638fe1..864be4290ed 100755 --- a/messagebus/test/src/tests/error/ctl.sh +++ b/messagebus/test/src/tests/error/ctl.sh @@ -1,4 +1,4 @@ #!/bin/bash # Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -set -e -bash -e ../../binref/progctl.sh progdefs.sh "$@" + +exec ../../binref/progctl.sh progdefs.sh "$@" diff --git a/messagebus/test/src/tests/error/progdefs.sh b/messagebus/test/src/tests/error/progdefs.sh index 92cf767d495..2f6f37a9425 100644 --- a/messagebus/test/src/tests/error/progdefs.sh +++ b/messagebus/test/src/tests/error/progdefs.sh @@ -1,5 +1,3 @@ -#!/bin/bash # Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -set -e prog server cpp "" "./messagebus_test_cpp-server-error_app" prog server java "" "../../binref/runjava JavaServer" diff --git a/messagebus/test/src/tests/speed/ctl.sh b/messagebus/test/src/tests/speed/ctl.sh index 22178638fe1..864be4290ed 100755 --- a/messagebus/test/src/tests/speed/ctl.sh +++ b/messagebus/test/src/tests/speed/ctl.sh @@ -1,4 +1,4 @@ #!/bin/bash # Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -set -e -bash -e ../../binref/progctl.sh progdefs.sh "$@" + +exec ../../binref/progctl.sh progdefs.sh "$@" diff --git a/messagebus/test/src/tests/speed/progdefs.sh b/messagebus/test/src/tests/speed/progdefs.sh index ea6e05713f5..4e0390142cf 100644 --- a/messagebus/test/src/tests/speed/progdefs.sh +++ b/messagebus/test/src/tests/speed/progdefs.sh @@ -1,5 +1,3 @@ -#!/bin/bash # Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -set -e prog server cpp "" "./messagebus_test_cpp-server-speed_app" prog server java "" "../../binref/runjava JavaServer" diff --git a/messagebus/test/src/tests/trace/ctl.sh b/messagebus/test/src/tests/trace/ctl.sh index 22178638fe1..864be4290ed 100755 --- a/messagebus/test/src/tests/trace/ctl.sh +++ b/messagebus/test/src/tests/trace/ctl.sh @@ -1,4 +1,4 @@ #!/bin/bash # Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -set -e -bash -e ../../binref/progctl.sh progdefs.sh "$@" + +exec ../../binref/progctl.sh progdefs.sh "$@" diff --git a/messagebus/test/src/tests/trace/progdefs.sh b/messagebus/test/src/tests/trace/progdefs.sh index b3562f50bdd..fd35b6503e2 100644 --- a/messagebus/test/src/tests/trace/progdefs.sh +++ b/messagebus/test/src/tests/trace/progdefs.sh @@ -1,6 +1,4 @@ -#!/bin/bash # Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -set -e prog server cpp1 "" "./messagebus_test_cpp-server-trace_app server/cpp/1/A" prog server cpp2 "" "./messagebus_test_cpp-server-trace_app server/cpp/2/A" prog server cpp3 "" "./messagebus_test_cpp-server-trace_app server/cpp/2/B" diff --git a/vespalib/src/vespa/vespalib/testkit/progctl.sh b/vespalib/src/vespa/vespalib/testkit/progctl.sh index 5cd53dd0f62..918075dabbc 100755 --- a/vespalib/src/vespa/vespalib/testkit/progctl.sh +++ b/vespalib/src/vespa/vespalib/testkit/progctl.sh @@ -1,6 +1,5 @@ #!/bin/bash # Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -set -e # define prog entry (called from progdefs file) # $1 - program name |