Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
3138d59
Give console the error/warn/info/debug it was missing, and stderr a w…
nanofuxion Aug 31, 2026
37efcb7
Read a whole request, not just its first 64KB
nanofuxion Aug 31, 2026
c31f387
Keep a connection alive instead of closing it after every response
nanofuxion Aug 31, 2026
3d70926
Stop parsing a URL twice on every served request
nanofuxion Aug 31, 2026
9949565
Scan JSON strings a word at a time, in both directions
nanofuxion Aug 31, 2026
63880c3
Take another pass at JSON, and at the scans behind it
nanofuxion Aug 31, 2026
ff5541c
Stop JSON.stringify allocating its way through an object
nanofuxion Aug 31, 2026
f4047ca
Build the object, don't describe it: JSON.parse into its own values
nanofuxion Aug 31, 2026
c2ded98
Fix two ways JSON.stringify's shortcuts were wrong, and read the slot…
nanofuxion Aug 31, 2026
7b11c2f
Skip the separators when there is nothing to separate with
nanofuxion Aug 31, 2026
b690e66
Remember the last few JSON property names
nanofuxion Aug 31, 2026
77ba1a7
Hash 4000 random JSON documents against Node's answer
nanofuxion Aug 31, 2026
af69d15
Keep JSON.stringify's cycle check on the C stack
nanofuxion Aug 31, 2026
619f335
Do not memo a shape that carries a toJSON of its own
nanofuxion Aug 31, 2026
8b12689
Record where the JSON work landed
nanofuxion Aug 31, 2026
0152293
Take the fast road to a double's digits, and keep the exact one
nanofuxion Aug 31, 2026
e7c9283
Record the dtoa fast path alongside the rest
nanofuxion Aug 31, 2026
ac79ebe
Bind where the caller asked, and let processes share a port
nanofuxion Aug 31, 2026
134f0fb
Build a served request's headers only if the handler reads them
nanofuxion Aug 31, 2026
d108891
Set SO_REUSEPORT by hand where libuv is too old to have the flag
nanofuxion Aug 31, 2026
23cc698
Report the real process id
nanofuxion Aug 31, 2026
b0b8dff
Read into the connection's own buffer
nanofuxion Aug 31, 2026
cca6f5c
Give a handler the body bytes, not a copy of them in a string
nanofuxion Aug 31, 2026
f4708a7
Turn Nagle off on an accepted connection
nanofuxion Aug 31, 2026
e6832a8
Give `sxn compile` the module loader it was missing
nanofuxion Aug 31, 2026
a8b7c0c
Answer node:os from the machine, and give node:fs stat
nanofuxion Aug 31, 2026
4513eca
Move node:querystring into C
nanofuxion Aug 31, 2026
1593c51
Move node:path's win32 half into C, and fix extname on a name of dots
nanofuxion Aug 31, 2026
ec76386
Let the system parse an IP address
nanofuxion Aug 31, 2026
24e4c91
Hand HMAC and timingSafeEqual to the library that does the digests
nanofuxion Aug 31, 2026
b7fe21f
Give Buffer the numeric accessors, in C
nanofuxion Aug 31, 2026
7511dd0
Stop building a digest's hex by hand
nanofuxion Aug 31, 2026
eedf7ae
Write down which half of the compatibility layer is C
nanofuxion Aug 31, 2026
f639697
Finish Buffer's byte surface, and stop Buffer.from sharing what it sh…
nanofuxion Aug 31, 2026
9ccd448
Read hex and base64 the lenient way in C
nanofuxion Aug 31, 2026
70a4631
Put a number on why http and stream stay in JavaScript
nanofuxion Aug 31, 2026
bff320f
Move util.format into C
nanofuxion Aug 31, 2026
5d40e6a
Say where the seam is, with the numbers from the last two moves
nanofuxion Aug 31, 2026
31c0da1
Move assert's deep comparison to C, and say what it cost
nanofuxion Aug 31, 2026
45b834b
Stop building strings one character at a time
nanofuxion Aug 31, 2026
6b2709d
Stop rebuilding the builtin table on every require()
nanofuxion Aug 31, 2026
7a591f4
Lowercase a request's headers once, in C
nanofuxion Aug 31, 2026
8d2e91a
Stop parsing hex a byte at a time inside node:crypto
nanofuxion Aug 31, 2026
154e8e8
Join a response's chunks without walking them three times
nanofuxion Aug 31, 2026
de3191f
Build once() and a request's socket in C
nanofuxion Aug 31, 2026
e1c341e
Try moving a stream's field initialisation to C, and keep the number
nanofuxion Aug 31, 2026
d293e4e
Stop building two closures for every request
nanofuxion Aug 31, 2026
5ce4f0f
Lowercase a response header name in C
nanofuxion Aug 31, 2026
0ecc67d
Try wrapping a pushed array in C, and reject it on behaviour
nanofuxion Aug 31, 2026
b52570b
Fill a Stats once instead of copying it field by field
nanofuxion Aug 31, 2026
d9dd3fc
Delete the JavaScript halves of the lenient readers
nanofuxion Aug 31, 2026
08fa42a
One byte-joining loop instead of four
nanofuxion Aug 31, 2026
c24dbc9
Stop allocating a closure per write to say nothing
nanofuxion Aug 31, 2026
69c06f1
Take stream chunks off a cursor, not off shift()
nanofuxion Aug 31, 2026
55147bc
Decode a file: URL in C, and answer isBuiltin from the real table
nanofuxion Aug 31, 2026
4e9bc92
Cache the working directory, and add the chdir that clears it
nanofuxion Aug 31, 2026
ba358d0
Build a file: URL's text in C
nanofuxion Aug 31, 2026
3e219b9
Decode chunk boundaries in C, and leave util alone with the numbers
nanofuxion Aug 31, 2026
f81b9fd
Read and write a file's own bytes
nanofuxion Aug 31, 2026
af93b5b
List a response's headers from C
nanofuxion Aug 31, 2026
080b71b
Carry nextTick's arguments in C
nanofuxion Aug 31, 2026
cddff19
Move util.inspect to C
nanofuxion Aug 31, 2026
a01bc1f
Write down what is left in node_compat.js, section by section
nanofuxion Aug 31, 2026
307cf61
Make a promisified call without three closures
nanofuxion Aug 31, 2026
7e70f60
Correct the promisify number to the one the finished code measures
nanofuxion Aug 31, 2026
5e20f4f
Pipe with four C functions instead of four closures
nanofuxion Aug 31, 2026
6b34840
Copy a view in C; leave an array to the engine
nanofuxion Aug 31, 2026
5a881f0
Reparent a prototype from C
nanofuxion Aug 31, 2026
1447e5e
Settle a callbackified promise from C
nanofuxion Aug 31, 2026
3b223ce
Measure the last of what stays in JavaScript
nanofuxion Aug 31, 2026
25f272a
Keep zlib's stream between calls, and remove a listener in place
nanofuxion Sep 1, 2026
898be54
Say why the two new caches are allowed to be process-wide
nanofuxion Sep 1, 2026
1ea5914
Finish the Minimum Common API, and the node: builtins with it
nanofuxion Sep 1, 2026
3389b71
Close a spawn's loop properly, and ask before reporting rejections
nanofuxion Sep 1, 2026
b42ae0b
Register a node: module when it is imported, not at startup
nanofuxion Sep 1, 2026
5183936
Let node:console and node:constants be imported, not only required
nanofuxion Sep 1, 2026
f30f2e1
Say where a node: module is registered, and record today's Mac run
nanofuxion Sep 1, 2026
84a59cf
Put today's Mac numbers on the landing page, JSON row included
nanofuxion Sep 1, 2026
8bb9869
Record the startup work in the performance ledger
nanofuxion Sep 1, 2026
af77165
Correct the added-module row: seventeen names, 746 lines
nanofuxion Sep 1, 2026
59f46a2
Re-measure the two startup rows on the quiet machine
nanofuxion Sep 1, 2026
d152fc6
Both machines run the same major Node now
nanofuxion Sep 1, 2026
58d1d6f
Record today's Linux run, JSON row included
nanofuxion Sep 1, 2026
31f28cc
Refresh the cumulative line from today's run
nanofuxion Sep 1, 2026
b954d77
Enforce &mut ownership, and compile declared types instead of strippi…
nanofuxion Sep 1, 2026
8dbfac9
Sweep reference cycles while idle, and warn on excess EventEmitter li…
nanofuxion Sep 1, 2026
72c0a58
Rewrite the documentation site: guides in front of the specs
nanofuxion Sep 1, 2026
4839f9f
Prepare 0.0.2 six-platform release
nanofuxion Sep 1, 2026
1eeef1b
Document the 0.0.2 release and benchmarks
nanofuxion Sep 1, 2026
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
159 changes: 154 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.20)
project(sxn VERSION 0.0.1 LANGUAGES C)
project(sxn VERSION 0.0.2 LANGUAGES C)
# Every other dependency here (curl, zlib, libuv, libffi) resolves to a
# dylib under /usr/lib on macOS - part of the OS, present on every Mac.
# OpenSSL doesn't ship there anymore, so find_package(OpenSSL) resolves to
Expand All @@ -9,8 +9,32 @@ project(sxn VERSION 0.0.1 LANGUAGES C)
if(APPLE)
set(OPENSSL_USE_STATIC_LIBS TRUE)
endif()
find_package(OpenSSL REQUIRED)
find_package(CURL REQUIRED)
if(DEFINED SXN_CROSS_DEPS_ROOT)
# Cross builds cannot use the host's FindOpenSSL/CURL/ZLIB results. The
# release builder supplies a target sysroot containing import libraries.
set(_cross_root "${SXN_CROSS_DEPS_ROOT}")
add_library(OpenSSL::Crypto UNKNOWN IMPORTED)
set_target_properties(OpenSSL::Crypto PROPERTIES
IMPORTED_LOCATION "${_cross_root}/lib/libcrypto.dll.a"
INTERFACE_INCLUDE_DIRECTORIES "${_cross_root}/include")
add_library(OpenSSL::SSL UNKNOWN IMPORTED)
set_target_properties(OpenSSL::SSL PROPERTIES
IMPORTED_LOCATION "${_cross_root}/lib/libssl.dll.a"
INTERFACE_INCLUDE_DIRECTORIES "${_cross_root}/include"
INTERFACE_LINK_LIBRARIES OpenSSL::Crypto)
add_library(CURL::libcurl UNKNOWN IMPORTED)
set_target_properties(CURL::libcurl PROPERTIES
IMPORTED_LOCATION "${_cross_root}/lib/libcurl.dll.a"
INTERFACE_INCLUDE_DIRECTORIES "${_cross_root}/include"
INTERFACE_LINK_LIBRARIES "ws2_32;crypt32;bcrypt;advapi32")
add_library(ZLIB::ZLIB UNKNOWN IMPORTED)
set_target_properties(ZLIB::ZLIB PROPERTIES
IMPORTED_LOCATION "${_cross_root}/lib/libz.dll.a"
INTERFACE_INCLUDE_DIRECTORIES "${_cross_root}/include")
else()
find_package(OpenSSL REQUIRED)
find_package(CURL REQUIRED)
endif()
# libuv ships a CMake config package from Homebrew and vcpkg, but Ubuntu's
# libuv1-dev provides only pkg-config, so fall back to that rather than
# requiring the config package everywhere.
Expand Down Expand Up @@ -71,7 +95,7 @@ endif()
# writing to a directory the other one hasn't created yet.
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/generated)

