summaryrefslogtreecommitdiffstats
path: root/tests/test-subr.sh
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2012-07-24 19:18:52 +0200
committerMark Wielaard <[email protected]>2012-08-16 22:26:23 +0200
commita985e57862fa0aed33314de079cd44908a6b59cc (patch)
tree48cf2608fa327f91af1552febfb0ccdaef1cf3d8 /tests/test-subr.sh
parentf75e849377bc5a8402fb794622f22d9fd4f661be (diff)
tests: Add C++ self test binary.
Only build and tested by self tests if a g++ with C++x0 is available. Almost empty C++ program, can be extended to test more features. Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'tests/test-subr.sh')
-rw-r--r--tests/test-subr.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test-subr.sh b/tests/test-subr.sh
index e05d22a5..c78795f2 100644
--- a/tests/test-subr.sh
+++ b/tests/test-subr.sh
@@ -109,11 +109,21 @@ self_test_files=`echo ../src/addr2line ../src/elfcmp ../src/elflint \
../src/size ../src/strip ../libelf/libelf.so ../libdw/libdw.so \
../libasm/libasm.so ../backends/libebl_*.so`
+# Prebuild binary in case we don't have a C++11 capable compiler around.
+extra_self_test_files=testfile-cxx-various
+self_test_files="$self_test_files $extra_self_test_files"
+
+# This file might not exist if we don't have a C++ compiler around.
+if test -f cxx-various; then
+ self_test_files="$self_test_files cxx-various"
+fi
+
# Provide a command to run on all self-test files with testrun.
testrun_on_self()
{
exit_status=0
+ testfiles $extra_self_test_files
for file in $self_test_files; do
testrun $* $file \
|| { echo "*** failure in $* $file"; exit_status=1; }
@@ -128,6 +138,7 @@ testrun_on_self_quiet()
{
exit_status=0
+ testfiles $extra_self_test_files
for file in $self_test_files; do
testrun $* $file > /dev/null \
|| { echo "*** failure in $* $file"; exit_status=1; }
@@ -148,6 +159,7 @@ testrun_on_self_nomatch()
exit_status=0
tempfiles self_matches.in self_matches.out
+ testfiles $extra_self_test_files
for file in $self_test_files; do
testrun "$@" $file > self_matches.in
# egrep should fail to match anything, but we also want to show