From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 56607 invoked by alias); 23 May 2019 11:28:11 -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 56595 invoked by uid 89); 23 May 2019 11:28:11 -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.0 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= X-Spam-Status: No, score=-19.0 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: gnu.wildebeest.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (212.238.236.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 23 May 2019 11:28:09 +0000 Received: from librem.wildebeest.org (deer0x15.wildebeest.org [172.31.17.151]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 8093931FFA97; Thu, 23 May 2019 13:28:05 +0200 (CEST) Received: by librem.wildebeest.org (Postfix, from userid 1000) id 2F976C1FDB; Thu, 23 May 2019 13:28:05 +0200 (CEST) Date: Thu, 23 May 2019 11:28:00 -0000 From: Mark Wielaard To: mingli.yu@windriver.com Cc: elfutils-devel@sourceware.org, ldv@altlinux.org Subject: Re: [PATCH v2] skip the test when gcc not deployed Message-ID: <20190523112805.GC2464@wildebeest.org> References: <20190521072523.GA3310@altlinux.org> <1558423986-93815-1-git-send-email-mingli.yu@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1558423986-93815-1-git-send-email-mingli.yu@windriver.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Flag: NO X-IsSubscribed: yes X-SW-Source: 2019-q2/txt/msg00095.txt.bz2 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? 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 ||