# WinterCG globals (TextEncoder, URL, Headers, fetch's JS glue, ...) are
# WinterTC globals (TextEncoder, URL, Headers, fetch's JS glue, ...) are
# authored as plain JS in src/bootstrap.js and compiled to bytecode at build
# time, so startup reads a prepared function instead of parsing 140KB of
# JavaScript on every launch -- worth about 3ms of a 10ms cold start.
Expand All @@ -94,7 +118,7 @@ add_custom_target(sxn_bootstrap_header DEPENDS ${SXN_BOOTSTRAP_HEADER})

# node:buffer/path/events/process are authored and compiled the same way
# (src/node_compat.js), kept as a separate file/header from bootstrap.js
# since it's a distinct WinterCG-vs-Node-compat concern.
# since it's a distinct WinterTC-vs-Node-compat concern.
set(SXN_NODE_COMPAT_JS ${CMAKE_CURRENT_SOURCE_DIR}/src/node_compat.js)
set(SXN_NODE_COMPAT_HEADER ${CMAKE_CURRENT_BINARY_DIR}/generated/sxn_node_compat.h)
add_custom_command(
Expand Down Expand Up @@ -186,6 +210,42 @@ if(BUILD_TESTING AND SXN_BUILD_TESTS)
add_test(NAME sxn-sx-module COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/import-main.sx)
add_test(NAME sxn-reject-enum COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/reject-enum.sx)
set_tests_properties(sxn-reject-enum PROPERTIES WILL_FAIL TRUE)
# `&mut` requires a mutable owner. The legal direction is covered by
# sxn-example (velocity.sx) and sxn-example-hello, both of which borrow a
# `let mut`; this is the rejection side.
add_test(NAME sxn-reject-mut-borrow COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/reject-mut-borrow.sx)
set_tests_properties(sxn-reject-mut-borrow PROPERTIES WILL_FAIL TRUE)
# `safe` specializes on the declared type, so i32 wraps and every other
# annotation keeps exact JS arithmetic. Both right-hand-side shapes are
# covered: a constant and a local compile through different peephole
# branches and used to disagree.
add_test(NAME sxn-typed-overflow COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/typed_overflow.sx)
set_tests_properties(sxn-typed-overflow PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL")
# A call to a small function with a declared scalar signature is spliced
# into its caller. This asserts the splice changes nothing observable: same
# values, same coercions, same exceptions, and no splice at all when the
# binding is reassigned, captured, or the shape does not qualify. Every
# expected value here is Node's, checked with the annotations stripped.
add_test(NAME sxn-typed-inline COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/typed_inline.sx)
set_tests_properties(sxn-typed-inline PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL")
# Reference cycles are invisible to refcounting and reclaimable only by the
# cycle collector, which runs only on allocation. Sxn.gc() is the explicit
# ask; this asserts a burst of 100k cyclic closures comes back.
add_test(NAME sxn-leak-cycle-stress COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/leak_cycle_stress.sx)
set_tests_properties(sxn-leak-cycle-stress PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL")
# And the same reclamation with nobody asking: a daemon that takes a burst
# and then waits must give the memory back on its own. Run both ways, since
# the whole point of --no-idle-gc is that it does not.
add_test(NAME sxn-leak-idle-sweep COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/leak_idle_sweep.mjs)
set_tests_properties(sxn-leak-idle-sweep PROPERTIES TIMEOUT 60 FAIL_REGULAR_EXPRESSION "FAIL")
add_test(NAME sxn-leak-idle-sweep-off
COMMAND sxn --no-idle-gc ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/leak_idle_sweep.mjs --expect-no-sweep)
set_tests_properties(sxn-leak-idle-sweep-off PROPERTIES TIMEOUT 60 FAIL_REGULAR_EXPRESSION "FAIL")
# Listeners added and never removed are how a server grows one closure at a
# time. Every expectation here is Node's: the fixture passes unchanged under
# `node tests/fixtures/events_maxlisteners.mjs`.
add_test(NAME sxn-events-maxlisteners COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/events_maxlisteners.mjs)
set_tests_properties(sxn-events-maxlisteners PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL")
# Regression coverage: SX's contextual `interface` grammar hook must not
# leak into ordinary .cjs execution (see update_token_ident in quickjs.c).
add_test(NAME sxn-interface-ident COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/interface-ident.cjs)
Expand Down Expand Up @@ -325,6 +385,9 @@ if(BUILD_TESTING AND SXN_BUILD_TESTS)
# node:stream: flowing and paused modes, pipe, transform, pipeline, the
# Buffer conversion outside objectMode, and the Web Streams bridges.
add_test(NAME sxn-node-stream COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/node_stream.mjs)
# This one prints its results in one go at the end, so silence is failure:
# require the last line rather than merely the absence of FAIL.
set_tests_properties(sxn-node-stream PROPERTIES PASS_REGULAR_EXPRESSION "bytes join into one read")
set_tests_properties(sxn-node-stream PROPERTIES TIMEOUT 40)
# node:http: the (req, res) server, headers, chunked writes, request bodies
# and a response finished after the handler returns.
Expand All @@ -334,6 +397,55 @@ if(BUILD_TESTING AND SXN_BUILD_TESTS)
add_test(NAME sxn-node-http COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/node_http.mjs)
add_test(NAME sxn-node-zlib COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/node_zlib.mjs)
add_test(NAME sxn-node-crypto-net COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/node_crypto_net.mjs)
# node:os and the parts of node:fs a server needs, against the real machine
# rather than against stubbed answers.
add_test(NAME sxn-node-os-fs COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/node_os_fs.mjs)
set_tests_properties(sxn-node-os-fs PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL")
# node:querystring, now native C, against what Node itself printed.
add_test(NAME sxn-node-querystring COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/node_querystring.mjs)
set_tests_properties(sxn-node-querystring PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL")
# node:path, posix and win32, against what Node prints for the same corpus.
add_test(NAME sxn-node-path COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/node_path.mjs)
set_tests_properties(sxn-node-path PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL")
# net.isIP, against Node's own answers.
add_test(NAME sxn-node-isip COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/node_isip.mjs)
set_tests_properties(sxn-node-isip PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL")
# HMAC and timingSafeEqual, against Node's own digests.
add_test(NAME sxn-node-hmac COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/node_hmac.mjs)
set_tests_properties(sxn-node-hmac PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL")
# Buffer's numeric accessors and compare, against Node's own answers.
add_test(NAME sxn-node-buffer-numbers COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/node_buffer_numbers.mjs)
set_tests_properties(sxn-node-buffer-numbers PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL")
# require() of every builtin, both spellings, now a native table lookup.
add_test(NAME sxn-node-builtin-require COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/node_builtin_require.mjs)
set_tests_properties(sxn-node-builtin-require PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL")
# latin1/ascii/utf16le in both directions, now native, against Node.
add_test(NAME sxn-node-buffer-units COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/node_buffer_units.mjs)
set_tests_properties(sxn-node-buffer-units PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL")
# StringDecoder's utf-8 path, native, against every way of splitting a
# multi-byte character across chunks.
add_test(NAME sxn-node-string-decoder COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/node_string_decoder.mjs)
set_tests_properties(sxn-node-string-decoder PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL")
# zlib keeps its stream between calls and resets it; the bytes must not
# change, across window bits, levels and sizes.
add_test(NAME sxn-node-zlib-reuse COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/node_zlib_reuse.mjs)
set_tests_properties(sxn-node-zlib-reuse PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL")
# util.inspect, native: every kind of value, the depth limit and a cycle.
add_test(NAME sxn-node-inspect COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/node_inspect.mjs)
set_tests_properties(sxn-node-inspect PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL")
# process.nextTick carries its arguments natively.
add_test(NAME sxn-node-next-tick COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/node_next_tick.mjs)
set_tests_properties(sxn-node-next-tick PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL")
# process.cwd() is cached; process.chdir() is what clears it.
add_test(NAME sxn-node-process-cwd COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/node_process_cwd.mjs)
set_tests_properties(sxn-node-process-cwd PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL")
# node:assert's structural comparison, now native C, against Node's answers
# for the same 130 pairs.
add_test(NAME sxn-node-assert COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/node_assert.mjs)
set_tests_properties(sxn-node-assert PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL")
# util.format, against Node's own output.
add_test(NAME sxn-node-format COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/node_format.mjs)
set_tests_properties(sxn-node-format PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL")
# Every Buffer encoding in both directions, including Node's lenient hex and
# base64 readers. Expectations are Node's own output, so a divergence fails.
add_test(NAME sxn-buffer-encodings COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/buffer_encodings.mjs)
Expand Down Expand Up @@ -388,6 +500,43 @@ if(BUILD_TESTING AND SXN_BUILD_TESTS)
add_test(NAME sxn-serve-headers COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/serve_headers.mjs)
set_tests_properties(sxn-serve-headers PROPERTIES TIMEOUT 30 FAIL_REGULAR_EXPRESSION "FAIL")
add_test(NAME sxn-serve-fetch-shape COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/serve_fetch_shape.mjs)
# A request larger than one read: the server has to accumulate reads until
# the head and the announced body are both in hand.
add_test(NAME sxn-serve-large-body COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/serve_large_body.mjs)
set_tests_properties(sxn-serve-large-body PROPERTIES TIMEOUT 60 FAIL_REGULAR_EXPRESSION "FAIL")
# HTTP keep-alive: a connection is reused for the next request, and stop()
# closes the ones still open.
add_test(NAME sxn-serve-keepalive COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/serve_keepalive.mjs)
set_tests_properties(sxn-serve-keepalive PROPERTIES TIMEOUT 60 FAIL_REGULAR_EXPRESSION "FAIL")
# Where a server binds: the hostname option, and reusePort for running one
# process per core.
add_test(NAME sxn-serve-bind COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/serve_bind.mjs)
set_tests_properties(sxn-serve-bind PROPERTIES TIMEOUT 60 FAIL_REGULAR_EXPRESSION "FAIL")
# A served request's headers are built on first read; they still have to
# behave as if they had been built up front.
add_test(NAME sxn-serve-lazy-headers COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/serve_lazy_headers.mjs)
set_tests_properties(sxn-serve-lazy-headers PROPERTIES TIMEOUT 60 FAIL_REGULAR_EXPRESSION "FAIL")
# The request body reaches a handler as the bytes the server read, without
# a string in between -- including over a reused connection.
add_test(NAME sxn-serve-body-bytes COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/serve_body_bytes.mjs)
set_tests_properties(sxn-serve-body-bytes PROPERTIES TIMEOUT 60 FAIL_REGULAR_EXPRESSION "FAIL")
# JSON.parse/JSON.stringify at the edges of their fast paths: escapes,
# surrogates, non-ASCII, control characters and every number form. The
# expectations are Node's own output, so a divergence fails.
add_test(NAME sxn-json-edges COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/json_edges.mjs)
set_tests_properties(sxn-json-edges PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL")
# Every name the Minimum Common API asks for, and what the new ones do:
# URLPattern's matching, the compression streams, BYOB reads.
add_test(NAME sxn-wintertc-surface COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/wintertc_surface.mjs)
set_tests_properties(sxn-wintertc-surface PROPERTIES TIMEOUT 60 FAIL_REGULAR_EXPRESSION "FAIL")
# The builtins beyond the original 24, exercised rather than probed: a real
# child process, a real DNS answer, a real UDP round trip.
add_test(NAME sxn-node-new-builtins COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/node_new_builtins.mjs)
set_tests_properties(sxn-node-new-builtins PROPERTIES TIMEOUT 60 FAIL_REGULAR_EXPRESSION "FAIL")
# 4000 seeded-random documents through parse and stringify, hashed. The
# expected hash is Node's, so one byte of divergence anywhere fails.
add_test(NAME sxn-json-fuzz COMMAND sxn ${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/json_fuzz.mjs)
set_tests_properties(sxn-json-fuzz PROPERTIES TIMEOUT 120 FAIL_REGULAR_EXPRESSION "FAIL")
set_tests_properties(sxn-serve-fetch-shape PROPERTIES TIMEOUT 30 FAIL_REGULAR_EXPRESSION "FAIL")
set_tests_properties(sxn-performance-now PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL")
set_tests_properties(sxn-encode-into PROPERTIES FAIL_REGULAR_EXPRESSION "FAIL")
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ site, built from [`docs/index.html`](docs/index.html) and published by
**Genuinely open to change**, including disagreement with the current
approach: the shape and scope of `safe`/`unsafe`, which TypeScript forms get
real support next, ownership and borrow-checking rules and their error
messages, `node:`/WinterCG coverage priorities, naming, ergonomics — and the
messages, `node:`/WinterTC coverage priorities, naming, ergonomics — and the
underlying ideas themselves. If you think the ownership model solves the
wrong problem, open an issue and make the case.

Expand Down
Loading
Loading