dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: treecc/tests normalize.c,NONE,1.1 .cvsignore


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: treecc/tests normalize.c,NONE,1.1 .cvsignore,1.1.1.1,1.2 Makefile.am,1.4,1.5 run_tests,1.4,1.5
Date: Wed, 29 Jan 2003 04:08:01 -0500

Update of /cvsroot/dotgnu-pnet/treecc/tests
In directory subversions:/tmp/cvs-serv18004/tests

Modified Files:
        .cvsignore Makefile.am run_tests 
Added Files:
        normalize.c 
Log Message:


Replace the reference to "sed" in "run_tests" with "normalize", to work
around problems with CRLF's under cygwin.


--- NEW FILE ---
/*
 * normalize.c - Normalize end of line markers.
 *
 * Copyright (C) 2003  Southern Storm Software, Pty Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#include <stdio.h>

#ifdef  __cplusplus
extern  "C" {
#endif

int main(int argc, char *argv[])
{
        int ch;
        while((ch = getc(stdin)) != EOF)
        {
                if(ch == 0x0A)
                {
                        putc('\n', stdout);
                }
                else if(ch == 0x0D)
                {
                        putc('\n', stdout);
                        ch = getc(stdin);
                        if(ch == EOF)
                        {
                                break;
                        }
                        else if(ch != 0x0A)
                        {
                                ungetc(ch, stdin);
                        }
                }
                else
                {
                        putc(ch, stdout);
                }
        }
        return 0;
}

#ifdef  __cplusplus
};
#endif

Index: .cvsignore
===================================================================
RCS file: /cvsroot/dotgnu-pnet/treecc/tests/.cvsignore,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** .cvsignore  7 Aug 2001 22:48:11 -0000       1.1.1.1
--- .cvsignore  29 Jan 2003 09:07:58 -0000      1.2
***************
*** 5,6 ****
--- 5,8 ----
  test_parse
  test_output
+ normalize
+ *.exe

Index: Makefile.am
===================================================================
RCS file: /cvsroot/dotgnu-pnet/treecc/tests/Makefile.am,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** Makefile.am 15 Dec 2002 13:17:08 -0000      1.4
--- Makefile.am 29 Jan 2003 09:07:58 -0000      1.5
***************
*** 1,3 ****
! noinst_PROGRAMS = test_input test_parse test_output
  
  test_input_SOURCES = test_input.c
--- 1,3 ----
! noinst_PROGRAMS = test_input test_parse test_output normalize
  
  test_input_SOURCES = test_input.c
***************
*** 9,12 ****
--- 9,14 ----
  test_output_SOURCES = test_output.c
  test_output_LDADD = ../libtreecc.a
+ 
+ normalize_SOURCES = normalize.c
  
  TESTS = run_tests

Index: run_tests
===================================================================
RCS file: /cvsroot/dotgnu-pnet/treecc/tests/run_tests,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** run_tests   15 Dec 2002 23:54:30 -0000      1.4
--- run_tests   29 Jan 2003 09:07:59 -0000      1.5
***************
*** 28,33 ****
  {
        echo -n "$1 $2.tst: "
!       if ./$1 "$srcdir/$2.tst" | sed 's/
//g' >$TMPFILE ; then
!               cat "$srcdir/$2.out" | sed 's/
//g' >$TMPFILEC
                if diff $TMPFILEC $TMPFILE >$TMPFILEB ; then
                        echo "ok"
--- 28,33 ----
  {
        echo -n "$1 $2.tst: "
!       if ./$1 "$srcdir/$2.tst" | ./normalize >$TMPFILE ; then
!               cat "$srcdir/$2.out" | ./normalize >$TMPFILEC
                if diff $TMPFILEC $TMPFILE >$TMPFILEB ; then
                        echo "ok"





reply via email to

[Prev in Thread] Current Thread [Next in Thread]