libctf: tests: prune warnings from compiler output
authorNick Alcock <nick.alcock@oracle.com>
Sat, 11 Jun 2022 12:07:18 +0000 (13:07 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Tue, 21 Jun 2022 18:27:15 +0000 (19:27 +0100)
We were failing to call prune_warnings appropriately, leading to
false-positive test failures on some platforms (observed on
sparclinux).

libctf/ChangeLog:

* testsuite/lib/ctf-lib.exp: Prune warnings from compiler and
linker output.
* testsuite/libctf-regression/libctf-repeat-cu.exp: Likewise,
and ar output too.

libctf/testsuite/lib/ctf-lib.exp
libctf/testsuite/libctf-regression/libctf-repeat-cu.exp

index e7552ed6ec710630a0035388c2150e6599103de9..6c55bbe52aa5f45f7d0712b0f228eed7488f6bce 100644 (file)
@@ -181,7 +181,7 @@ proc run_lookup_test { name } {
     }
 
     # Compile and link the lookup program.
-    set comp_output [compile_link_one_host_cc $opts(lookup) "tmpdir/lookup" "libctf.la"]
+    set comp_output [prune_warnings [compile_link_one_host_cc $opts(lookup) "tmpdir/lookup" "libctf.la"]]
 
     if { $comp_output != ""} {
        send_log "compilation of lookup program $opts(lookup) failed with <$comp_output>"
@@ -217,7 +217,7 @@ proc run_lookup_test { name } {
            }
        }
 
-       set comp_output [run_host_cmd "$CC_FOR_TARGET" "$CFLAGS_FOR_TARGET $lookup_flags [concat $src] -o $lookup_output"]
+       set comp_output [prune_warnings [run_host_cmd "$CC_FOR_TARGET" "$CFLAGS_FOR_TARGET $lookup_flags [concat $src] -o $lookup_output"]]
 
        if { $comp_output != ""} {
            send_log "compilation of CTF program [concat $src] failed with <$comp_output>"
index becee958ca3411cca999aed191129765e12992e4..4a5d2d1d03bfd2073f74631ddea88dc2dd063da4 100644 (file)
@@ -52,12 +52,12 @@ proc one_lib_compile { src flags obj archive } {
        set src [file join $subsrcdir $src]
     }
 
-    set comp_output [run_host_cmd "$CC_FOR_TARGET" "$CFLAGS_FOR_TARGET $flags -gctf -fPIC -c -o $obj $src"]
+    set comp_output [prune_warnings [run_host_cmd "$CC_FOR_TARGET" "$CFLAGS_FOR_TARGET $flags -gctf -fPIC -c -o $obj $src"]]
     if { $comp_output != "" } {
        return $comp_output
     }
 
-    set ar_output [run_host_cmd "$AR" "rc $archive $obj"]
+    set ar_output [prune_warnings [run_host_cmd "$AR" "rc $archive $obj"]]
     return $comp_output
 }
 
@@ -94,7 +94,7 @@ if [is_remote host] {
     set src [file join $subsrcdir libctf-repeat-cu-main.c]
 }
 
-set comp_output [run_host_cmd "$CC_FOR_TARGET" "$CFLAGS_FOR_TARGET -gctf -fPIC -shared -o tmpdir/libctf-repeat-cu-main.so $src tmpdir/a.a tmpdir/b.a tmpdir/c.a"]
+set comp_output [prune_warnings [run_host_cmd "$CC_FOR_TARGET" "$CFLAGS_FOR_TARGET -gctf -fPIC -shared -o tmpdir/libctf-repeat-cu-main.so $src tmpdir/a.a tmpdir/b.a tmpdir/c.a"]]
 if { $comp_output != "" } {
     send_log "compilation of tmpdir/libctf-repeat-cu-main.so failed"
     perror "compilation of tmpdir/libctf-repeat-cu-main.so failed"
@@ -102,7 +102,7 @@ if { $comp_output != "" } {
     return $comp_output
 }
 
-set comp_output [run_host_cmd "$OBJDUMP" "--ctf tmpdir/libctf-repeat-cu-main.so > tmpdir/dump.out"]
+set comp_output [prune_warnings [run_host_cmd "$OBJDUMP" "--ctf tmpdir/libctf-repeat-cu-main.so > tmpdir/dump.out"]]
 
 if { [regexp_diff "tmpdir/dump.out"  [file join $subsrcdir libctf-repeat-cu.d] ] } {
     fail $testname