]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
tests: Fix getphdrnum and run-lfs-symbols.sh testcase.
authorMark Wielaard <mark@klomp.org>
Mon, 23 Mar 2020 22:57:51 +0000 (23:57 +0100)
committerMark Wielaard <mark@klomp.org>
Mon, 23 Mar 2020 22:57:51 +0000 (23:57 +0100)
getphdrnum.c didn't include config.h which is why run-lfs-symbols.sh
flagged it for containing bad (non-lfs) symbols.

run-lfs-symbols.sh was still checking the libebl modules, which we
don't create anymore. But it didn't fail the test for non-existing
tests. Add some extra logging and explicitly check files exist.

Signed-off-by: Mark Wielaard <mark@klomp.org>
tests/ChangeLog
tests/getphdrnum.c
tests/run-lfs-symbols.sh

index 44ea1c44bc7c806a480a8390c9f6bfa6bb919623..d0d32a87315ab5fa789c10193191965290981b36 100644 (file)
@@ -1,3 +1,9 @@
+2020-03-23  Mark Wielaard  <mark@klomp.org>
+
+       * getphdrnum.c: Include config.h.
+       * run-lfs-symbols.sh: Also check that file exists. Add more logs.
+       Remove ebl modules check.
+
 2020-03-22  Omar Sandoval  <osandov@fb.com>
            Mark Wielaard  <mark@klomp.org>
 
index 4d4bb397eb4809979ed92848fde4a980adbf22e9..07f75db0bb654212612f51b64f418171e1eece8d 100644 (file)
@@ -1,3 +1,5 @@
+#include "config.h"
+
 #include <fcntl.h>
 #include <libelf.h>
 #include <stdio.h>
index f0894405dae6ca9c1186ad7e74f9232097eaa11d..b65391b6a74b3404510ed97b3a4b0072facfa700 100755 (executable)
@@ -46,41 +46,44 @@ makeprint() {
 }
 
 testrun_lfs() {
-  bad=$(testrun ${abs_top_builddir}/src/nm -u "$1" | awk "$LFS")
-  if [ -n "$bad" ]; then
-    echo "$1 contains non-lfs symbols:" $bad
+  echo "checking $1"
+  if [ -e "$1" ]; then
+    bad=$(testrun ${abs_top_builddir}/src/nm -u "$1" | awk "$LFS")
+    if [ -n "$bad" ]; then
+      echo "$1 contains non-lfs symbols:" $bad
+      exit_status=1
+    fi
+  else
+    echo "$1 doesn't exist"
     exit_status=1
   fi
 }
 
-# First sanity-check that LFS detection works.
+echo First sanity-check that LFS detection works.
 exit_status=0
 testrun_lfs ./testfile-nolfs
 if [ $exit_status -eq 0 ]; then
   echo "Didn't detect any problem with testfile-nolfs!"
   exit 99
 fi
+echo
 
 exit_status=0
 
-# Check all normal build targets.
+echo Check all normal build targets.
 for dir in libelf libdw libasm libcpu src; do
   dir=${abs_top_builddir}/$dir
   for program in $(makeprint PROGRAMS $dir); do
     testrun_lfs $dir/$program
   done
 done
+echo
 
-# Check all libebl modules.
-dir=${abs_top_builddir}/backends
-for module in $(makeprint modules $dir); do
-  testrun_lfs $dir/libebl_$module.so
-done
-
-# Check all test programs.
+echo Check all test programs.
 dir=${abs_builddir}
 for program in $(makeprint check_PROGRAMS $dir); do
   testrun_lfs $dir/$program
 done
+echo
 
 exit $exit_status