3 # Run the epan unit tests
5 # Wireshark - Network traffic analyzer
6 # By Gerald Combs <gerald@wireshark.org>
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License
10 # as published by the Free Software Foundation; either version 2
11 # of the License, or (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 unittests_step_test() {
24 $DUT $ARGS > testout.txt 2>&1
26 if [ ! $RETURNVALUE -eq $EXIT_OK ]; then
29 test_step_failed "exit status of $DUT: $RETURNVALUE"
39 $WS_BIN_PATH/epan/wmem
47 # WS_BIN_PATH must be checked first, otherwise
48 # we'll find a non-functional program in epan or epan/wmem.
49 for TEST_PATH in $TOOL_SEARCH_PATHS ; do
50 if [ -x "$TEST_PATH/$1" ]; then
51 TEST_EXE=$TEST_PATH/$1
56 if [ -n "$TEST_EXE" ]; then
57 if [[ "$WS_SYSTEM" == "Windows" && "$TEST_EXE" == *.py ]] ; then
58 SCRIPT_PATH=$( cygpath -w "$TEST_EXE" )
59 TSHARK_PATH=$( cygpath -w "$TSHARK" )
60 DUT="python $SCRIPT_PATH"
66 test_step_failed "$1 not found. Have you built test-programs?"
71 unittests_step_exntest() {
72 check_dut exntest || return
77 unittests_step_oids_test() {
78 check_dut oids_test || return
83 unittests_step_reassemble_test() {
84 check_dut reassemble_test || return
89 unittests_step_tvbtest() {
90 check_dut tvbtest || return
95 unittests_step_wmem_test() {
96 check_dut wmem_test || return
101 unittests_step_ftsanity() {
102 check_dut ftsanity.py || return
107 unittests_step_fieldcount() {
108 check_dut tshark || return
113 unittests_cleanup_step() {
118 test_step_set_pre unittests_cleanup_step
119 test_step_set_post unittests_cleanup_step
120 test_step_add "exntest" unittests_step_exntest
121 test_step_add "oids_test" unittests_step_oids_test
122 test_step_add "reassemble_test" unittests_step_reassemble_test
123 test_step_add "tvbtest" unittests_step_tvbtest
124 test_step_add "wmem_test" unittests_step_wmem_test
125 test_step_add "ftsanity.py" unittests_step_ftsanity
126 test_step_add "field count" unittests_step_fieldcount
129 # Editor modelines - http://www.wireshark.org/tools/modelines.html
134 # indent-tabs-mode: t
137 # vi: set shiftwidth=8 tabstop=8 noexpandtab:
138 # :indentSize=8:tabSize=8:noTabs=false: