Skip to content

Commit b6066a4

Browse files
committed
Support scenario outlines
Previously, a linear line-by-line processing of scenario specifications was assumed, which was helpful, but for supporting scenario outlines, we need the ability for running the steps again with new data. For this reason the processing and its buffering was refactored for supporting rerunning steps at any time. It was also assumed tables can be parsed simply via regular expressions, which worked fine for simple cases, but in the case of scenario outlines we need to reference values from a table by a named column, and we needed a full support for getting data a row at a time. A large part of scenario outlines works via a simple reusable search-and-replace algorithm that expand tokens with data. Reusable helpers were created for this purpose: expand_token() and expand_tokens() and these are called from call_step() if we're running steps on a scenario outline. Example tests for scenario outlines were added to examples/tests/, please see the "bank.feature".
1 parent 9696af0 commit b6066a4

File tree

8 files changed

+628
-97
lines changed

8 files changed

+628
-97
lines changed

Makefile.in

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ mandir = $(datarootdir)/man
1010
includedir = $(prefix)/include
1111

1212
PROG = crbehave
13-
OBJS = crbehave.o
13+
OBJS = expand.o crbehave.o
1414

1515
INSTALL = install
1616
INSTALLFLAGS =
@@ -44,3 +44,7 @@ uninstall:
4444
rm $(DESTDIR)$(libdir)/pkgconfig/$(PROG).pc ; fi
4545
if [ -e $(includedir)/crbehave.h ] ; then \
4646
rm $(DESTDIR)$(includedir)/crbehave.h ; fi
47+
48+
# Dependencies
49+
crbehave.o: crbehave.c crbehave.h expand.h
50+
expand.o: expand.c expand.h

0 commit comments

Comments
 (0)