#16 Fix tests and enable gating.
Merged 24 days ago by tstellar. Opened a month ago by tstellar.
rpms/ tstellar/llvm f30-test-updates  into  f30

@@ -0,0 +1,29 @@ 

+ From eaa421d1f9c3748c550e2a91fcb134a3d2a8ebff Mon Sep 17 00:00:00 2001

+ From: Sanjin Sijaric <ssijaric@codeaurora.org>

+ Date: Fri, 18 Jan 2019 19:34:20 +0000

+ Subject: [PATCH] Fix the buildbot issue introduced by r351421

+ 

+ The EXPENSIVE_CHECK x86_64 Windows buildbot is failing due to this change. Fix

+ the map access.

+ 

+ llvm-svn: 351577

+ ---

+  lib/MC/MCWin64EH.cpp | 2 +-

+  1 file changed, 1 insertion(+), 1 deletion(-)

+ 

+ diff --git a/lib/MC/MCWin64EH.cpp b/lib/MC/MCWin64EH.cpp

+ index 8bc1f08..3ef1514 100644

+ --- a/lib/MC/MCWin64EH.cpp

+ +++ b/lib/MC/MCWin64EH.cpp

+ @@ -522,7 +522,7 @@ static void ARM64EmitUnwindInfo(MCStreamer &streamer, WinEH::FrameInfo *info) {

+      if (MatchingEpilog) {

+        assert(EpilogInfo.find(MatchingEpilog) != EpilogInfo.end() &&

+               "Duplicate epilog not found");

+ -      EpilogInfo[EpilogStart] = EpilogInfo[MatchingEpilog];

+ +      EpilogInfo[EpilogStart] = EpilogInfo.lookup(MatchingEpilog);

+        // Clear the unwind codes in the EpilogMap, so that they don't get output

+        // in the logic below.

+        EpilogInstrs.clear();

+ -- 

+ 1.8.3.1

+ 

file added
+12

@@ -0,0 +1,12 @@ 

+ --- !Policy

+ product_versions:

+   - fedora-*

+ decision_context: bodhi_update_push_testing

+ rules:

+   - !PassingTestCaseRule {test_case_name: org.centos.prod.ci.pipeline.allpackages-build.package.test.functional.complete}

+ --- !Policy

+ product_versions:

+   - fedora-*

+ decision_context: bodhi_update_push_stable

+ rules:

+   - !PassingTestCaseRule {test_case_name: org.centos.prod.ci.pipeline.allpackages-build.package.test.functional.complete}

file added
+17

@@ -0,0 +1,17 @@ 

+ 

+ config.llvm_tools_dir = '/usr/bin'

+ config.llvm_shlib_dir = '%(llvm_shlib_dir)s' % lit_config.params

+ 

+ if hasattr(config, 'host_triple'):

+     # This means we are running lit regression tests

+ 

+     # Regression tests write output to this directory, so we need to be able to specify

+     # a temp directory when invoking lit. e.g. lit -Dllvm_obj_root=/tmp/lit

+     config.llvm_obj_root = "%(llvm_obj_root)s" % lit_config.params

+     lit_config.load_config(config, '%(llvm_test_root)s/lit.cfg.py' % lit_config.params)

+ else:

+     # This means we are running lit unit tests

+ 

+     # For unit tests, llvm_obj_root is used to find the unit test binaries.

+     config.llvm_obj_root = '%(llvm_unittest_bindir)s' % lit_config.params

+     lit_config.load_config(config, '%(llvm_test_root)s/Unit/lit.cfg.py' % lit_config.params)

file modified
+58 -18

@@ -40,16 +40,18 @@ 

  

  Name:		%{pkg_name}

  Version:	%{maj_ver}.%{min_ver}.%{patch_ver}

- Release:	1%{?rc_ver:.rc%{rc_ver}}%{?dist}

+ Release:	6%{?rc_ver:.rc%{rc_ver}}%{?dist}

  Summary:	The Low Level Virtual Machine

  

  License:	NCSA

  URL:		http://llvm.org

  Source0:	http://%{?rc_ver:pre}releases.llvm.org/%{version}/%{?rc_ver:rc%{rc_ver}}/llvm-%{version}%{?rc_ver:rc%{rc_ver}}.src.tar.xz

  Source1:	run-lit-tests

+ Source2:	lit.fedora.cfg.py

  

  Patch5:		0001-PATCH-llvm-config.patch

  Patch7:		0001-PATCH-Filter-out-cxxflags-not-supported-by-clang.patch

+ Patch8:		0001-Fix-the-buildbot-issue-introduced-by-r351421.patch

  

  BuildRequires:	gcc

  BuildRequires:	gcc-c++

@@ -148,8 +150,6 @@ 

  	test/BugPoint/compile-custom.ll.py \

  	tools/opt-viewer/*.py

  

- sed -i 's~@TOOLS_DIR@~%{_bindir}~' %{SOURCE1}

- 

  %build

  mkdir -p _build

  cd _build

@@ -160,13 +160,17 @@ 

  %endif

  

  # force off shared libs as cmake macros turns it on.

+ #

+ # -DCMAKE_INSTALL_RPATH=";" is a workaround for llvm manually setting the

+ # rpath of libraries and binaries.  llvm will skip the manual setting

+ # if CAMKE_INSTALL_RPATH is set to a value, but cmake interprets this value

+ # as nothing, so it sets the rpath to "" when installing.

  %cmake .. -G Ninja \

  	-DBUILD_SHARED_LIBS:BOOL=OFF \

  	-DLLVM_PARALLEL_LINK_JOBS=1 \

  	-DCMAKE_BUILD_TYPE=RelWithDebInfo \

- 	-DCMAKE_SKIP_RPATH:BOOL=ON \

- 	-DCMAKE_INSTALL_RPATH:BOOL=OFF \

- %ifarch s390 %{arm} %ix86

+ 	-DCMAKE_INSTALL_RPATH=";" \

+ %ifarch s390 s390x %{arm} %ix86

  	-DCMAKE_C_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \

  	-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \

  %endif

@@ -258,25 +262,27 @@ 

  install %{build_libdir}/libLLVMTestingSupport.a %{buildroot}%{_libdir}

  

  %global install_srcdir %{buildroot}%{_datadir}/llvm/src

- %global lit_cfg test/lit.site.cfg.py

- %global lit_unit_cfg test/Unit/lit.site.cfg.py

+ %global lit_cfg test/%{_arch}.site.cfg.py

+ %global lit_unit_cfg test/Unit/%{_arch}.site.cfg.py

+ %global lit_fedora_cfg %{_datadir}/llvm/lit.fedora.cfg.py

  

  # Install gtest sources so clang can use them for gtest

  install -d %{install_srcdir}

  install -d %{install_srcdir}/utils/

  cp -R utils/unittest %{install_srcdir}/utils/

  

- # Generate lit config files.

- cat _build/test/lit.site.cfg.py >> %{lit_cfg}

+ # Generate lit config files.  Strip off the last line that initiates the

+ # test run, so we can customize the configuration.

+ head -n -1 _build/test/lit.site.cfg.py >> %{lit_cfg}

+ head -n -1 _build/test/Unit/lit.site.cfg.py >> %{lit_unit_cfg}

  

- # Unit tests write output to this directory, so it can't be in /usr.

- sed -i 's~\(config.llvm_obj_root = \)"[^"]\+"~\1"."~' %{lit_cfg}

+ # Install custom fedora config file

+ cp %{SOURCE2} %{buildroot}%{lit_fedora_cfg}

  

- cat _build/test/Unit/lit.site.cfg.py >> %{lit_unit_cfg}

- sed -i -e s~`pwd`/_build~%{_prefix}~g -e s~`pwd`~.~g %{lit_cfg} %{lit_cfg} %{lit_unit_cfg}

- 

- # obj_root needs to be set to the directory containing the unit test binaries.

- sed -i 's~\(config.llvm_obj_root = \)"[^"]\+"~\1"%{_bindir}"~' %{lit_unit_cfg}

+ # Patch lit config files to load custom fedora config:

+ for f in %{lit_cfg} %{lit_unit_cfg}; do

+   echo "lit_config.load_config(config, '%{lit_fedora_cfg}')" >> $f

+ done

  

  install -d %{buildroot}%{_libexecdir}/tests/llvm

  install -m 0755 %{SOURCE1} %{buildroot}%{_libexecdir}/tests/llvm

@@ -291,6 +297,15 @@ 

  cp -R _build/unittests %{build_llvm_libdir}/

  rm -rf `find %{build_llvm_libdir} -iname 'cmake*'`

  

+ # Install libraries used for testing

+ install -m 0755 %{build_libdir}/BugpointPasses.so %{buildroot}%{_libdir}

+ install -m 0755 %{build_libdir}/LLVMHello.so %{buildroot}%{_libdir}

+ 

+ # Install test inputs for PDB tests

+ echo "%{_datadir}/llvm/src/unittests/DebugInfo/PDB" > %{build_llvm_libdir}/unittests/DebugInfo/PDB/llvm.srcdir.txt

+ mkdir -p %{buildroot}%{_datadir}/llvm/src/unittests/DebugInfo/PDB/

+ cp -R unittests/DebugInfo/PDB/Inputs %{buildroot}%{_datadir}/llvm/src/unittests/DebugInfo/PDB/

+ 

  %else

  

  # Add version suffix to binaries

@@ -328,7 +343,13 @@ 

  

  

  %check

- ninja check-all -C _build || :

+ # TODO: Fix test failures on arm

+ ninja check-all -C _build || \

+ %ifarch %{arm}

+   :

+ %else

+   false

+ %endif

  

  %ldconfig_scriptlets libs

  

@@ -422,13 +443,17 @@ 

  %files test

  %{_libexecdir}/tests/llvm/

  %{llvm_libdir}/unittests/

+ %{_datadir}/llvm/src/unittests

  %{_datadir}/llvm/src/test.tar.gz

+ %{_datadir}/llvm/lit.fedora.cfg.py

  %{_bindir}/not

  %{_bindir}/count

  %{_bindir}/yaml-bench

  %{_bindir}/lli-child-target

  %{_bindir}/llvm-isel-fuzzer

  %{_bindir}/llvm-opt-fuzzer

+ %{_libdir}/BugpointPasses.so

+ %{_libdir}/LLVMHello.so

  

  %files googletest

  %{_datadir}/llvm/src/utils

@@ -437,6 +462,21 @@ 

  %endif

  

  %changelog

+ * Wed Apr 24 2019 Tom Stellard <tstellar@redhat.com> - 8.0.0-6

+ - Make sure we aren't passing -g on s390x

+ 

+ * Sat Mar 30 2019 Tom Stellard <tstellar@redhat.com> - 8.0.0-5

+ - Enable build rpath while keeping install rpath disabled

+ 

+ * Wed Mar 27 2019 Tom Stellard <tstellar@redhat.com> - 8.0.0-4

+ - Backport r351577 from trunk to fix ninja check failures

+ 

+ * Tue Mar 26 2019 Tom Stellard <tstellar@redhat.com> - 8.0.0-3

+ - Fix ninja check

+ 

+ * Fri Mar 22 2019 Tom Stellard <tstellar@redhat.com> - 8.0.0-2

+ - llvm-test fixes

+ 

  * Wed Mar 20 2019 sguelton@redhat.com - 8.0.0-1

  - 8.0.0 final

  

file modified
+29 -10

@@ -2,7 +2,9 @@ 

  

  usage() {

      echo "usage: `basename $0` [OPTIONS]"

-     echo "  --threads NUM       The number of threads to use for running tests."

+     echo "  --threads NUM         The number of threads to use for running tests."

+     echo "  --multilib-arch ARCH  Use this option to test 32-bit libs/binaries on"

+     echo "                        64-bit hosts."

  }

  

  threads_arg=''

@@ -13,6 +15,10 @@ 

              shift

              threads_arg="--threads $1"

              ;;

+ 	--multilib-arch)

+             shift

+ 	    ARCH=$1

+ 	    ;;

          * )

              echo "unknown option: $1"

              echo ""

@@ -25,15 +31,28 @@ 

  

  set -xe

  

- TOOLS_DIR=@TOOLS_DIR@

+ if [ -z "$ARCH" ]; then

+     ARCH=`rpm --eval '%_arch'`

What's the difference with ARCH=%_arch ?

+ fi

+ 

+ case $ARCH in

+     arm)

+ 	;&

this & looks strange to me here.

+     i686)

+         LIB_DIR="/usr/lib/"

+         ;;

+     *)

+         LIB_DIR="/usr/lib64/"

+         ;;

+ esac

+ 

  cd $(mktemp -d)

  ln -s /usr/include include

  tar -xzf /usr/share/llvm/src/test.tar.gz

- PATH=$PATH:$TOOLS_DIR lit -v -s $threads_arg test \

- 	-DFileCheck=$TOOLS_DIR/FileCheck \

- 	-Dcount=$TOOLS_DIR/count \

- 	-Dnot=$TOOLS_DIR/not \

- 	-Dlli-child-target=$TOOLS_DIR/lli-child-target \

- 	-Dllvm-isel-fuzzer=$TOOLS_DIR/llvm-isel-fuzzer \

- 	-Dllvm-opt-fuzzer=$TOOLS_DIR/llvm-opt-fuzzer \

- 	-Dyaml-bench=$TOOLS_DIR/yaml-bench

+ ln -s $ARCH.site.cfg.py test/lit.site.cfg.py

+ ln -s $ARCH.site.cfg.py test/Unit/lit.site.cfg.py

+ lit -v -s $threads_arg test \

+ 	-Dllvm_obj_root=`pwd` \

+ 	-Dllvm_test_root=`pwd`/test \

+ 	-Dllvm_unittest_bindir=$LIB_DIR/llvm \

+ 	-Dllvm_shlib_dir=$LIB_DIR

no initial comment

6 new commits added

  • Enable gating tests
  • Make sure we aren't passing -g on s390x
  • Enable build rpath while keeping install rpath disabled
  • Backport r351577 from trunk to fix ninja check failures
  • Fix ninja check
  • llvm-test fixes
a month ago

Pull-Request has been merged by tstellar

24 days ago

What's the difference with ARCH=%_arch ?

this & looks strange to me here.