This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] tests: Reduce the total number of self-test files and add ET_REL files.


Some self tests would run for a really long time (especially under valgrind)
because we included all libebl backends in the list (there are 12 backends).
Now only test two explicitly. Also there were no ET_REL files in the
self test file list. So add two ET_REL files. The total number of self test
files is now 12.

run-nm-self.sh would run 4 * 3 * 3 * 22 = 792 tests (on all self test files).
Reduce the number of different files to test to 3 (one ET_EXEC, one ET_DYN
and one ET_REL file). Reducing the number of test runs to 99.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
---
 tests/ChangeLog      |    7 +++++++
 tests/run-nm-self.sh |   14 ++++++++++++--
 tests/test-subr.sh   |   11 +++++++----
 3 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/tests/ChangeLog b/tests/ChangeLog
index 098093a..10d173e 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,5 +1,12 @@
 2014-01-16  Mark Wielaard  <mjw@redhat.com>
 
+	* run-nm-self.sh: Don't use testrun_on_self_quiet but just testrun
+	on one ET_REL, one ET_EXEC and one ET_DYN file.
+	* test-subr.sh (self_test_files): Add two ET_REL files, only add
+	two libebl ET_DYN backend files.
+
+2014-01-16  Mark Wielaard  <mjw@redhat.com>
+
 	* run-backtrace-demangle.sh: Check exitcode and max number of frames.
 
 2014-01-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
diff --git a/tests/run-nm-self.sh b/tests/run-nm-self.sh
index d2c1246..dac8e27 100755
--- a/tests/run-nm-self.sh
+++ b/tests/run-nm-self.sh
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2012 Red Hat, Inc.
+# Copyright (C) 2012, 2014 Red Hat, Inc.
 # This file is part of elfutils.
 #
 # This file is free software; you can redistribute it and/or modify
@@ -17,10 +17,20 @@
 
 . $srcdir/test-subr.sh
 
+# Test different command line combinations on the nm binary itself.
+# Test on nm ET_REL, ET_EXEC and ET_DYN files.
+ET_REL=${abs_top_builddir}/src/nm.o
+ET_EXEC=${abs_top_builddir}/src/nm
+ET_DYN=${abs_top_builddir}/libelf/libelf.so
 for what_arg in --debug-syms --defined-only --dynamic --extern-only; do
   for format_arg in --format=bsd --format=sysv --format=posix; do
     for out_arg in --numeric-sort --no-sort --reverse-sort; do
-      testrun_on_self_quiet ${abs_top_builddir}/src/nm $what_arg $format_arg $out_arg
+      for self_file in $ET_REL $ET_EXEC $ET_DYN; do
+	# --dynamic doesn't make sense for ET_REL.
+	if ! test "$what_arg" == "--dynamic" -a "$self_file" == "$ET_REL"; then
+	  testrun ${abs_top_builddir}/src/nm $what_arg $format_arg $out_arg $self_file > /dev/null
+	fi
+      done
     done
   done
 done
diff --git a/tests/test-subr.sh b/tests/test-subr.sh
index b5ab105..5e796b4 100644
--- a/tests/test-subr.sh
+++ b/tests/test-subr.sh
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2005-2013 Red Hat, Inc.
+# Copyright (C) 2005-2014 Red Hat, Inc.
 # This file is part of elfutils.
 #
 # This file is free software; you can redistribute it and/or modify
@@ -118,9 +118,12 @@ program_transform()
 self_test_files=`echo ${abs_top_builddir}/src/addr2line \
 ${abs_top_builddir}/src/elfcmp ${abs_top_builddir}/src/elflint \
 ${abs_top_builddir}/src/nm ${abs_top_builddir}/src/objdump \
-${abs_top_builddir}/src/readelf ${abs_top_builddir}/src/size \
-${abs_top_builddir}/src/strip ${abs_top_builddir}/libelf/libelf.so \
-${abs_top_builddir}/libdw/libdw.so ${abs_top_builddir}/backends/libebl_*.so`
+${abs_top_builddir}/src/readelf \
+${abs_top_builddir}/src/size.o ${abs_top_builddir}/src/strip.o \
+${abs_top_builddir}/libelf/libelf.so \
+${abs_top_builddir}/libdw/libdw.so \
+${abs_top_builddir}/backends/libebl_i386.so \
+${abs_top_builddir}/backends/libebl_x86_64.so`
 
 # Provide a command to run on all self-test files with testrun.
 testrun_on_self()
-- 
1.7.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]