run test_tag in 'tree-sitter test' when tags test dir exists

This commit is contained in:
Michael Davis 2021-12-18 09:44:59 -06:00
parent 7df82c825f
commit 067f742ad3
No known key found for this signature in database
GPG key ID: 25D3AFE4BA2A0C49
2 changed files with 8 additions and 1 deletions

View file

@ -8,6 +8,7 @@ pub mod query_testing;
pub mod tags;
pub mod test;
pub mod test_highlight;
pub mod test_tags;
pub mod util;
pub mod wasm;

View file

@ -4,7 +4,8 @@ use glob::glob;
use std::path::Path;
use std::{env, fs, u64};
use tree_sitter_cli::{
generate, highlight, logger, parse, playground, query, tags, test, test_highlight, util, wasm,
generate, highlight, logger, parse, playground, query, tags, test, test_highlight, test_tags,
util, wasm,
};
use tree_sitter_config::Config;
use tree_sitter_loader as loader;
@ -316,6 +317,11 @@ fn run() -> Result<()> {
if test_highlight_dir.is_dir() {
test_highlight::test_highlights(&loader, &test_highlight_dir)?;
}
let test_tag_dir = test_dir.join("tags");
if test_tag_dir.is_dir() {
test_tags::test_tags(&loader, &test_tag_dir)?;
}
}
("parse", Some(matches)) => {