]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
tests: Add various files to tempfiles so they are always cleaned up.
authorMark Wielaard <mjw@redhat.com>
Fri, 26 Apr 2013 19:21:56 +0000 (21:21 +0200)
committerMark Wielaard <mjw@redhat.com>
Sat, 27 Apr 2013 19:11:00 +0000 (21:11 +0200)
Various tests tried to rm their own temporary files. That could mean those
files weren't properly cleaned up if the testcase unexpectedly failed. Add
them to tempfiles to make sure they are always cleaned up by test-subr.sh.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
tests/ChangeLog
tests/run-alldts.sh
tests/run-elf_cntl_gelf_getshdr.sh
tests/run-macro-test.sh
tests/run-strip-reloc.sh

index 2cbe8012cce9adc84f5765df9244acc72112eaf0..dfee832f2f0410986849e2543965371a160e2496 100644 (file)
@@ -1,3 +1,11 @@
+2013-04-27  Mark Wielaard  <mjw@redhat.com>
+
+       * run-alldts.sh: Add testfile-alldts to tempfiles.
+       * run-elf_cntl_gelf_getshdr.sh: Add test_shdr.out to tempfiles.
+       * run-macro-test.sh: Add readelf.macros.out to tempfiles.
+       * run-strip-reloc.sh: Add readelf.out, readelf.out1, readelf.out2
+       and out.stripped1, out.debug1, out.stripped2, out.debug2 to tempfiles.
+
 2013-04-26  Mark Wielaard  <mjw@redhat.com>
 
        * Makefile.am (installed_TESTS_ENVIRONMENT): Export environment,
index a405fd56519d65aec82b3893cc9a3485ee5dd0f7..6a9a9eceeb40512ae716f082397652b92858e441 100755 (executable)
@@ -17,6 +17,8 @@
 
 . $srcdir/test-subr.sh
 
+tempfiles testfile-alldts
+
 # This will produce "testfile-alldts" file
 testrun ${abs_builddir}/alldts
 
@@ -93,6 +95,4 @@ Dynamic segment contains 66 entries:
   FILTER            0xdeadbeef
 EOF
 
-rm -f testfile-alldts
-
 exit 0
index d134119c4789c76e25285fda1a6d06be68b4bfc6..94b477c77d692d6a57d788699271729b184b72be 100755 (executable)
@@ -17,6 +17,8 @@
 
 . $srcdir/test-subr.sh
 
+tempfiles test_shdr.out
+
 # However we open the elf file, the shdrs should be the same.
 testrun ${abs_builddir}/test-elf_cntl_gelf_getshdr READ ${abs_builddir}/test-elf_cntl_gelf_getshdr \
   > test_shdr.out
@@ -26,5 +28,3 @@ testrun_compare ${abs_builddir}/test-elf_cntl_gelf_getshdr MMAP ${abs_builddir}/
 
 testrun_compare ${abs_builddir}/test-elf_cntl_gelf_getshdr FDREAD ${abs_builddir}/test-elf_cntl_gelf_getshdr \
   < test_shdr.out
-
-rm -f test_shdr.out
index c160968b305edd46f2343ba91844693ba3b0aab7..79b0d8817617de3b6c68960a6bb493dd613a859c 100755 (executable)
@@ -31,6 +31,7 @@
 # gcc -gstrict-dwarf -gdwarf-4 -g3 -o testfile-macinfo macro.c
 
 testfiles testfile-macinfo testfile-macros
+tempfiles readelf.macros.out
 
 status=0
 
@@ -48,6 +49,4 @@ testrun_compare cat readelf.macros.out <<\EOF
            GNU_macros           (sec_offset) 0
 EOF
 
-rm -f readelf.macros.out
-
 exit $status
index ec4be3fff6f9ee8cc5a40266b9569323c4898751..221eefbf6c74f5a227e1bc2c3291fb65047b030c 100755 (executable)
@@ -19,6 +19,9 @@
 
 testfiles hello_i386.ko hello_x86_64.ko hello_ppc64.ko hello_s390.ko
 
+tempfiles readelf.out readelf.out1 readelf.out2
+tempfiles out.stripped1 out.debug1 out.stripped2 out.debug2
+
 status=0
 runtest() {
   infile=$1
@@ -61,8 +64,6 @@ runtest() {
 
   testrun_compare cat readelf.out1 < readelf.out2 ||
   { echo "*** failure readelf -w compare $infile"; status=1; }
-
-  rm -f $outfile1 $debugfile1 $outfile2 $debugfile2 readelf.out*
 }
 
 # Most simple hello world kernel module for various architectures.