www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/02/10/09:07:05

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f
Date: Sun, 10 Feb 2002 13:43:17 +0000
From: "Richard Dawe" <rich AT phekda DOT freeserve DOT co DOT uk>
Sender: rich AT phekda DOT freeserve DOT co DOT uk
To: djgpp-workers AT delorie DOT com
X-Mailer: Emacs 21.0.98 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.6
Subject: Tests for src/libc/posix/regex
Message-Id: <E16ZuDx-0000np-00@phekda.freeserve.co.uk>
Reply-To: djgpp-workers AT delorie DOT com

Hello.

Please find below a patch that adds a Makefile to run the tests that
are distributed with the regex library. This patch removes
tests/libc/posix/regex/r1.c (which appears to be corrupted)
and adds a readme tests/libc/posix/regex pointing to the tests
in src/libc/posix/regex.

OK to commit?

Thanks, bye, Rich =]

Index: src/libc/posix/regex/makefile.tst
===================================================================
RCS file: makefile.tst
diff -N makefile.tst
*** /dev/null	Tue May  5 16:32:27 1998
--- makefile.tst	Sun Feb 10 08:38:41 2002
***************
*** 0 ****
--- 1,29 ----
+ CC = gcc
+ RM = rm
+ 
+ CFLAGS  += -g -Wall -I../../../../include
+ LDFLAGS += -g -Wall -L../../../../lib
+ 
+ OBJS = main.o debug.o split.o
+ 
+ default:	check
+ 
+ # Check target copied from makefile.bsd
+ check:	re tests
+ 	./re <tests
+ 	./re -el <tests
+ 	./re -er <tests
+ 
+ check-ignore:	re tests
+ 	-./re <tests
+ 	-./re -el <tests
+ 	-./re -er <tests
+ 
+ re:	$(OBJS)
+ 	$(CC) $(LDFLAGS) -o $@ $^
+ 
+ %.o:	%.c
+ 	$(CC) $(CFLAGS) -c $<
+ 
+ clean:
+ 	$(RM) -f $(OBJS) re re.exe
Index: src/libc/posix/regex/main.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/posix/regex/main.c,v
retrieving revision 1.2
diff -p -c -3 -r1.2 main.c
*** src/libc/posix/regex/main.c	1998/07/16 18:20:30	1.2
--- src/libc/posix/regex/main.c	2002/02/10 13:38:42
***************
*** 1,9 ****
--- 1,12 ----
+ /* Copyright (C) 2002 DJ Delorie, see COPYING.DJ for details */
  /* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
  #include <stdio.h>
  #include <string.h>
+ #include <stdlib.h>
  #include <sys/types.h>
  #include <regex.h>
  #include <assert.h>
+ #include <unistd.h>
  
  #include "main.ih"
  
*************** extern void regprint();
*** 24,29 ****
--- 27,33 ----
  /*
   - main - do the simple case, hand off to regress() for regression
   */
+ int
  main(argc, argv)
  int argc;
  char *argv[];
Index: src/libc/posix/regex/tests
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/posix/regex/tests,v
retrieving revision 1.1
diff -p -c -3 -r1.1 tests
*** src/libc/posix/regex/tests	1998/07/16 18:20:30	1.1
--- src/libc/posix/regex/tests	2002/02/10 13:38:44
*************** a\(b		bC	EPAREN
*** 49,57 ****
  a(b		C	EPAREN
  a(b		b	a(b	a(b
  # gag me with a right parenthesis -- 1003.2 goofed here (my fault, partly)
! a)		-	a)	a)
! )		-	)	)
  # end gagging (in a just world, those *should* give EPAREN)
  a)		b	a)	a)
  a\)		bC	EPAREN
  \)		bC	EPAREN
--- 49,58 ----
  a(b		C	EPAREN
  a(b		b	a(b	a(b
  # gag me with a right parenthesis -- 1003.2 goofed here (my fault, partly)
! a)		C	EPAREN	a)
! )		C	EPAREN	)
  # end gagging (in a just world, those *should* give EPAREN)
+ # (richdawe AT bigfoot DOT com): They seem to give EPAREN now!
  a)		b	a)	a)
  a\)		bC	EPAREN
  \)		bC	EPAREN
Index: tests/libc/posix/regex/readme
===================================================================
RCS file: readme
diff -N readme
*** /dev/null	Tue May  5 16:32:27 1998
--- readme	Sun Feb 10 08:38:47 2002
***************
*** 0 ****
--- 1,9 ----
+ README for regex tests
+ ~~~~~~~~~~~~~~~~~~~~~~
+ 
+ The tests for the regex library can be found with the regex library.
+ See the Makefile src/libc/posix/regex/makefile.tst. Run the tests
+ like so:
+ 
+ cd /path/to/djgpp/sources/src/libc/posix/regex
+ make -f makefile.tst
Index: tests/libc/posix/regex/r1.c
===================================================================
RCS file: r1.c
diff -N r1.c
*** /tmp/cvsdFtXjV	Sun Feb 10 08:38:47 2002
--- /dev/null	Tue May  5 16:32:27 1998
***************
*** 1,9 ****
- #include <stdio.h>
- #include <regex.h>
- 
- int
- main(int argc, char **argv)
- {
-   rexec_
-   regcomp("a.*x"
- }
--- 0 ----

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019