From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1443 invoked by alias); 25 Dec 2014 02:46:53 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 1410 invoked by uid 89); 25 Dec 2014 02:46:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 25 Dec 2014 02:46:41 +0000 Received: from svr-orw-fem-04.mgc.mentorg.com ([147.34.97.41]) by relay1.mentorg.com with esmtp id 1Y3yRh-0007IW-Oe from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Wed, 24 Dec 2014 18:46:37 -0800 Received: from GreenOnly (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.3.224.2; Wed, 24 Dec 2014 18:46:37 -0800 From: Yao Qi To: Subject: Re: [RFC] Run tests in sub dir of testsuite/ References: <1418266428-13166-1-git-send-email-yao@codesourcery.com> Date: Thu, 25 Dec 2014 02:46:00 -0000 In-Reply-To: <1418266428-13166-1-git-send-email-yao@codesourcery.com> (Yao Qi's message of "Thu, 11 Dec 2014 10:53:48 +0800") Message-ID: <87h9wkwio8.fsf@codesourcery.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-12/txt/msg00627.txt.bz2 Yao Qi writes: > This patch is to run testsuite in a subdirectory of testsuite/, in > order to facilitate 'make clean'. In sequential testing, directory > testsuite/sequential-tests is created, and in parallel testing, > directory testsuite/parallel-tests is created. Testing artifacts > (such as directory gdb.base, gdb.ada, object files, shared libraries > and executables) are stored in it. > > In testsuite/Makefile.in, we set OUTPUTDIR to either sequential-tests > or parallel-tests, determined by whether we run tests in parallel. > Makefile passes OUTPUTDIR to dejagnu, and lib/gdb.exp return the > expected file path according to OUTPUTDIR. > > This patch changes the location of gdb.sum, so some build/test scripts > are affected. Here is the V2, to address the comments I've got. --=20 Yao (=E9=BD=90=E5=B0=A7) Subject: [PATCH] Run tests in sub dir of testsuite/ Here is the V2, in which we have two changes, 1. Don't change the location of gdb.sum and gdb.log, 2. Rename sequential-tests by sequential-run. ---------------------------------------------------------------- This patch is to run testsuite in a subdirectory of testsuite/, in order to facilitate 'make clean'. In sequential testing, directory testsuite/sequential-run is created, and in parallel testing, directory testsuite/parallel-run is created. Testing artifacts (such as directory gdb.base, gdb.ada, object files, shared libraries and executables) are stored in it. In testsuite/Makefile.in, we set OUTPUTDIR to either sequential-run or parallel-run, determined by whether we run tests in parallel. Makefile passes OUTPUTDIR to dejagnu, and lib/gdb.exp return the expected file path according to OUTPUTDIR. This patch doesn't changes the location of gdb.sum. gdb/testsuite: 2014-12-25 Yao Qi * Makefile.in: Set OUTPUTDIR. (check-single): Create dir OUTPUTDIR and pass $(OUTPUTDIR) to runtest. (check-parallel): Use $(OUTPUTDIR). (check/%.exp): Pass $(OUTPUTDIR) to runtest. (check-perf): Likewise. (clean): Remove directory sequential-run and parallel-run. * lib/gdb.exp (standard_output_file): Return file path name according to new directory structure. (gdb_init): Use $OUTPUTDIR instead of outputs. (top-level): Create directory $OUTPUTDIR. * lib/trace-support.exp (get_in_proc_agent): Don't use $objdir in the path of inprocagent. * gdb.base/completion.exp: Use ${OUTPUTDIR}. * gdb.base/hashline1.exp: Use [pwd] instead of $objdir. diff --git a/gdb/testsuite/Makefile.in b/gdb/testsuite/Makefile.in index 07d3942..6233fd2 100644 --- a/gdb/testsuite/Makefile.in +++ b/gdb/testsuite/Makefile.in @@ -145,8 +145,12 @@ installcheck: # given. If RUNTESTFLAGS is not empty, then by default the tests will # be serialized. This can be overridden by setting FORCE_PARALLEL to # any non-empty value. For a non-GNU make, do not parallelize. +# If we run tests in parallel, set the OUTPUTDIR parallel-run, otherwise +# set it sequential-run. @GMAKE_TRUE@CHECK_TARGET =3D $(if $(FORCE_PARALLEL),check-parallel,$(if $(= RUNTESTFLAGS),check-single,$(if $(saw_dash_j),check-parallel,check-single))) +@GMAKE_TRUE@OUTPUTDIR =3D $(if $(FORCE_PARALLEL),parallel-run,$(if $(RUNTE= STFLAGS),sequential-run,$(if $(saw_dash_j),parallel-run,sequential-run))) @GMAKE_FALSE@CHECK_TARGET =3D check-single +@GMAKE_FALSE@OUTPUTDIR =3D sequential-run =20 # Note that we must resort to a recursive make invocation here, # because GNU make 3.82 has a bug preventing MAKEFLAGS from being used @@ -193,15 +197,16 @@ DO_RUNTEST =3D \ @GMAKE_TRUE@ $(MAKE) check TESTS=3D"gdb.$*/*.exp" =20 check-single: - $(DO_RUNTEST) $(RUNTESTFLAGS) $(expanded_tests_or_none) + -mkdir -p $(OUTPUTDIR) + $(DO_RUNTEST) OUTPUTDIR=3D$(OUTPUTDIR) $(RUNTESTFLAGS) $(expanded_tests_o= r_none) =20 check-parallel: - -rm -rf cache outputs temp + -rm -rf cache $(OUTPUTDIR) temp $(MAKE) -k do-check-parallel; \ $(SHELL) $(srcdir)/dg-extract-results.sh \ - `find outputs -name gdb.sum -print` > gdb.sum; \ + `find $(OUTPUTDIR) -name gdb.sum -print` > gdb.sum; \ $(SHELL) $(srcdir)/dg-extract-results.sh -L \ - `find outputs -name gdb.log -print` > gdb.log + `find $(OUTPUTDIR) -name gdb.log -print` > gdb.log @sed -n '/=3D=3D=3D gdb Summary =3D=3D=3D/,$$ p' gdb.sum =20 # Turn a list of .exp files into "check/" targets. Only examine .exp @@ -226,8 +231,8 @@ do-check-parallel: $(TEST_TARGETS) @: =20 @GMAKE_TRUE@check/%.exp: -@GMAKE_TRUE@ -mkdir -p outputs/$* -@GMAKE_TRUE@ @$(DO_RUNTEST) GDB_PARALLEL=3Dyes --outdir=3Doutputs/$* $*.ex= p $(RUNTESTFLAGS) +@GMAKE_TRUE@ -mkdir -p $(OUTPUTDIR)/$* +@GMAKE_TRUE@ @$(DO_RUNTEST) GDB_PARALLEL=3Dyes OUTPUTDIR=3D$(OUTPUTDIR) --= outdir=3D$(OUTPUTDIR)/$* $*.exp $(RUNTESTFLAGS) =20 check/no-matching-tests-found: @echo "" @@ -235,8 +240,8 @@ check/no-matching-tests-found: @echo "" =20 check-perf: all $(abs_builddir)/site.exp - @if test ! -d gdb.perf; then mkdir gdb.perf; fi - $(DO_RUNTEST) --directory=3Dgdb.perf --outdir gdb.perf GDB_PERFTEST_MODE= =3Dboth $(RUNTESTFLAGS) + @if test ! -d $(OUTPUTDIR)/gdb.perf; then mkdir $(OUTPUTDIR)/gdb.perf; fi + $(DO_RUNTEST) --directory=3Dgdb.perf --outdir $(OUTPUTDIR)/gdb.perf GDB_P= ERFTEST_MODE=3Dboth OUTPUTDIR=3D$(OUTPUTDIR) $(RUNTESTFLAGS) =20 force:; =20 @@ -244,7 +249,7 @@ clean mostlyclean: -rm -f *~ core *.o a.out xgdb *.x *.grt bigcore.corefile .gdb_history -rm -f core.* *.tf *.cl *.py tracecommandsscript copy1.txt zzz-gdbscript -rm -f *.dwo *.dwp - -rm -rf outputs temp cache + -rm -rf sequential-run parallel-run temp cache -rm -f read1.so expect-read1 if [ x"${ALL_SUBDIRS}" !=3D x ] ; then \ for dir in ${ALL_SUBDIRS}; \ diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.base= /completion.exp index 9c79a29..3a9fba2 100644 --- a/gdb/testsuite/gdb.base/completion.exp +++ b/gdb/testsuite/gdb.base/completion.exp @@ -108,7 +108,7 @@ gdb_test_multiple "target ctf" "" { # is a parallel run or not. Firstly check file exists, and then # do the test on file completion. =20 -foreach dir1 [ list "./gdb.base" "./outputs/gdb.base/completion" ] { +foreach dir1 [ list "${OUTPUTDIR}/gdb.base" "${OUTPUTDIR}/gdb.base/complet= ion" ] { if { [remote_file host exists ${dir1}/completion] && [remote_file host exists ${dir1}/completion0.o] && [remote_file host exists ${dir1}/completion1.o] } { diff --git a/gdb/testsuite/gdb.base/hashline1.exp b/gdb/testsuite/gdb.base/= hashline1.exp index 1260b80..32290cd 100644 --- a/gdb/testsuite/gdb.base/hashline1.exp +++ b/gdb/testsuite/gdb.base/hashline1.exp @@ -31,7 +31,7 @@ close $fd =20 # The choice of path name for the source file is important in order to tri= gger # the bug. Using $new_srcfile here won't trigger the bug. -set compile_name [relative_filename $objdir $new_srcfile] +set compile_name [relative_filename [pwd] $new_srcfile] if { [gdb_compile $compile_name "${binfile}" executable {debug}] !=3D "" }= { untested hashline1.exp return -1 diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 08087f2..6905c77 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -3726,15 +3726,16 @@ proc default_gdb_init { test_file_name } { # the directory is returned. =20 proc standard_output_file {basename} { - global objdir subdir gdb_test_file_name GDB_PARALLEL + global objdir subdir gdb_test_file_name GDB_PARALLEL OUTPUTDIR =20 + set dir [file join $objdir $OUTPUTDIR $subdir] if {[info exists GDB_PARALLEL]} { - set dir [file join $objdir outputs $subdir $gdb_test_file_name] - file mkdir $dir - return [file join $dir $basename] - } else { - return [file join $objdir $subdir $basename] + set dir [file join $dir $gdb_test_file_name] } + + file mkdir $dir + + return [file join $dir $basename] } =20 # Return the name of a file in our standard temporary directory. @@ -3863,9 +3864,9 @@ proc gdb_init { test_file_name } { # inotify-tools package to use this. global GDB_INOTIFY inotify_pid if {[info exists GDB_INOTIFY] && ![info exists inotify_pid]} { - global outdir tool inotify_log_file + global outdir tool inotify_log_file OUTPUTDIR =20 - set exclusions {outputs temp gdb[.](log|sum) cache} + set exclusions {$OUTPUTDIR temp gdb[.](log|sum) cache} set exclusion_re ([join $exclusions |]) =20 set inotify_log_file [standard_temp_file inotify.out] @@ -4859,10 +4860,12 @@ if {[info exists GDB_PARALLEL]} { if {[is_remote host]} { unset GDB_PARALLEL } else { - file mkdir outputs temp cache + file mkdir temp cache } } =20 +file mkdir $OUTPUTDIR + proc core_find {binfile {deletefiles {}} {arg ""}} { global objdir subdir =20 diff --git a/gdb/testsuite/lib/trace-support.exp b/gdb/testsuite/lib/trace-= support.exp index a076bac..f090bfa 100644 --- a/gdb/testsuite/lib/trace-support.exp +++ b/gdb/testsuite/lib/trace-support.exp @@ -319,12 +319,11 @@ proc gdb_find_recursion_test_baseline { filename } { # Return the location of the IPA library. =20 proc get_in_proc_agent {} { - global objdir =20 if [target_info exists in_proc_agent] { return [target_info in_proc_agent] } else { - return $objdir/../gdbserver/libinproctrace.so + return ../gdbserver/libinproctrace.so } } =20