mirror of
https://github.com/zap-proto/cpp-core.git
synced 2026-10-30 15:06:00 +00:00
Add a source preprocessor desugar(src)->braceSrc that rewrites ZAP
whitespace-significant schema syntax into the brace/Cap'n-Proto syntax the
existing lexer/parser already accepts. It runs BEFORE the proven brace
front-end, which is left untouched, so brace files keep parsing byte-identical
(back-compat) while whitespace files compile to the same code_generator_request.
Placed in libzapc (compiler/desugar.{h,c++}) and invoked from BOTH source-read
sites — compiler/module-loader.c++ (the 'zap compile' CLI the LSP shells out to)
and schema-parser.c++ (the SchemaParser API every language plugin, incl.
zap-ocaml, uses) — so LSP and all codegen plugins inherit whitespace support
from one place. Desugar is gated by isWhitespaceSchema(): pure brace input is
bypassed and returned verbatim (zero behavioral change).
Rules: line/indent based; blank+full-line-# lines transparent; headers
(struct/interface/enum/union/group, name:union, name:group) get '{'/'}';
fields 'name Type'->'name @n :Type' with per-struct ordinals (union/group
members share the enclosing struct's sequence per Cap'n Proto); explicit @N
and :Type preserved; members get ';' terminators. Lines containing '{' are
treated as brace syntax and passed through (fixes inline 'struct Foo { ... }').
Tests (compiler/desugar-test.c++, 22 cases): brace fixtures idempotent;
whitespace twins desugar to the brace twin; regression over test.zap,
rpc-twoparty.zap, grammar.zap etc. is byte-identical; a ws/brace fixture pair
parses to identical ASTs (0 errors, same decls) through the real lexer+parser.
631 lines
30 KiB
Makefile
631 lines
30 KiB
Makefile
## Process this file with automake to produce Makefile.in
|
|
|
|
ACLOCAL_AMFLAGS = -I m4
|
|
|
|
# We use serial-tests so that test output will be written directly to stdout
|
|
# which is much preferred in CI environments where the test logs may be hard
|
|
# to get at after the fact. Most of our tests are bundled into a single
|
|
# executable anyway so cannot easily be parallelized.
|
|
AUTOMAKE_OPTIONS = foreign subdir-objects serial-tests
|
|
|
|
# When running distcheck, verify that we've included all the files needed by
|
|
# the cmake build.
|
|
distcheck-hook:
|
|
rm -rf distcheck-cmake
|
|
(mkdir distcheck-cmake && cd distcheck-cmake && cmake ../$(distdir) && make -j6 check)
|
|
rm -rf distcheck-cmake
|
|
|
|
AM_CXXFLAGS = -I$(srcdir)/src -I$(builddir)/src -DKJ_HEADER_WARNINGS -DZAP_HEADER_WARNINGS -DZAP_INCLUDE_DIR='"$(includedir)"' $(PTHREAD_CFLAGS)
|
|
|
|
AM_LDFLAGS = $(PTHREAD_CFLAGS)
|
|
|
|
EXTRA_DIST = \
|
|
README.txt \
|
|
LICENSE.txt \
|
|
$(test_zapc_inputs) \
|
|
src/zap/compiler/zap-test.sh \
|
|
src/zap/testdata/segmented-packed \
|
|
src/zap/testdata/errors.zap.nobuild \
|
|
src/zap/testdata/errors2.zap.nobuild \
|
|
src/zap/testdata/no-file-id.zap.nobuild \
|
|
src/zap/testdata/short.txt \
|
|
src/zap/testdata/flat \
|
|
src/zap/testdata/binary \
|
|
src/zap/testdata/errors.txt \
|
|
src/zap/testdata/errors2.txt \
|
|
src/zap/testdata/segmented \
|
|
src/zap/testdata/packed \
|
|
src/zap/testdata/pretty.txt \
|
|
src/zap/testdata/lists.binary \
|
|
src/zap/testdata/packedflat \
|
|
src/zap/testdata/pretty.json \
|
|
src/zap/testdata/short.json \
|
|
src/zap/testdata/annotated-json.binary \
|
|
src/zap/testdata/annotated.json \
|
|
CMakeLists.txt \
|
|
cmake/ZapMacros.cmake \
|
|
cmake/ZapTargets.cmake \
|
|
cmake/ZapConfig.cmake.in \
|
|
cmake/ZapConfigVersion.cmake.in \
|
|
src/CMakeLists.txt \
|
|
src/kj/CMakeLists.txt \
|
|
src/zap/CMakeLists.txt
|
|
|
|
CLEANFILES = $(test_zapc_outputs) test_zapc_middleman distcheck-cmake
|
|
|
|
# Deletes all the files generated by autoreconf.
|
|
MAINTAINERCLEANFILES = \
|
|
aclocal.m4 \
|
|
config.guess \
|
|
config.sub \
|
|
configure \
|
|
depcomp \
|
|
install-sh \
|
|
ltmain.sh \
|
|
Makefile.in \
|
|
missing \
|
|
mkinstalldirs \
|
|
config.h.in \
|
|
stamp.h.in \
|
|
m4/ltsugar.m4 \
|
|
m4/libtool.m4 \
|
|
m4/ltversion.m4 \
|
|
m4/lt~obsolete.m4 \
|
|
m4/ltoptions.m4
|
|
|
|
maintainer-clean-local:
|
|
-rm -rf build-aux
|
|
|
|
# gmake defines an implicit rule building n from n.o. Unfortunately, this triggers on our .zap
|
|
# files because they generate .zap.c++ which is compiled to .zap.o. In addition to being
|
|
# nonsense, this leads to cyclic dependency issues and could even cause the .zap files to be
|
|
# unexpectedly overwritten! We need to cancel the implicit rule by declaring an explicit one.
|
|
#
|
|
# I want the hours of my life back that I spent figuring this out.
|
|
%.zap:
|
|
@:
|
|
|
|
public_zapc_inputs = \
|
|
src/zap/c++.zap \
|
|
src/zap/schema.zap \
|
|
src/zap/stream.zap \
|
|
src/zap/rpc.zap \
|
|
src/zap/rpc-twoparty.zap \
|
|
src/zap/persistent.zap
|
|
|
|
zapc_inputs = \
|
|
$(public_zapc_inputs) \
|
|
src/zap/compiler/lexer.zap \
|
|
src/zap/compiler/grammar.zap \
|
|
src/zap/compat/json.zap
|
|
|
|
zapc_outputs = \
|
|
src/zap/c++.zap.c++ \
|
|
src/zap/c++.zap.h \
|
|
src/zap/schema.zap.c++ \
|
|
src/zap/schema.zap.h \
|
|
src/zap/stream.zap.c++ \
|
|
src/zap/stream.zap.h \
|
|
src/zap/rpc.zap.c++ \
|
|
src/zap/rpc.zap.h \
|
|
src/zap/rpc-twoparty.zap.c++ \
|
|
src/zap/rpc-twoparty.zap.h \
|
|
src/zap/persistent.zap.c++ \
|
|
src/zap/persistent.zap.h \
|
|
src/zap/compat/json.zap.h \
|
|
src/zap/compat/json.zap.c++ \
|
|
src/zap/compiler/lexer.zap.c++ \
|
|
src/zap/compiler/lexer.zap.h \
|
|
src/zap/compiler/grammar.zap.c++ \
|
|
src/zap/compiler/grammar.zap.h
|
|
|
|
includezapdir = $(includedir)/zap
|
|
includezapcompatdir = $(includezapdir)/compat
|
|
includekjdir = $(includedir)/kj
|
|
includekjparsedir = $(includekjdir)/parse
|
|
includekjstddir = $(includekjdir)/std
|
|
includekjcompatdir = $(includekjdir)/compat
|
|
|
|
dist_includezap_DATA = $(public_zapc_inputs)
|
|
dist_includezapcompat_DATA = src/zap/compat/json.zap
|
|
|
|
pkgconfigdir = $(libdir)/pkgconfig
|
|
pkgconfig_DATA = $(ZAP_PKG_CONFIG_FILES)
|
|
|
|
cmakeconfigdir = $(libdir)/cmake/Zap
|
|
cmakeconfig_DATA = $(ZAP_CMAKE_CONFIG_FILES) \
|
|
cmake/ZapMacros.cmake \
|
|
cmake/ZapTargets.cmake
|
|
|
|
noinst_HEADERS = \
|
|
src/kj/miniposix.h \
|
|
src/kj/async-io-internal.h
|
|
|
|
includekj_HEADERS = \
|
|
src/kj/common.h \
|
|
src/kj/units.h \
|
|
src/kj/memory.h \
|
|
src/kj/refcount.h \
|
|
src/kj/array.h \
|
|
src/kj/list.h \
|
|
src/kj/vector.h \
|
|
src/kj/string.h \
|
|
src/kj/string-tree.h \
|
|
src/kj/glob-filter.h \
|
|
src/kj/hash.h \
|
|
src/kj/table.h \
|
|
src/kj/map.h \
|
|
src/kj/encoding.h \
|
|
src/kj/exception.h \
|
|
src/kj/debug.h \
|
|
src/kj/arena.h \
|
|
src/kj/io.h \
|
|
src/kj/tuple.h \
|
|
src/kj/one-of.h \
|
|
src/kj/function.h \
|
|
src/kj/mutex.h \
|
|
src/kj/source-location.h \
|
|
src/kj/thread.h \
|
|
src/kj/filesystem.h \
|
|
src/kj/async-prelude.h \
|
|
src/kj/async.h \
|
|
src/kj/async-coroutine-alloc.h \
|
|
src/kj/async-inl.h \
|
|
src/kj/time.h \
|
|
src/kj/timer.h \
|
|
src/kj/async-unix.h \
|
|
src/kj/async-win32.h \
|
|
src/kj/async-io.h \
|
|
src/kj/cidr.h \
|
|
src/kj/async-queue.h \
|
|
src/kj/main.h \
|
|
src/kj/test.h \
|
|
src/kj/win32-api-version.h \
|
|
src/kj/windows-sanity.h
|
|
|
|
includekjparse_HEADERS = \
|
|
src/kj/parse/common.h \
|
|
src/kj/parse/char.h
|
|
|
|
includekjstd_HEADERS = \
|
|
src/kj/std/iostream.h
|
|
|
|
includekjcompat_HEADERS = \
|
|
src/kj/compat/gtest.h \
|
|
src/kj/compat/url.h \
|
|
src/kj/compat/http.h \
|
|
src/kj/compat/gzip.h \
|
|
src/kj/compat/readiness-io.h \
|
|
src/kj/compat/tls.h
|
|
|
|
includezap_HEADERS = \
|
|
src/zap/c++.zap.h \
|
|
src/zap/common.h \
|
|
src/zap/blob.h \
|
|
src/zap/endian.h \
|
|
src/zap/layout.h \
|
|
src/zap/orphan.h \
|
|
src/zap/list.h \
|
|
src/zap/any.h \
|
|
src/zap/message.h \
|
|
src/zap/capability.h \
|
|
src/zap/membrane.h \
|
|
src/zap/schema.zap.h \
|
|
src/zap/stream.zap.h \
|
|
src/zap/schema-lite.h \
|
|
src/zap/schema.h \
|
|
src/zap/schema-loader.h \
|
|
src/zap/schema-parser.h \
|
|
src/zap/dynamic.h \
|
|
src/zap/pretty-print.h \
|
|
src/zap/serialize.h \
|
|
src/zap/serialize-async.h \
|
|
src/zap/serialize-packed.h \
|
|
src/zap/serialize-text.h \
|
|
src/zap/pointer-helpers.h \
|
|
src/zap/generated-header-support.h \
|
|
src/zap/raw-schema.h \
|
|
src/zap/rpc-prelude.h \
|
|
src/zap/rpc.h \
|
|
src/zap/rpc-twoparty.h \
|
|
src/zap/rpc.zap.h \
|
|
src/zap/rpc-twoparty.zap.h \
|
|
src/zap/persistent.zap.h
|
|
|
|
includezapcompat_HEADERS = \
|
|
src/zap/compat/json.h \
|
|
src/zap/compat/json.zap.h \
|
|
src/zap/compat/std-iterator.h \
|
|
src/zap/compat/websocket-rpc.h
|
|
|
|
if BUILD_KJ_TLS
|
|
MAYBE_KJ_TLS_LA=libkj-tls.la
|
|
MAYBE_KJ_TLS_TESTS= \
|
|
src/kj/compat/readiness-io-test.c++ \
|
|
src/kj/compat/tls-test.c++
|
|
else
|
|
MAYBE_KJ_TLS_LA=
|
|
MAYBE_KJ_TLS_TESTS=
|
|
endif
|
|
|
|
if BUILD_KJ_GZIP
|
|
MAYBE_KJ_GZIP_LA=libkj-gzip.la
|
|
MAYBE_KJ_GZIP_TESTS= \
|
|
src/kj/compat/gzip-test.c++
|
|
else
|
|
MAYBE_KJ_TLS_LA=
|
|
MAYBE_KJ_TLS_TESTS=
|
|
endif
|
|
|
|
if LITE_MODE
|
|
lib_LTLIBRARIES = libkj.la libkj-test.la libzap.la
|
|
else
|
|
lib_LTLIBRARIES = libkj.la libkj-test.la libkj-async.la libkj-http.la $(MAYBE_KJ_TLS_LA) $(MAYBE_KJ_GZIP_LA) libzap.la libzap-rpc.la libzap-json.la libzap-websocket.la libzapc.la
|
|
endif
|
|
|
|
libkj_la_LIBADD = $(PTHREAD_LIBS)
|
|
libkj_la_LDFLAGS = -release $(SO_VERSION) -no-undefined
|
|
libkj_la_SOURCES= \
|
|
src/kj/common.c++ \
|
|
src/kj/units.c++ \
|
|
src/kj/memory.c++ \
|
|
src/kj/refcount.c++ \
|
|
src/kj/array.c++ \
|
|
src/kj/list.c++ \
|
|
src/kj/string.c++ \
|
|
src/kj/string-tree.c++ \
|
|
src/kj/source-location.c++ \
|
|
src/kj/glob-filter.c++ \
|
|
src/kj/hash.c++ \
|
|
src/kj/table.c++ \
|
|
src/kj/encoding.c++ \
|
|
src/kj/exception.c++ \
|
|
src/kj/debug.c++ \
|
|
src/kj/arena.c++ \
|
|
src/kj/io.c++ \
|
|
src/kj/mutex.c++ \
|
|
src/kj/thread.c++ \
|
|
src/kj/time.c++ \
|
|
src/kj/filesystem.c++ \
|
|
src/kj/filesystem-disk-unix.c++ \
|
|
src/kj/filesystem-disk-win32.c++ \
|
|
src/kj/test-helpers.c++ \
|
|
src/kj/main.c++ \
|
|
src/kj/parse/char.c++
|
|
|
|
libkj_test_la_LIBADD = libkj.la $(PTHREAD_LIBS)
|
|
libkj_test_la_LDFLAGS = -release $(VERSION) -no-undefined
|
|
libkj_test_la_SOURCES = src/kj/test.c++
|
|
|
|
if !LITE_MODE
|
|
libkj_async_la_LIBADD = libkj.la $(ASYNC_LIBS) $(PTHREAD_LIBS)
|
|
libkj_async_la_LDFLAGS = -release $(SO_VERSION) -no-undefined
|
|
libkj_async_la_SOURCES= \
|
|
src/kj/async.c++ \
|
|
src/kj/async-unix.c++ \
|
|
src/kj/async-win32.c++ \
|
|
src/kj/async-io.c++ \
|
|
src/kj/async-io-unix.c++ \
|
|
src/kj/async-io-win32.c++ \
|
|
src/kj/cidr.c++ \
|
|
src/kj/timer.c++
|
|
|
|
if BUILD_KJ_GZIP
|
|
libkj_http_la_LIBADD = libkj-async.la libkj.la -lz $(ASYNC_LIBS) $(PTHREAD_LIBS)
|
|
libkj_http_la_LDFLAGS = -release $(SO_VERSION) -no-undefined
|
|
libkj_http_la_SOURCES= \
|
|
src/kj/compat/url.c++ \
|
|
src/kj/compat/http.c++
|
|
else
|
|
libkj_http_la_LIBADD = libkj-async.la libkj.la $(ASYNC_LIBS) $(PTHREAD_LIBS)
|
|
libkj_http_la_LDFLAGS = -release $(SO_VERSION) -no-undefined
|
|
libkj_http_la_SOURCES= \
|
|
src/kj/compat/url.c++ \
|
|
src/kj/compat/http.c++
|
|
endif
|
|
|
|
libkj_tls_la_LIBADD = libkj-async.la libkj.la -lssl -lcrypto $(ASYNC_LIBS) $(PTHREAD_LIBS)
|
|
libkj_tls_la_LDFLAGS = -release $(SO_VERSION) -no-undefined
|
|
libkj_tls_la_SOURCES= \
|
|
src/kj/compat/readiness-io.c++ \
|
|
src/kj/compat/tls.c++
|
|
|
|
libkj_gzip_la_LIBADD = libkj-async.la libkj.la -lz $(ASYNC_LIBS) $(PTHREAD_LIBS)
|
|
libkj_gzip_la_LDFLAGS = -release $(SO_VERSION) -no-undefined
|
|
libkj_gzip_la_SOURCES= \
|
|
src/kj/compat/gzip.c++
|
|
|
|
endif !LITE_MODE
|
|
|
|
if !LITE_MODE
|
|
heavy_sources = \
|
|
src/zap/schema.c++ \
|
|
src/zap/schema-loader.c++ \
|
|
src/zap/dynamic.c++ \
|
|
src/zap/stringify.c++
|
|
endif !LITE_MODE
|
|
|
|
libzap_la_LIBADD = libkj.la $(PTHREAD_LIBS)
|
|
libzap_la_LDFLAGS = -release $(SO_VERSION) -no-undefined
|
|
libzap_la_SOURCES= \
|
|
src/zap/c++.zap.c++ \
|
|
src/zap/blob.c++ \
|
|
src/zap/arena.h \
|
|
src/zap/arena.c++ \
|
|
src/zap/layout.c++ \
|
|
src/zap/list.c++ \
|
|
src/zap/any.c++ \
|
|
src/zap/message.c++ \
|
|
src/zap/schema.zap.c++ \
|
|
src/zap/stream.zap.c++ \
|
|
src/zap/serialize.c++ \
|
|
src/zap/serialize-packed.c++ \
|
|
$(heavy_sources)
|
|
|
|
if !LITE_MODE
|
|
|
|
libzap_rpc_la_LIBADD = libzap.la libkj-async.la libkj.la $(ASYNC_LIBS) $(PTHREAD_LIBS)
|
|
libzap_rpc_la_LDFLAGS = -release $(SO_VERSION) -no-undefined
|
|
libzap_rpc_la_SOURCES= \
|
|
src/zap/serialize-async.c++ \
|
|
src/zap/capability.c++ \
|
|
src/zap/membrane.c++ \
|
|
src/zap/dynamic-capability.c++ \
|
|
src/zap/rpc.c++ \
|
|
src/zap/rpc.zap.c++ \
|
|
src/zap/rpc-twoparty.c++ \
|
|
src/zap/rpc-twoparty.zap.c++ \
|
|
src/zap/persistent.zap.c++
|
|
|
|
libzap_json_la_LIBADD = libzap.la libkj.la $(PTHREAD_LIBS)
|
|
libzap_json_la_LDFLAGS = -release $(SO_VERSION) -no-undefined
|
|
libzap_json_la_SOURCES= \
|
|
src/zap/compat/json.c++ \
|
|
src/zap/compat/json.zap.c++
|
|
|
|
libzap_websocket_la_LIBADD = libzap.la libzap-rpc.la libkj.la libkj-async.la libkj-http.la $(PTHREAD_LIBS)
|
|
libzap_websocket_la_LDFLAGS = -release $(SO_VERSION) -no-undefined
|
|
libzap_websocket_la_SOURCES= \
|
|
src/zap/compat/websocket-rpc.c++
|
|
|
|
libzapc_la_LIBADD = libzap.la libkj.la $(PTHREAD_LIBS)
|
|
libzapc_la_LDFLAGS = -release $(SO_VERSION) -no-undefined
|
|
libzapc_la_SOURCES= \
|
|
src/zap/compiler/type-id.h \
|
|
src/zap/compiler/type-id.c++ \
|
|
src/zap/compiler/error-reporter.h \
|
|
src/zap/compiler/error-reporter.c++ \
|
|
src/zap/compiler/lexer.zap.h \
|
|
src/zap/compiler/lexer.zap.c++ \
|
|
src/zap/compiler/lexer.h \
|
|
src/zap/compiler/lexer.c++ \
|
|
src/zap/compiler/grammar.zap.h \
|
|
src/zap/compiler/grammar.zap.c++ \
|
|
src/zap/compiler/desugar.h \
|
|
src/zap/compiler/desugar.c++ \
|
|
src/zap/compiler/parser.h \
|
|
src/zap/compiler/parser.c++ \
|
|
src/zap/compiler/resolver.h \
|
|
src/zap/compiler/generics.h \
|
|
src/zap/compiler/generics.c++ \
|
|
src/zap/compiler/node-translator.h \
|
|
src/zap/compiler/node-translator.c++ \
|
|
src/zap/compiler/compiler.h \
|
|
src/zap/compiler/compiler.c++ \
|
|
src/zap/schema-parser.c++ \
|
|
src/zap/serialize-text.c++
|
|
|
|
bin_PROGRAMS = zap zapc-zap zapc-c++
|
|
|
|
zap_LDADD = libzapc.la libzap-json.la libzap.la libkj.la $(PTHREAD_LIBS)
|
|
zap_SOURCES = \
|
|
src/zap/compiler/module-loader.h \
|
|
src/zap/compiler/module-loader.c++ \
|
|
src/zap/compiler/zap.c++
|
|
|
|
zapc_zap_LDADD = libzap.la libkj.la $(PTHREAD_LIBS)
|
|
zapc_zap_SOURCES = src/zap/compiler/zapc-zap.c++
|
|
|
|
zapc_c___LDADD = libzap.la libkj.la $(PTHREAD_LIBS)
|
|
zapc_c___SOURCES = src/zap/compiler/zapc-c++.c++
|
|
|
|
# Symlink zapc -> zap. The zap binary will behave like the old zapc
|
|
# binary (i.e. like "zap compile") when invoked via this symlink.
|
|
#
|
|
# Also attempt to run ldconfig, because otherwise users get confused. If
|
|
# it fails (e.g. because the platform doesn't have it, or because the
|
|
# user doesn't have root privileges), don't worry about it.
|
|
#
|
|
# We need to specify the path for OpenBSD.
|
|
install-exec-hook:
|
|
ln -sf zap $(DESTDIR)$(bindir)/zapc
|
|
if [ `uname` == 'OpenBSD' ]; then \
|
|
(ldconfig /usr/local/lib /usr/lib /usr/X11R6/lib > /dev/null 2>&1 || true); \
|
|
else \
|
|
ldconfig < /dev/null > /dev/null 2>&1 || true; \
|
|
fi
|
|
uninstall-hook:
|
|
rm -f $(DESTDIR)$(bindir)/zapc
|
|
|
|
else LITE_MODE
|
|
|
|
install-exec-hook:
|
|
ldconfig < /dev/null > /dev/null 2>&1 || true
|
|
|
|
endif LITE_MODE
|
|
|
|
# Source files intentionally not included in the dist at this time:
|
|
# src/zap/serialize-snappy*
|
|
# src/zap/benchmark/...
|
|
# src/zap/compiler/...
|
|
|
|
# Tests ==============================================================
|
|
|
|
test_zapc_inputs = \
|
|
src/zap/test.zap \
|
|
src/zap/test-import.zap \
|
|
src/zap/test-import2.zap \
|
|
src/zap/compat/json-test.zap
|
|
|
|
test_zapc_outputs = \
|
|
src/zap/test.zap.c++ \
|
|
src/zap/test.zap.h \
|
|
src/zap/test-import.zap.c++ \
|
|
src/zap/test-import.zap.h \
|
|
src/zap/test-import2.zap.c++ \
|
|
src/zap/test-import2.zap.h \
|
|
src/zap/compat/json-test.zap.c++ \
|
|
src/zap/compat/json-test.zap.h
|
|
|
|
if USE_EXTERNAL_ZAP
|
|
|
|
test_zapc_middleman: $(test_zapc_inputs)
|
|
@$(MKDIR_P) src
|
|
$(ZAP) compile --src-prefix=$(srcdir)/src -o$(ZAPC_CXX):src -I$(srcdir)/src $$(for FILE in $(test_zapc_inputs); do echo $(srcdir)/$$FILE; done)
|
|
touch test_zapc_middleman
|
|
|
|
else
|
|
|
|
test_zapc_middleman: zap$(EXEEXT) zapc-c++$(EXEEXT) $(test_zapc_inputs)
|
|
@$(MKDIR_P) src
|
|
./zap$(EXEEXT) compile --src-prefix=$(srcdir)/src -o./zapc-c++$(EXEEXT):src -I$(srcdir)/src $$(for FILE in $(test_zapc_inputs); do echo $(srcdir)/$$FILE; done)
|
|
touch test_zapc_middleman
|
|
|
|
endif
|
|
|
|
$(test_zapc_outputs): test_zapc_middleman
|
|
|
|
BUILT_SOURCES = $(test_zapc_outputs)
|
|
|
|
check_LIBRARIES = libzap-test.a
|
|
libzap_test_a_SOURCES = \
|
|
src/zap/test-util.c++ \
|
|
src/zap/test-util.h
|
|
nodist_libzap_test_a_SOURCES = $(test_zapc_outputs)
|
|
|
|
if LITE_MODE
|
|
|
|
check_PROGRAMS = zap-test
|
|
compiler_tests =
|
|
zap_test_LDADD = libzap-test.a libzap.la libkj-test.la libkj.la
|
|
|
|
else !LITE_MODE
|
|
|
|
check_PROGRAMS = zap-test zap-evolution-test zap-afl-testcase
|
|
if HAS_FUZZING_ENGINE
|
|
check_PROGRAMS += zap-llvm-fuzzer-testcase
|
|
endif
|
|
heavy_tests = \
|
|
src/kj/async-test.c++ \
|
|
src/kj/async-xthread-test.c++ \
|
|
src/kj/async-coroutine-test.c++ \
|
|
src/kj/async-coroutine-alloc-test.c++ \
|
|
src/kj/async-unix-test.c++ \
|
|
src/kj/async-unix-xthread-test.c++ \
|
|
src/kj/async-win32-test.c++ \
|
|
src/kj/async-win32-xthread-test.c++ \
|
|
src/kj/async-io-test.c++ \
|
|
src/kj/async-queue-test.c++ \
|
|
src/kj/parse/common-test.c++ \
|
|
src/kj/parse/char-test.c++ \
|
|
src/kj/std/iostream-test.c++ \
|
|
src/kj/compat/url-test.c++ \
|
|
src/kj/compat/http-test.c++ \
|
|
$(MAYBE_KJ_GZIP_TESTS) \
|
|
$(MAYBE_KJ_TLS_TESTS) \
|
|
src/zap/canonicalize-test.c++ \
|
|
src/zap/capability-test.c++ \
|
|
src/zap/membrane-test.c++ \
|
|
src/zap/schema-test.c++ \
|
|
src/zap/schema-loader-test.c++ \
|
|
src/zap/schema-parser-test.c++ \
|
|
src/zap/dynamic-test.c++ \
|
|
src/zap/stringify-test.c++ \
|
|
src/zap/serialize-async-test.c++ \
|
|
src/zap/serialize-text-test.c++ \
|
|
src/zap/rpc-test.c++ \
|
|
src/zap/rpc-twoparty-test.c++ \
|
|
src/zap/compat/json-test.c++ \
|
|
src/zap/compat/websocket-rpc-test.c++ \
|
|
src/zap/compiler/lexer-test.c++ \
|
|
src/zap/compiler/desugar-test.c++ \
|
|
src/zap/compiler/type-id-test.c++
|
|
zap_test_LDADD = \
|
|
libzap-test.a \
|
|
libzapc.la \
|
|
libzap-rpc.la \
|
|
libzap-websocket.la \
|
|
libzap-json.la \
|
|
libzap.la \
|
|
libkj-http.la \
|
|
$(MAYBE_KJ_GZIP_LA) \
|
|
$(MAYBE_KJ_TLS_LA) \
|
|
libkj-async.la \
|
|
libkj-test.la \
|
|
libkj.la \
|
|
$(ASYNC_LIBS) \
|
|
$(PTHREAD_LIBS)
|
|
|
|
endif !LITE_MODE
|
|
|
|
zap_test_CPPFLAGS = -Wno-deprecated-declarations
|
|
zap_test_SOURCES = \
|
|
src/kj/common-test.c++ \
|
|
src/kj/memory-test.c++ \
|
|
src/kj/refcount-test.c++ \
|
|
src/kj/array-test.c++ \
|
|
src/kj/list-test.c++ \
|
|
src/kj/string-test.c++ \
|
|
src/kj/string-tree-test.c++ \
|
|
src/kj/table-test.c++ \
|
|
src/kj/map-test.c++ \
|
|
src/kj/encoding-test.c++ \
|
|
src/kj/exception-test.c++ \
|
|
src/kj/debug-test.c++ \
|
|
src/kj/arena-test.c++ \
|
|
src/kj/units-test.c++ \
|
|
src/kj/tuple-test.c++ \
|
|
src/kj/one-of-test.c++ \
|
|
src/kj/function-test.c++ \
|
|
src/kj/io-test.c++ \
|
|
src/kj/mutex-test.c++ \
|
|
src/kj/time-test.c++ \
|
|
src/kj/filesystem-test.c++ \
|
|
src/kj/filesystem-disk-test.c++ \
|
|
src/kj/test-test.c++ \
|
|
src/kj/glob-filter-test.c++ \
|
|
src/zap/common-test.c++ \
|
|
src/zap/blob-test.c++ \
|
|
src/zap/endian-test.c++ \
|
|
src/zap/endian-fallback-test.c++ \
|
|
src/zap/endian-reverse-test.c++ \
|
|
src/zap/layout-test.c++ \
|
|
src/zap/any-test.c++ \
|
|
src/zap/message-test.c++ \
|
|
src/zap/encoding-test.c++ \
|
|
src/zap/orphan-test.c++ \
|
|
src/zap/serialize-test.c++ \
|
|
src/zap/serialize-packed-test.c++ \
|
|
src/zap/fuzz-test.c++ \
|
|
$(heavy_tests)
|
|
|
|
if !LITE_MODE
|
|
zap_evolution_test_LDADD = libzapc.la libzap.la libkj.la
|
|
zap_evolution_test_SOURCES = src/zap/compiler/evolution-test.c++
|
|
|
|
zap_afl_testcase_LDADD = libzap-test.a libzap-rpc.la libzap.la libkj.la libkj-async.la
|
|
zap_afl_testcase_SOURCES = src/zap/afl-testcase.c++
|
|
|
|
if HAS_FUZZING_ENGINE
|
|
zap_llvm_fuzzer_testcase_LDADD = libzap-test.a libzap-rpc.la libzap.la libkj.la libkj-async.la
|
|
zap_llvm_fuzzer_testcase_SOURCES = src/zap/llvm-fuzzer-testcase.c++
|
|
zap_llvm_fuzzer_testcase_LDFLAGS = $(LIB_FUZZING_ENGINE)
|
|
endif
|
|
endif !LITE_MODE
|
|
|
|
if LITE_MODE
|
|
TESTS = zap-test
|
|
else !LITE_MODE
|
|
TESTS = zap-test zap-evolution-test src/zap/compiler/zap-test.sh
|
|
endif !LITE_MODE
|