From a6098315baa0074cd188bfd9d3c6b9d9205d6fa2 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 26 Apr 2013 21:21:56 +0200 Subject: [PATCH] tests: Add various files to tempfiles so they are always cleaned up. 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 --- tests/ChangeLog | 8 ++++++++ tests/run-alldts.sh | 4 ++-- tests/run-elf_cntl_gelf_getshdr.sh | 4 ++-- tests/run-macro-test.sh | 3 +-- tests/run-strip-reloc.sh | 5 +++-- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/tests/ChangeLog b/tests/ChangeLog index 2cbe801..dfee832 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,11 @@ +2013-04-27 Mark Wielaard + + * 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 * Makefile.am (installed_TESTS_ENVIRONMENT): Export environment, diff --git a/tests/run-alldts.sh b/tests/run-alldts.sh index a405fd5..6a9a9ec 100755 --- a/tests/run-alldts.sh +++ b/tests/run-alldts.sh @@ -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 diff --git a/tests/run-elf_cntl_gelf_getshdr.sh b/tests/run-elf_cntl_gelf_getshdr.sh index d134119..94b477c 100755 --- a/tests/run-elf_cntl_gelf_getshdr.sh +++ b/tests/run-elf_cntl_gelf_getshdr.sh @@ -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 diff --git a/tests/run-macro-test.sh b/tests/run-macro-test.sh index c160968..79b0d88 100755 --- a/tests/run-macro-test.sh +++ b/tests/run-macro-test.sh @@ -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 diff --git a/tests/run-strip-reloc.sh b/tests/run-strip-reloc.sh index ec4be3f..221eefb 100755 --- a/tests/run-strip-reloc.sh +++ b/tests/run-strip-reloc.sh @@ -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. -- 2.7.4