Re: relative line numbers and dg-line directive

Tom de Vries <[email protected]>
Newsgroups gmane.comp.sysutils.dejagnu.general
Message-ID <[email protected]>
On 05/29/2017 08:59 AM, Tom de Vries wrote:
> On 05/24/2017 03:13 PM, Tom de Vries wrote:
>> On 05/24/2017 12:18 AM, Ben Elliston wrote:
>>> On Tue, May 23, 2017 at 03:11:28PM +0200, Tom de Vries wrote:
>>>
>>>> Is there any interest in having either or both of these concepts
>>>> added to dejagnu's dg.exp?
>>>
>>> Yes, patches welcome. :)
>>>
>>
>> I managed to:
>> - check out sources,
>> - configure and build them, and
>> - check and install the build.
>>
>> My next step was to see where to add a dg-error testcase, but I didn't 
>> find a place.
>>
>> Attached is a patch that creates a standalone test-case testing 
>> dg-error using a dummy tool.
>>
> <SNIP>
>>
>> If something like this is good to have in the dejagnu sources, I could 
>> use some pointers on where and how to integrate this.
> 
> As a first step, attached patch:
> - runs the testsuite with --tool dejagnu
> - moves the corresponding test dirs into new dir testsuite/dejagnu.dg
> - moves the content of config/default.exp to lib/dejagnu.dg
> 

And as follow-up patch, we add a dummy tool.

Make check output:
...
Test run by vries on Mon May 29 09:03:54 2017
Native configuration is x86_64-pc-linux-gnu

		=== dejagnu tests ===

Schedule of variations:
     unix

Running target unix
Using ../src/testsuite/config/default.exp as tool-and-target-specific 
interface file.
Running ../src/testsuite/dejagnu.dg/libdejagnu/tunit.exp ...
Running ../src/testsuite/dejagnu.dg/runtest.all/libs.exp ...
Running ../src/testsuite/dejagnu.dg/runtest.all/load_lib.exp ...
Running ../src/testsuite/dejagnu.dg/runtest.all/options.exp ...
Running ../src/testsuite/dejagnu.dg/runtest.all/stats-sub.exp ...
Running ../src/testsuite/dejagnu.dg/runtest.all/stats.exp ...

		=== dejagnu Summary ===

# of expected passes		77
Test run by vries on Mon May 29 09:03:55 2017
Native configuration is x86_64-pc-linux-gnu

		=== dummy tests ===

Schedule of variations:
     unix

Running target unix
Using ../src/testsuite/config/default.exp as tool-and-target-specific 
interface file.
Running ../src/testsuite/dummy.dg/dg.exp ...

		=== dummy Summary ===

# of expected passes		2
make[1]: Leaving directory '/home/vries/dejagnu/build'
...

Thanks,
- Tom

_______________________________________________
DejaGnu mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/dejagnu
0002-Add-dummy-tool-in-testsuite.patch (text/x-patch, 2.4 KB)
Add dummy tool in testsuite

2017-05-29  Tom de Vries  <[email protected]>

	* testsuite/dummy.dg/dg-error.test: New test.
	* testsuite/dummy.dg/dg.exp: New file.
	* testsuite/lib/dummy.exp: New file.
	* Makefile.am (DEJATOOL): Add dummy tool.
	* Makefile.in: Regenerate.

---
 Makefile.am                      | 2 ++
 Makefile.in                      | 2 +-
 testsuite/dummy.dg/dg-error.test | 1 +
 testsuite/dummy.dg/dg.exp        | 7 +++++++
 testsuite/lib/dummy.exp          | 5 +++++
 5 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 89ea2e6..a189dc4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,6 +21,8 @@
 AUTOMAKE_OPTIONS = dejagnu
 export DEJAGNU
 
+DEJATOOL = $(PACKAGE) dummy
+
 EXTRA_DIST = ChangeLog-1992 MAINTAINERS runtest \
 	$(pkgdata_DATA) $(config_DATA) $(baseboard_DATA) \
 	$(TESTSUITE_FILES) $(XML) $(CONTRIB)
diff --git a/Makefile.in b/Makefile.in
index 854f516..c89d2bd 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -259,7 +259,6 @@ ETAGS = etags
 CTAGS = ctags
 CSCOPE = cscope
 AM_RECURSIVE_TARGETS = cscope
-DEJATOOL = $(PACKAGE)
 am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in AUTHORS \
 	COPYING ChangeLog INSTALL NEWS README TODO compile \
 	config.guess config.sub depcomp install-sh missing texinfo.tex
@@ -374,6 +373,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 AUTOMAKE_OPTIONS = dejagnu
+DEJATOOL = $(PACKAGE) dummy
 EXTRA_DIST = ChangeLog-1992 MAINTAINERS runtest \
 	$(pkgdata_DATA) $(config_DATA) $(baseboard_DATA) \
 	$(TESTSUITE_FILES) $(XML) $(CONTRIB)
diff --git a/testsuite/dummy.dg/dg-error.test b/testsuite/dummy.dg/dg-error.test
new file mode 100644
index 0000000..c25b6a8
--- /dev/null
+++ b/testsuite/dummy.dg/dg-error.test
@@ -0,0 +1 @@
+echo "first.test:1: error: bla" # { dg-error "bla" "" }
diff --git a/testsuite/dummy.dg/dg.exp b/testsuite/dummy.dg/dg.exp
new file mode 100644
index 0000000..52e8ab9
--- /dev/null
+++ b/testsuite/dummy.dg/dg.exp
@@ -0,0 +1,7 @@
+load_lib dg.exp
+dg-init
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.test]] \
+    "" \
+    ""
+dg-finish
+
diff --git a/testsuite/lib/dummy.exp b/testsuite/lib/dummy.exp
new file mode 100644
index 0000000..e1b4fee
--- /dev/null
+++ b/testsuite/lib/dummy.exp
@@ -0,0 +1,5 @@
+proc dummy-dg-test { prog do_what extra_tool_flags } {
+    set output [exec /bin/sh $prog]
+    return [list $output ""]
+}
+
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.