Add rpm with testresults
authorMikhail Kashkarov <m.kashkarov@partner.samsung.com>
Fri, 20 Sep 2019 15:54:52 +0000 (18:54 +0300)
committerDongkyun Son <dongkyun.s@samsung.com>
Tue, 5 Mar 2024 08:55:02 +0000 (17:55 +0900)
Define "run_tests" or "glibc_run_tests" to enable it.

Change-Id: I14376885661f99efe001d3b86e57d5370475559e

packaging/glibc.spec

index 6e8739f..8630731 100644 (file)
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
+%if 0%{?run_tests}
+%define glibc_run_tests 1
+%endif
+
 # This will avoid building some parts of glibc
 %define asan_arch x86_64 armv7l aarch64
 %bcond_with    fast_build
@@ -204,6 +208,13 @@ binaries working, but since this libraries are not supported and there
 is no gurantee that they work for you, you should try to get newer
 versions of your software.
 
+%package testresults
+Summary:       Testsuite results
+License:       LGPL-2.1+
+Group:         Development/Languages
+%description testresults
+Results from running the glibc testsuites.
+
 %{?asan:
 %ifarch %asan_arch
 %package asan
@@ -378,6 +389,16 @@ $BuildCC -static %{optflags} -Os $RPM_SOURCE_DIR/glibc_post_upgrade.c -o glibc_p
     '-DREMOVE_TLS_DIRS' '-DREMOVE_PPC_OPTIMIZE_POWER5' \
     '-DLIBDIR="/%{_lib}"' '-DGCONV_MODULES_DIR="%{_libdir}/gconv"'
 
+#
+# Build testsuite
+#
+# #check sections could be redefined/disabled, so keep this inside #build
+
+%{?glibc_run_tests:
+  export LD_AS_NEEDED=0
+  (make %{?_smp_mflags} -C cc-base check || true) 2>&1 | tee check.log
+}
+
 
 #######################################################################
 ###
@@ -546,6 +567,13 @@ cp $ASAN_BUILD/libc.so %{buildroot}/%{_lib}/libc-2.24-asan.so
 %endif
 }
 
+%{?glibc_run_tests:
+  mkdir testresults
+  cp --parents $(find cc-base -name "*tests.sum") testresults/
+  cp check.log testresults/
+  chmod 644 $(find testresults/ -type f)
+}
+
 %post -p %{_sbindir}/glibc_post_upgrade
 
 %postun -p /sbin/ldconfig
@@ -795,5 +823,11 @@ done
 %{_bindir}/makedb
 /var/db/Makefile
 
+%{?glibc_run_tests:
+%files testresults
+%defattr(-,root,root)
+%doc testresults/check.log
+%doc testresults/*
+}
 
 %docs_package