aboutsummaryrefslogtreecommitdiffstats
path: root/test/suite-unittests.sh
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2014-07-06 12:22:03 -0400
committerEvan Huus <eapache@gmail.com>2014-07-12 12:08:13 +0000
commit5fda232659f25bedbf426dfc25f174119614229f (patch)
tree2ec4d6aec39903e14e63e7ce45d801927db252a1 /test/suite-unittests.sh
parent9e5e43ba449b4431f9db0cb77cd0fa3171acf7d4 (diff)
make unit-test suite work out-of-tree
Change-Id: I638015a9b55712bb6843d6756c9c55915e142372 Reviewed-on: https://code.wireshark.org/review/2893 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'test/suite-unittests.sh')
-rwxr-xr-xtest/suite-unittests.sh20
1 files changed, 15 insertions, 5 deletions
diff --git a/test/suite-unittests.sh b/test/suite-unittests.sh
index bf6168e9a3..83c44bedc3 100755
--- a/test/suite-unittests.sh
+++ b/test/suite-unittests.sh
@@ -60,33 +60,43 @@ unittests_step_test() {
test_step_ok
}
+set_dut() {
+ if [ "$SOURCE_DIR" = "$WS_BIN_PATH" -o "$WS_SYSTEM" = "Windows" ]; then
+ DUT=$SOURCE_DIR/epan/$1
+ else
+ # In out-of-tree builds, all bianries end up in the same folder
+ # regardless of their path during in-tree builds, so we strip
+ # off any prefix part of the path (such as wmem/ for wmem_test)
+ DUT=$WS_BIN_PATH/${1##*/}
+ fi
+}
unittests_step_exntest() {
- DUT=$SOURCE_DIR/epan/exntest
+ set_dut exntest
ARGS=
unittests_step_test
}
unittests_step_oids_test() {
- DUT=$SOURCE_DIR/epan/oids_test
+ set_dut oids_test
ARGS=
unittests_step_test
}
unittests_step_reassemble_test() {
- DUT=$SOURCE_DIR/epan/reassemble_test
+ set_dut reassemble_test
ARGS=
unittests_step_test
}
unittests_step_tvbtest() {
- DUT=$SOURCE_DIR/epan/tvbtest
+ set_dut tvbtest
ARGS=
unittests_step_test
}
unittests_step_wmem_test() {
- DUT=$SOURCE_DIR/epan/wmem/wmem_test
+ set_dut wmem/wmem_test
ARGS=--verbose
unittests_step_test
}