Files
overlookmotel 6365db964b test(lexer): enable oxc_lexer conformance tests on all platforms (#26263)
`oxc_lexer` has 2 implementations:

1\. SIMD-based on x86_64 with AVX2.
2\. Scalar/SWAR fallback which works on all platforms.

Both produce the same output.

This PR enables running the lexer conformance on either implementation. Which implementation is tested depends on what build flags are passed to `cargo coverage`.

It turns out that it's possible to test the SIMD implementation on Mac by compiling as x86_64, and running it under Rosetta 2.

This PR also adds `just` recipes to run tests and conformance on either implementation:

- `just test-lexer`
- `just test-lexer-simd`
- `just conformance-lexer`
- `just conformance-lexer-simd`

These commands should work correctly on any of Linux x86, Windows x86, Mac aarch64.
2026-09-03 10:59:05 +00:00

57 lines
1.8 KiB
TOML

[package]
name = "oxc_coverage"
version = "0.0.0"
authors.workspace = true
edition.workspace = true
homepage.workspace = true
keywords.workspace = true
license.workspace = true
publish = false
repository.workspace = true
description.workspace = true
[lints]
workspace = true
[lib]
doctest = false
[[bin]]
name = "oxc_coverage"
test = false
doctest = false
[dependencies]
cow-utils = { workspace = true }
oxc = { workspace = true, features = ["full", "isolated_declarations", "serialize", "conformance"] }
oxc_estree_tokens = { workspace = true }
oxc_lexer = { workspace = true, optional = true }
oxc_formatter = { workspace = true }
oxc_formatter_core = { workspace = true }
oxc_tasks_common = { workspace = true }
oxc_tasks_transform_checker = { workspace = true }
encoding_rs = { workspace = true }
encoding_rs_io = { workspace = true }
itertools = { workspace = true }
lazy-regex = { workspace = true }
phf = { workspace = true }
pico-args = { workspace = true }
rayon = { workspace = true }
rustc-hash = { workspace = true }
saphyr = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
similar = { workspace = true }
walkdir = { workspace = true }
[features]
# Differential lexer conformance, opt-in because it is slow and `oxc_lexer` is still incubating.
# The harness runs against whichever of the lexer's two implementations the build selects:
#
# * SIMD core (x86_64 only): RUSTFLAGS="-C target-feature=+avx2,+bmi2" cargo coverage --features lexer -- lexer
# * Scalar fallback: cargo coverage --features lexer -- lexer
#
# `avx2`/`bmi2` are not in the x86_64 baseline on any platform, so the rustflags are required
# to reach the SIMD core even on an x86_64 host.
lexer = ["dep:oxc_lexer", "oxc_lexer/oxc_diagnostics"]