diff --git a/.github/workflows/sanitize.yml b/.github/workflows/sanitize.yml index bb085eae..834c5ab4 100644 --- a/.github/workflows/sanitize.yml +++ b/.github/workflows/sanitize.yml @@ -41,6 +41,7 @@ jobs: - name: Run main tests with address sanitizer (ASAN) env: + ASAN_OPTIONS: halt_on_error=1 CFLAGS: -fsanitize=address RUSTFLAGS: -Zsanitizer=address run: | diff --git a/cli/src/tests/corpus_test.rs b/cli/src/tests/corpus_test.rs index a193c029..f7b4815b 100644 --- a/cli/src/tests/corpus_test.rs +++ b/cli/src/tests/corpus_test.rs @@ -105,6 +105,10 @@ fn test_language_corpus(start_seed: usize, language_name: &str) { let log_seed = env::var("TREE_SITTER_LOG_SEED").is_ok(); + if log_seed { + println!(" start seed: {}", start_seed); + } + println!(); for test in tests { println!(" {} example - {}", language_name, test.name); diff --git a/cli/src/tests/helpers/fixtures.rs b/cli/src/tests/helpers/fixtures.rs index 46c674cd..f790ed75 100644 --- a/cli/src/tests/helpers/fixtures.rs +++ b/cli/src/tests/helpers/fixtures.rs @@ -1,6 +1,6 @@ use lazy_static::lazy_static; -use std::fs; use std::path::{Path, PathBuf}; +use std::{env, fs}; use tree_sitter::Language; use tree_sitter_highlight::HighlightConfiguration; use tree_sitter_loader::Loader; @@ -9,7 +9,13 @@ use tree_sitter_tags::TagsConfiguration; include!("./dirs.rs"); lazy_static! { - static ref TEST_LOADER: Loader = Loader::with_parser_lib_path(SCRATCH_DIR.clone()); + static ref TEST_LOADER: Loader = { + let mut loader = Loader::with_parser_lib_path(SCRATCH_DIR.clone()); + if env::var("TREE_SITTER_GRAMMAR_DEBUG").is_ok() { + loader.use_debug_build(true); + } + loader + }; } pub fn test_loader<'a>() -> &'a Loader {