--- /dev/null
+
+CFLAGS = -O -g
+CPPFLAGS = -I../.. -DUSUAL -DUSE_INTERNAL_REGEX
+LDFLAGS = -g
+LIBS = ../libusual.a
+
+all: testregex.usual testregex.libc
+
+testregex.usual: testregex.o
+ $(CC) $(LDFLAGS) -o $@ $< $(LIBS)
+
+testregex.o: testregex.c
+ $(CC) $(DEFS) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+
+testregex.libc: testregex.c
+ $(CC) $(CFLAGS) -o $@ $<
+
+
+clean:
+ rm -f testregex testregex.o testregex.usual testregex.libc
+
--- /dev/null
+#! /bin/sh
+
+rxtest=./testregex.libc
+rxtest=./testregex.usual
+
+tests="basic.dat categorize.dat nullsubexpr.dat"
+tests="$tests rightassoc.dat"
+#tests="$tests leftassoc.dat"
+tests="$tests forcedassoc.dat"
+tests="$tests repetition.dat"
+
+for t in $tests; do
+ #printf "%-16s" "$t"
+ #$rxtest < data/$t | grep -vE '(NOTE|Research)'
+ $rxtest < data/$t | tail -n +5 | grep -vE 'haskell|mimi'
+done
+
+#$rxtest < data/categorize.dat | tail -n +4
+
#endif
#include <stdio.h>
-#include <regex.h>
#include <ctype.h>
#include <setjmp.h>
#include <signal.h>
#include <locale.h>
#endif
+#define getline(x) xgetline(x)
+#ifdef USUAL
+#include <usual/regex.h>
+#else
+#include <regex.h>
+#endif
+
#if !_PACKAGE_ast
#undef REG_DISCIPLINE
#endif
else
{
report("re_nsub incorrect", fun, re, NiL, -1, msg, flags, test);
- printf("at least %d expected, %d returned\n", nsub, preg.re_nsub);
+ printf("at least %d expected, %d returned\n", nsub, (int)preg.re_nsub);
state.errors++;
}
}