This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

[GOLD] Propagate error status from awk in tests


Some tests in gold/testsuite/ run awk to check for errors.
The awk scripts use "exit 1" to indicate test failure, but
the shell scripts didn't check for the exit status from awk.
This patch adds the checks so failing tests actually fail.

OK?

        * testsuite/final_layout.sh: Propagate error status from awk.
        * testsuite/icf_safe_so_test.sh: Likewise.
        * testsuite/icf_safe_test.sh: Likewise.
        * testsuite/icf_test.sh: Likewise.
        * testsuite/plugin_final_layout.sh: Likewise.
        * testsuite/plugin_layout_with_alignment.sh: Likewise.
        * testsuite/section_sorting_name.sh: Likewise.
        * testsuite/text_section_grouping.sh: Likewise.


diff --git gold/ChangeLog gold/ChangeLog
index 1159f9c6aa..c569762bc7 100644
--- gold/ChangeLog
+++ gold/ChangeLog
@@ -1,3 +1,14 @@
+2017-01-09  Rahul Chaudhry  <rahulchaudhry@google.com>
+
+       * testsuite/final_layout.sh: Propagate error status from awk.
+       * testsuite/icf_safe_so_test.sh: Likewise.
+       * testsuite/icf_safe_test.sh: Likewise.
+       * testsuite/icf_test.sh: Likewise.
+       * testsuite/plugin_final_layout.sh: Likewise.
+       * testsuite/plugin_layout_with_alignment.sh: Likewise.
+       * testsuite/section_sorting_name.sh: Likewise.
+       * testsuite/text_section_grouping.sh: Likewise.
+
 2017-01-09  Alan Modra  <amodra@gmail.com>

        * powerpc.cc (Target_powerpc::make_plt_section): Point sh_info of
diff --git gold/testsuite/final_layout.sh gold/testsuite/final_layout.sh
index b7fac4f3b2..1c8e0687a9 100755
--- gold/testsuite/final_layout.sh
+++ gold/testsuite/final_layout.sh
@@ -53,6 +53,10 @@ END {
          exit 1;
        }
     }" $1
+    if [ $? -ne 0 ];
+    then
+       exit 1
+    fi
 }

 check final_layout.stdout "_Z3barv" "_Z3bazv"
diff --git gold/testsuite/icf_safe_so_test.sh gold/testsuite/icf_safe_so_test.sh
index 6542c65d56..191fe582d8 100755
--- gold/testsuite/icf_safe_so_test.sh
+++ gold/testsuite/icf_safe_so_test.sh
@@ -80,6 +80,10 @@ END {
          exit 1;
        }
     }" $4
+    if [ $? -ne 0 ];
+    then
+       exit 1
+    fi
 }

 arch_specific_safe_fold()
diff --git gold/testsuite/icf_safe_test.sh gold/testsuite/icf_safe_test.sh
index 47650162c4..601b185ed6 100755
--- gold/testsuite/icf_safe_test.sh
+++ gold/testsuite/icf_safe_test.sh
@@ -53,6 +53,10 @@ END {
          exit 1;
        }
     }" $1
+    if [ $? -ne 0 ];
+    then
+       exit 1
+    fi
 }

 arch_specific_safe_fold()
diff --git gold/testsuite/icf_test.sh gold/testsuite/icf_test.sh
index 3d11dcb808..37fdfb7b74 100755
--- gold/testsuite/icf_test.sh
+++ gold/testsuite/icf_test.sh
@@ -41,6 +41,10 @@ END {
          exit 1;
        }
     }" $1
+    if [ $? -ne 0 ];
+    then
+       exit 1
+    fi
 }

 check icf_test.map "folded_func" "kept_func"
diff --git gold/testsuite/plugin_final_layout.sh
gold/testsuite/plugin_final_layout.sh
index 54985916a7..cd361e30a9 100755
--- gold/testsuite/plugin_final_layout.sh
+++ gold/testsuite/plugin_final_layout.sh
@@ -54,6 +54,10 @@ END {
          exit 1;
        }
     }" $1
+    if [ $? -ne 0 ];
+    then
+       exit 1
+    fi
 }

 # With readelf -l, an ELF Section to Segment mapping is printed as :
@@ -83,6 +87,10 @@ END {
          exit 1;
        }
     }" $1
+    if [ $? -ne 0 ];
+    then
+       exit 1
+    fi
 }

 check plugin_final_layout.stdout "_Z3foov" "_Z3barv"
diff --git gold/testsuite/plugin_layout_with_alignment.sh
gold/testsuite/plugin_layout_with_alignment.sh
index 17a838554d..2a6e4d753c 100755
--- gold/testsuite/plugin_layout_with_alignment.sh
+++ gold/testsuite/plugin_layout_with_alignment.sh
@@ -59,6 +59,10 @@ END {
          exit 1;
        }
     }" $1
+    if [ $? -ne 0 ];
+    then
+       exit 1
+    fi
 }

 check plugin_layout_with_alignment.stdout "bss_item3" "bss_item1"
"bss_item4" "bss_item2"
diff --git gold/testsuite/section_sorting_name.sh
gold/testsuite/section_sorting_name.sh
index ee58f6ce9e..a13ca48acd 100755
--- gold/testsuite/section_sorting_name.sh
+++ gold/testsuite/section_sorting_name.sh
@@ -53,6 +53,10 @@ END {
          exit 1;
        }
     }" $1
+    if [ $? -ne 0 ];
+    then
+       exit 1
+    fi
 }

 # addr (hot_foo_0001) < addr (hot_foo_0002) < addr (hot_foo_0003)
diff --git gold/testsuite/text_section_grouping.sh
gold/testsuite/text_section_grouping.sh
index 360ddf68d5..a186dff2a4 100755
--- gold/testsuite/text_section_grouping.sh
+++ gold/testsuite/text_section_grouping.sh
@@ -56,6 +56,10 @@ END {
          exit 1;
        }
     }" $1
+    if [ $? -ne 0 ];
+    then
+       exit 1
+    fi
 }

 # addr (unlikely_*) < addr (startup_*) < addr (hot_*)


-- 
Rahul


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