From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16524 invoked by alias); 24 May 2019 06:41:24 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 16513 invoked by uid 89); 24 May 2019 06:41:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-19.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy=CC, H*r:0700, HContent-Transfer-Encoding:8bit X-Spam-Status: No, score=-19.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: mail.windriver.com Received: from mail.windriver.com (HELO mail.windriver.com) (147.11.1.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 24 May 2019 06:41:21 +0000 Received: from ALA-HCA.corp.ad.wrs.com ([147.11.189.40]) by mail.windriver.com (8.15.2/8.15.1) with ESMTPS id x4O6fFT4017392 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Thu, 23 May 2019 23:41:15 -0700 (PDT) Received: from [128.224.162.170] (128.224.162.170) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 23 May 2019 23:41:14 -0700 Subject: Re: [PATCH v2] skip the test when gcc not deployed To: Mark Wielaard References: <20190521072523.GA3310@altlinux.org> <1558423986-93815-1-git-send-email-mingli.yu@windriver.com> <20190523112805.GC2464@wildebeest.org> CC: , From: "Yu, Mingli" Message-ID: <5CE7937D.7090300@windriver.com> Date: Fri, 24 May 2019 06:41:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20190523112805.GC2464@wildebeest.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [128.224.162.170] X-IsSubscribed: yes X-SW-Source: 2019-q2/txt/msg00102.txt.bz2 On 2019年05月23日 19:28, Mark Wielaard wrote: > Hi, > > On Tue, May 21, 2019 at 03:33:06PM +0800, mingli.yu@windriver.com wrote: >> Skip the tests which depend on gcc when >> gcc not deployed. > > What exactly are you trying to do? > When would you run make check without having gcc installed? Thanks Mark! I just run the check without having gcc installed, and of cource no compiler installed in my test env. Thanks, > If this is to check against an alternative compiler? > > In the last case it might be better to make CC available to the tests > environment. Does something like the following work for you? > > diff --git a/tests/Makefile.am b/tests/Makefile.am > index 80900e42d..4b7703d8a 100644 > --- a/tests/Makefile.am > +++ b/tests/Makefile.am > @@ -445,7 +445,8 @@ installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir); \ > export abs_top_builddir; \ > export libdir; export bindir; \ > export LC_ALL; export LANG; export VALGRIND_CMD; \ > - NM=$(NM); export NM; > + NM=$(NM); export NM; \ > + CC=$(CC); export CC; > installed_LOG_COMPILER = $(abs_srcdir)/test-wrapper.sh \ > installed $(tests_rpath) \ > '$(program_transform_name)' > @@ -459,7 +460,8 @@ TESTS_ENVIRONMENT = LC_ALL=C; LANG=C; VALGRIND_CMD=$(valgrind_cmd); \ > export abs_srcdir; export abs_builddir; \ > export abs_top_builddir; \ > export LC_ALL; export LANG; export VALGRIND_CMD; \ > - NM=$(NM); export NM; > + NM=$(NM); export NM; \ > + CC=$(CC); export CC; > LOG_COMPILER = $(abs_srcdir)/test-wrapper.sh \ > $(abs_top_builddir)/libdw:$(abs_top_builddir)/backends:$(abs_top_builddir)/libelf:$(abs_top_builddir)/libasm > > diff --git a/tests/run-disasm-x86-64.sh b/tests/run-disasm-x86-64.sh > index a6be62bbc..3fe28084f 100755 > --- a/tests/run-disasm-x86-64.sh > +++ b/tests/run-disasm-x86-64.sh > @@ -22,7 +22,7 @@ case "`uname -m`" in > x86_64) > tempfiles testfile45.o > testfiles testfile45.S testfile45.expect > - gcc -m64 -c -o testfile45.o testfile45.S > + $CC -m64 -c -o testfile45.o testfile45.S > testrun_compare ${abs_top_builddir}/src/objdump -d testfile45.o < testfile45.expect > ;; > esac > diff --git a/tests/run-disasm-x86.sh b/tests/run-disasm-x86.sh > index 28a3df740..48cd18030 100755 > --- a/tests/run-disasm-x86.sh > +++ b/tests/run-disasm-x86.sh > @@ -22,7 +22,7 @@ case "`uname -m`" in > x86_64 | i?86 ) > tempfiles testfile44.o > testfiles testfile44.S testfile44.expect > - gcc -m32 -c -o testfile44.o testfile44.S > + $CC -m32 -c -o testfile44.o testfile44.S > testrun_compare ${abs_top_builddir}/src/objdump -d testfile44.o < testfile44.expect > ;; > esac > diff --git a/tests/run-strip-g.sh b/tests/run-strip-g.sh > index 13038195d..b30b39f1a 100755 > --- a/tests/run-strip-g.sh > +++ b/tests/run-strip-g.sh > @@ -25,7 +25,7 @@ > tempfiles a.out strip.out debug.out readelf.out > > echo Create debug a.out. > -echo "int main() { return 1; }" | gcc -g -xc - > +echo "int main() { return 1; }" | $CC -g -xc - > > echo strip -g to file with debug file > testrun ${abs_top_builddir}/src/strip -g -o strip.out -f debug.out || > diff --git a/tests/run-strip-nothing.sh b/tests/run-strip-nothing.sh > index 914fdfbf0..4867a82fa 100755 > --- a/tests/run-strip-nothing.sh > +++ b/tests/run-strip-nothing.sh > @@ -23,7 +23,7 @@ > tempfiles a.out strip.out debug.out > > # Create no-debug a.out. > -echo "int main() { return 1; }" | gcc -s -xc - > +echo "int main() { return 1; }" | $CC -s -xc - > > # strip to file > testrun ${abs_top_builddir}/src/strip -g -o strip.out || > >