Skip to content
This repository was archived by the owner on Nov 9, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
17a67e5
gherkin: Build c impl on travis
aslakhellesoy Mar 12, 2017
5d25eeb
Add rsync file
aslakhellesoy Mar 13, 2017
fe8dcb7
gherkin: rsync testada to c subrepo
aslakhellesoy Mar 13, 2017
f0d33c7
gherkin: rsync more files for an independent build of c
aslakhellesoy Mar 13, 2017
f1b4d66
gherkin-c: Build Windows binaries
aslakhellesoy Mar 15, 2017
c7dad23
gherkin: Run full build on Travis
aslakhellesoy Mar 15, 2017
82d8bbf
build: Build everything from root
aslakhellesoy Mar 20, 2017
392e3d0
build: Add Dockerfile. Build (almost) all projects
aslakhellesoy Mar 21, 2017
71ee504
build: Enable docker build on Travis
aslakhellesoy Mar 21, 2017
fd10daf
gherkin: (C) Manually convert uri:s from char* to wchar_t*.
brasmusson Apr 2, 2017
ab9bb55
gherkin: (C) Remove the Alpine exception from the Makefile.
brasmusson Apr 2, 2017
639197f
gherkin: (C) Use UTF-16 when wchar_t is of 2 bytes size.
brasmusson Apr 15, 2017
f54d355
gherkin: (C) Always print feature file data using UTF-8.
brasmusson Apr 17, 2017
00ee9b1
gherkin: (C) Conform to C90 (mostly)
brasmusson Apr 23, 2017
8f31c2f
gherkin: (C) Avoid using repeated typedefs (support gcc <v4.6)
brasmusson Apr 23, 2017
a65b4fb
gherkin: Fix incorrect use of .DELETE_ON_ERROR in Makefile
aslakhellesoy Aug 18, 2017
fe65a6d
cmake support
Sep 9, 2017
c4d44f6
Merge pull request #3 from Pwera/master
aslakhellesoy Sep 9, 2017
af5fb3f
Tescase illustrating a segfault
aslakhellesoy Oct 4, 2017
e802519
Fix broken link to Gherkin docs
mlvandijk Oct 1, 2017
157d8a6
gherkin: (C) Do not let Scenario Outlines Pickles share tags.
brasmusson Oct 5, 2017
62e7ab2
Merge pull request #4 from cucumber/segfault-testcase
aslakhellesoy Oct 6, 2017
fefae27
Merge branch 'gherkin-simplify-grammar'
aslakhellesoy Oct 6, 2017
f2da1e2
Merge branch 'empty-pickle-for-empty-scenario'
aslakhellesoy Oct 6, 2017
5fa7358
gherkin: Regenerate parsers
aslakhellesoy Oct 6, 2017
e1d5cbd
git subrepo pull (merge) gherkin/c
aslakhellesoy Oct 6, 2017
b46061e
Replace '+ +' with just '+', assuming typo
aslakhellesoy Oct 6, 2017
f9940cd
gherkin: gherkin-c tests pipe through jq for verification
aslakhellesoy Oct 13, 2017
853c4e4
Merge pull request #288 from cucumber/cr-generateWithLanguage
aslakhellesoy Oct 13, 2017
f94c221
Rename text/vnd.cucumber.stacktrace+plain to text/x.cucumber.stacktra…
aslakhellesoy Oct 13, 2017
3bd8895
library is now imported target
Nov 1, 2017
18dbc6e
gif
Nov 1, 2017
930d607
readme
Nov 1, 2017
3db5d32
readme
Nov 1, 2017
634210c
readme
Nov 1, 2017
3092059
new gif
Nov 1, 2017
d6c02f8
Delete gherkin.gif
Nov 1, 2017
6043555
new gif
Nov 1, 2017
0162b96
readme
Nov 1, 2017
23827e1
readme
Nov 1, 2017
abf07a6
Merge branch 'master' into master
Nov 3, 2017
17d600b
Merge branch 'master' into master
Nov 3, 2017
99f78a6
Merge pull request #5 from Pwera/master
Nov 3, 2017
2154c07
Update build
aslakhellesoy Nov 27, 2017
970eef1
Bump node, regenerate gherkin
aslakhellesoy Jan 19, 2018
22762f9
Added changes to Makefiles to create shared object
cyocum Jan 23, 2018
65ab06d
Made libgherkin.so build by default
cyocum Jan 23, 2018
b974507
Removed unnecessary linker directive
cyocum Jan 23, 2018
b0ade5f
Created a make install and moved file
cyocum Jan 23, 2018
621dd46
Attempting to fix error on CI with mingw-gcc
Jan 25, 2018
1cc5148
Try building on both OS X and Linux
aslakhellesoy Jan 26, 2018
8325fb2
Made changes based on reviewer feedback
Jan 26, 2018
5f94c3c
Revert "Try building on both OS X and Linux"
aslakhellesoy Jan 26, 2018
0ab29c3
gherkin: Customise before_install for osx/linux
aslakhellesoy Jan 26, 2018
aab1d21
gherkin: Add missing then
aslakhellesoy Jan 26, 2018
9919ae0
gherkin: Try to fix build
aslakhellesoy Jan 26, 2018
77f8199
gherkin: Speed up build by conditionally installing mingw/wine
aslakhellesoy Jan 26, 2018
8d9cb13
Merge branch 'osx-ci'
aslakhellesoy Jan 26, 2018
5c32f9f
Build on osx as well as linux
aslakhellesoy Jan 26, 2018
7a63949
Merge branch 'master' into libs_so
aslakhellesoy Jan 26, 2018
9e73887
Removed -soname from shared flags as this was causing failure on OSX
Jan 26, 2018
9ca47fa
Added libs_so to all target
cyocum Jan 29, 2018
05c5675
Correct the target of the make rule for the dynamic library.
brasmusson Jan 29, 2018
9f1cd4d
gherkin: Add .PHONY targets, formatting
aslakhellesoy Jan 30, 2018
79a1444
gherkin: Change S3 bucket region to EU (London)
aslakhellesoy Jan 30, 2018
ae1a89c
gherkin: Fix travis yaml
aslakhellesoy Jan 30, 2018
0898959
gherkin: Switch back to us-east-1
aslakhellesoy Jan 30, 2018
1f26b83
Merge pull request #8 from cucumber/travis-artifacts
aslakhellesoy Jan 30, 2018
0bd23be
Merge branch 'master' into libs_so
aslakhellesoy Jan 30, 2018
ccb685f
Merge pull request #6 from cucumber/libs_so
aslakhellesoy Feb 10, 2018
43f47a0
Kick git subrepo
aslakhellesoy Mar 6, 2018
e97a78d
Include interpolation of docstring content type.
rjwittams Oct 22, 2017
5335765
gherkin: c: regenerate lexer
aslakhellesoy Jan 23, 2018
14bb163
gherkin: Add Aragonese.
aslakhellesoy Jan 31, 2018
23b2c1a
gherkin: Allow mono to fail. Idempotent BOM removal.
aslakhellesoy Apr 6, 2018
93541ac
gherkin: Use awk to remove BOM (sed trick doesn't work on OSX)
aslakhellesoy Apr 6, 2018
1a4aaab
fixed segfault when file does not exist
Apr 24, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .rsync
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
../LICENSE LICENSE
../testdata/ testdata/
../gherkin.berp gherkin.berp
../bin/ berp/
../gherkin-languages.json gherkin-languages.json
37 changes: 37 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
dist: trusty
language: c
sudo: required
compiler:
- clang
- gcc
- i686-w64-mingw32-gcc
os:
- linux
- osx
before_install:
- if [[ "$CC" == "i686-w64-mingw32-gcc" ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]];
then sudo dpkg --add-architecture i386 ; fi
- if [[ "$CC" == "i686-w64-mingw32-gcc" ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]];
then sudo add-apt-repository -y ppa:ubuntu-wine/ppa ; fi
- if [[ "$CC" == "i686-w64-mingw32-gcc" ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]];
then sudo apt-get update -qq ; fi
- if [[ "$CC" == "i686-w64-mingw32-gcc" ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]];
then sudo apt-get remove -qq -y mingw32 ; fi
- if [[ "$CC" == "i686-w64-mingw32-gcc" ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]];
then sudo apt-get install -q -y mingw-w64 ; fi
- if [[ "$CC" == "i686-w64-mingw32-gcc" ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]];
then sudo apt-get install --no-install-recommends -y wine1.8 ; fi
- if [[ "$CC" == "i686-w64-mingw32-gcc" ]] && [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew install mingw-w64 ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install jq ;
fi
script: if [[ "$CC" == "i686-w64-mingw32-gcc" ]] && [[ "$TRAVIS_OS_NAME" == "osx"
]]; then make CC=${CC} cli; else make CC=${CC} ; fi
addons:
artifacts: true
env:
global:
- ARTIFACTS_PATHS="./bin:./libs"
- ARTIFACTS_BUCKET=cucumber-oss
- secure: aaC95l0Tq63040to71E2WGQHGyW+5qq9T0cujbgtx7UlVKq3XJ4IdPt+gT+GO9EddLkrrQ+09T27G56RO9hjfLWd3Xxf4+TCIhUQUEp5yD2ApLBP/BM4UeRgwjZKaxdtXsLcv8B8FNWAlZ0IyvA6TssZLge2gXIECm7yfJFJlQhjP0exmP5AN1YaC8IV8KwNT2rx8JZo5Q2nERKH0MCtuPCGdAIBCqZbrYwLj//FMl+YSTuzpAGiqXXosgSIsNJwIrKNJckEMoB7ZDWLCsCdzSZKNabpPd1yqwNxM/5zncfQ7V0oXx6mY2iusR64d8Icq5HAdGe9g2Pwpsme1Ptydiw19dwFaxs1PSJwFRiRhkMZIRZFHzyCpOZg9Zr1uftyPmV7RfKI0FUvmkuYGF0VxDXwP7B/nKWTSNqBvTlZ48O5b3rslNLqFf20WF1Qvll2IZ3Dmj8tcZYa1Rr9fivWnCKUZVfcADG98lcyVgpi9sojb4nvGLGB7Ux8tQt9Ka0jfp/7eaXAf8LLGDXYSj1VHKw94vgnM0ESsjTFBMLUtjymvUaQPGZeiIzcA8m6jo6Sjatg+GBZKADZo4R351BotUWzsLCyYfS0k+HJFpKKjPFKdFZob+6B5yJUk18Xcnj3vo+P0L6v2EpEE70qzQuAmCFTUXpVPAqoYtnxko10i4Y=
- secure: Cm9A5zBoy2rbgTeh+70ZGyWgnoeiLzQwKPrC9EksWUNuOzTEfAsV5+2c+owb6DKshoI6tGye3tl61q36A1nhJgZ/DyjDoIOa+hi+IAbBw4u0CbFjEEbdbGxyoe0PbcBaLgDFMnvA1wzITisfhdVNoOhQIO+DhsuhpVn/fj14hUdi1s4vujSwZLIPPWUe7FT0B4tIsV0+wBflGdLa55j3oEIB6CyMFaa2v5xTFdqteiWlfapojJGQ20VQz9TerJFFdIMyKiPb5shsO9zd1ioxZRpL7iJDUuWKzNq90iQX6++62veAdoJR4EX+arJbhfQl/oLCeExI3nlP00qx6jku/AIO6lsdW8kwmeEeiD1BjC1btwQaeJ6Vx+eex02ZO27CSyulzDB3KttrKcfwnxwgjDzi8oNy2WhnHN6nNH7S9+dbhzGo50dJeQhdQUHKqHPBnAvHJBhuYsy3xaOD0n2Ys3ixT1lAsjwwPBstC/4T8TgBJ1HcxINCYwjnUZNc5JKhZLTh37HZCl5ROuANeaJDSbKvjwIf7bXIBO5+5xsgWtRbbXz3KQ04hTSVCuDaPbG/TPyQIMafgGuTgEhcEoex7KZWMk8f1GecjlJcit7v2VidFahdbRPZxF+HRugw6rVHxhfhjZdgZRpBWi3O9YGoJrQx7C6DgkKK3xrATOK0lmQ=
133 changes: 133 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
PROJECT(gherkin C)
cmake_minimum_required(VERSION 3.0)
# Install library & headers in your directory
#SET(CMAKE_INSTALL_PREFIX "")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
LIST(APPEND GHERKIN_SRS
src/file_reader.c
src/file_utf8_source.c
src/print_utilities.c
src/string_utilities.c
src/unicode_utilities.c
src/utf8_source.c
src/parser.c
src/token_scanner.c
src/file_token_scanner.c
src/string_token_scanner.c
src/token_matcher.c
src/token.c
src/token_queue.c
src/item_queue.c
src/gherkin_line.c
src/error.c
src/error_list.c
src/dialect.c
src/ast_builder.c
src/ast_node.c
src/gherkin_document.c
src/feature.c
src/scenario.c
src/scenario_outline.c
src/background.c
src/comment.c
src/data_table.c
src/doc_string.c
src/example_table.c
src/step.c
src/table_cell.c
src/table_row.c
src/tag.c
src/compiler.c
src/pickle.c
src/pickle_cell.c
src/pickle_location.c
src/pickle_row.c
src/pickle_step.c
src/pickle_string.c
src/pickle_table.c
src/pickle_tag.c
src/event.c
src/attachment_event.c
src/gherkin_document_event.c
src/pickle_event.c
src/source_event.c
src/ast_printer.c
src/pickle_printer.c
)

LIST(APPEND GENERATE_TOKEN
src/token_formatter_builder.c
src/gherkin_generate_tokens.c
)
LIST(APPEND GHERKIN_CLI
src/gherkin_cli.c
)


add_library(gherkin SHARED ${GHERKIN_SRS})
target_include_directories(gherkin PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include;${CMAKE_CURRENT_SOURCE_DIR}/src>")

add_executable(gherkinexe ${GHERKIN_CLI})
target_link_libraries(gherkinexe gherkin)
target_include_directories(gherkinexe PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/src)

add_executable(gherkin_generate_tokens ${GENERATE_TOKEN})
target_link_libraries(gherkin_generate_tokens gherkin)

file(GLOB GOOD_FEATURE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/testdata/good/*.feature
)
file(GLOB BAD_FEATURE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/testdata/bad/*.feature
)
add_custom_target(invo DEPENDS invo)
add_dependencies(invo gherkinexe)
FOREACH(ENTITY ${GOOD_FEATURE_FILES})
add_custom_command(
TARGET gherkinexe
POST_BUILD
COMMAND gherkinexe ${ENTITY}
DEPENDS invo
)
ENDFOREACH()
############ Installation section ############
set(include_install_dir "include")
set(lib_install_dir "lib/")
set(bin_install_dir "bin/")
set(config_install_dir "lib/cmake/")

set(project_config "${CMAKE_CURRENT_BINARY_DIR}/generated/${PROJECT_NAME}Config.cmake")
set(targets_export_name "${PROJECT_NAME}Targets")

set(namespace "${PROJECT_NAME}::")

configure_file("${PROJECT_SOURCE_DIR}/cmake/Config.cmake.in" "${project_config}" @ONLY)

# Install target (will install the library to specified CMAKE_INSTALL_PREFIX variable)
install(
TARGETS gherkin
EXPORT ${targets_export_name}
ARCHIVE DESTINATION ${lib_install_dir}
LIBRARY DESTINATION ${lib_install_dir}
RUNTIME DESTINATION ${lib_install_dir}
INCLUDES DESTINATION ${include_install_dir})

install(
DIRECTORY "${PROJECT_SOURCE_DIR}/include/"
DESTINATION ${include_install_dir}
FILES_MATCHING PATTERN "*.*h")

install(
FILES "${project_config}"
DESTINATION "${config_install_dir}")

install(
EXPORT "${targets_export_name}"
NAMESPACE "${namespace}"
DESTINATION "${config_install_dir}")

add_custom_target(install_${PROJECT_NAME}
$(MAKE) install
DEPENDS gherkin
COMMENT "Installing ${PROJECT_NAME}")
28 changes: 28 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Building the `gin/gherkin` binary

## Build with gcc:

make cli

## Build with clang

make CC=clang cli

## Build Windows binaries with mingw

Install the toolchain (OS X)

brew install mingw-w64
# Run `brew info mingw-w64` to verify the path before next command
export PATH=/usr/local/Cellar/mingw-w64/5.0.1/bin:$PATH
# Install wine - for testing
brew cask install xquartz
brew install wine

Build:

make CC=i686-w64-mingw32-gcc cli

## Build with other compilers

Edit `src/Makefile` and set CC, CC_FLAGS, AR, AR_FLAGS, LD, LD_FLAGS appropriately, then run `make cli`
119 changes: 68 additions & 51 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,94 +1,111 @@
SHELL := /usr/bin/env bash
GOOD_FEATURE_FILES = $(shell find ../testdata/good -name "*.feature")
BAD_FEATURE_FILES = $(shell find ../testdata/bad -name "*.feature")
GOOD_FEATURE_FILES = $(shell find testdata/good -name "*.feature")
BAD_FEATURE_FILES = $(shell find testdata/bad -name "*.feature")

TOKENS = $(patsubst ../testdata/%.feature,acceptance/testdata/%.feature.tokens,$(GOOD_FEATURE_FILES))
ASTS = $(patsubst ../testdata/%.feature,acceptance/testdata/%.feature.ast.ndjson,$(GOOD_FEATURE_FILES))
PICKLES = $(patsubst ../testdata/%.feature,acceptance/testdata/%.feature.pickles.ndjson,$(GOOD_FEATURE_FILES))
SOURCES = $(patsubst ../testdata/%.feature,acceptance/testdata/%.feature.source.ndjson,$(GOOD_FEATURE_FILES))
ERRORS = $(patsubst ../testdata/%.feature,acceptance/testdata/%.feature.errors.ndjson,$(BAD_FEATURE_FILES))
TOKENS = $(patsubst testdata/%.feature,acceptance/testdata/%.feature.tokens,$(GOOD_FEATURE_FILES))
ASTS = $(patsubst testdata/%.feature,acceptance/testdata/%.feature.ast.ndjson,$(GOOD_FEATURE_FILES))
PICKLES = $(patsubst testdata/%.feature,acceptance/testdata/%.feature.pickles.ndjson,$(GOOD_FEATURE_FILES))
SOURCES = $(patsubst testdata/%.feature,acceptance/testdata/%.feature.source.ndjson,$(GOOD_FEATURE_FILES))
ERRORS = $(patsubst testdata/%.feature,acceptance/testdata/%.feature.errors.ndjson,$(BAD_FEATURE_FILES))

SRC_FILES= $(shell find src -name "*.[ch]*")

all: .compared
.PHONY: all
ifeq ($(CC),i686-w64-mingw32-gcc)
GHERKIN=bin/gherkin.exe
RUN_GHERKIN=wine $(GHERKIN)
GHERKIN_GENERATE_TOKENS=bin/gherkin_generate_tokens.exe
RUN_GHERKIN_GENERATE_TOKENS=wine $(GHERKIN_GENERATE_TOKENS)
else
GHERKIN=bin/gherkin
RUN_GHERKIN=$(GHERKIN)
GHERKIN_GENERATE_TOKENS=bin/gherkin_generate_tokens
RUN_GHERKIN_GENERATE_TOKENS=$(GHERKIN_GENERATE_TOKENS)
endif

.DELETE_ON_ERROR:

default: .compared
.PHONY: default

.compared: .built $(TOKENS) $(ASTS) $(PICKLES) $(ERRORS) $(SOURCES) .run
touch $@

.built: ./include/rule_type.h src/parser.c src/dialect.c $(SRC_FILES) src/Makefile LICENSE
$(CC) --version
cd src; $(MAKE)
touch $@

clean:
rm -rf .compared .built .run acceptance ./include/rule_type.h src/parser.c src/dialect.c
rm -rf .compared .built .run acceptance
cd src; $(MAKE) $@
.PHONY: clean

cli: ./include/rule_type.h src/parser.c src/dialect.c $(SRC_FILES) src/Makefile
cd src; $(MAKE) $@
clobber: clean
rm -rf ./include/rule_type.h src/parser.c src/dialect.c
.PHONY: clobber

cli: ./include/rule_type.h src/parser.c src/dialect.c $(SRC_FILES) src/Makefile
cd src; $(MAKE) CC=$(CC) $@
.PHONY: libs

libs: ./include/rule_type.h src/parser.c src/dialect.c $(SRC_FILES) src/Makefile
cd src; $(MAKE) $@
libs: ./include/rule_type.h src/parser.c src/dialect.c $(SRC_FILES) src/Makefile
cd src; $(MAKE) CC=$(CC) $@
.PHONY: libs

.run: bin/gherkin $(GOOD_FEATURE_FILES)
bin/gherkin --no-source --no-ast --no-pickles $(GOOD_FEATURE_FILES)
touch .run
libs_so: ./include/rule_type.h src/parser.c src/dialect.c $(SRC_FILES) src/Makefile
cd src; $(MAKE) CC=$(CC) $@
.PHONY: libs_so

./include/rule_type.h: ../gherkin.berp gherkin-c-rule-type.razor ../bin/berp.exe
mono ../bin/berp.exe -g ../gherkin.berp -t gherkin-c-rule-type.razor -o $@
.run: cli $(GHERKIN) $(GOOD_FEATURE_FILES)
$(RUN_GHERKIN) $(GOOD_FEATURE_FILES) | jq . > /dev/null
touch $@

./include/rule_type.h: gherkin.berp gherkin-c-rule-type.razor
# Some build environments (Travis) mess up timestamps
# so that all files have the same timestamp, causing make to think this
# file needs to be rebuilt when it's actually uptodate. Our travis build doesn't
# have mono, so we'll allow this line to fail.
-mono berp/berp.exe -g gherkin.berp -t gherkin-c-rule-type.razor -o $@
# Remove BOM
tail -c +4 $@ > [email protected]
awk 'NR==1{sub(/^\xef\xbb\xbf/,"")}{print}' < $@ > [email protected]
mv [email protected] $@

src/parser.c: ../gherkin.berp gherkin-c-parser.razor ../bin/berp.exe
mono ../bin/berp.exe -g ../gherkin.berp -t gherkin-c-parser.razor -o $@
src/parser.c: gherkin.berp gherkin-c-parser.razor
# Some build environments (Travis) mess up timestamps
# so that all files have the same timestamp, causing make to think this
# file needs to be rebuilt when it's actually uptodate. Our travis build doesn't
# have mono, so we'll allow this line to fail.
-mono berp/berp.exe -g gherkin.berp -t gherkin-c-parser.razor -o $@
# Remove BOM
tail -c +4 $@ > [email protected]
awk 'NR==1{sub(/^\xef\xbb\xbf/,"")}{print}' < $@ > [email protected]
mv [email protected] $@

src/dialect.c: ../gherkin-languages.json dialect.c.jq
$(MAKE) update-gherkin-languages
src/dialect.c: gherkin-languages.json dialect.c.jq
cat $< | jq -f dialect.c.jq -r -c > $@

acceptance/testdata/%.feature.tokens: ../testdata/%.feature ../testdata/%.feature.tokens bin/gherkin_generate_tokens
acceptance/testdata/%.feature.tokens: testdata/%.feature testdata/%.feature.tokens $(GHERKIN_GENERATE_TOKENS)
mkdir -p `dirname $@`
bin/gherkin_generate_tokens $< > $@
diff --unified $<.tokens $@
.DELETE_ON_ERROR: acceptance/testdata/%.feature.tokens
echo $(RUN_GHERKIN_GENERATE_TOKENS)
$(RUN_GHERKIN_GENERATE_TOKENS) $< > $@
diff --strip-trailing-cr --unified $<.tokens $@

acceptance/testdata/%.feature.ast.ndjson: ../testdata/%.feature ../testdata/%.feature.ast.ndjson bin/gherkin
acceptance/testdata/%.feature.ast.ndjson: testdata/%.feature testdata/%.feature.ast.ndjson $(GHERKIN)
mkdir -p `dirname $@`
bin/gherkin --no-source --no-pickles $< | jq --sort-keys --compact-output "." > $@
$(RUN_GHERKIN) --no-source --no-pickles $< | jq --sort-keys --compact-output "." > $@
diff --unified <(jq "." $<.ast.ndjson) <(jq "." $@)
.DELETE_ON_ERROR: acceptance/testdata/%.feature.ast.ndjson

acceptance/testdata/%.feature.errors.ndjson: ../testdata/%.feature ../testdata/%.feature.errors.ndjson bin/gherkin
acceptance/testdata/%.feature.errors.ndjson: testdata/%.feature testdata/%.feature.errors.ndjson $(GHERKIN)
mkdir -p `dirname $@`
bin/gherkin --no-source --no-pickles $< | jq --sort-keys --compact-output "." > $@
$(RUN_GHERKIN) --no-source --no-pickles $< | jq --sort-keys --compact-output "." > $@
diff --unified <(jq "." $<.errors.ndjson) <(jq "." $@)
.DELETE_ON_ERROR: acceptance/testdata/%.feature.errors.ndjson

acceptance/testdata/%.feature.pickles.ndjson: ../testdata/%.feature ../testdata/%.feature.pickles.ndjson bin/gherkin
acceptance/testdata/%.feature.pickles.ndjson: testdata/%.feature testdata/%.feature.pickles.ndjson $(GHERKIN)
mkdir -p `dirname $@`
bin/gherkin --no-source --no-ast $< | jq --sort-keys --compact-output "." > $@
$(RUN_GHERKIN) --no-source --no-ast $< | jq --sort-keys --compact-output "." > $@
diff --unified <(jq "." $<.pickles.ndjson) <(jq "." $@)
.DELETE_ON_ERROR: acceptance/testdata/%.feature.pickles.ndjson

acceptance/testdata/%.feature.source.ndjson: ../testdata/%.feature ../testdata/%.feature.source.ndjson .built
acceptance/testdata/%.feature.source.ndjson: testdata/%.feature testdata/%.feature.source.ndjson .built
mkdir -p `dirname $@`
bin/gherkin --no-ast --no-pickles $< | jq --sort-keys --compact-output "." > $@
$(RUN_GHERKIN) --no-ast --no-pickles $< | jq --sort-keys --compact-output "." > $@
diff --unified <(jq "." $<.source.ndjson) <(jq "." $@)
.DELETE_ON_ERROR: acceptance/testdata/%.feature.source.ndjson

update-gherkin-languages: src/dialect.c.tmp
diff -q src/dialect.c.tmp src/dialect.c || mv src/dialect.c.tmp src/dialect.c
.PHONY: update-gherkin-languages

src/dialect.c.tmp: ../gherkin-languages.json dialect.c.jq
cat $< | jq -f dialect.c.jq -r -c > $@
.INTERMEDIATE: src/dialect.c.tmp

LICENSE: ../LICENSE
cp $< $@
Loading