diff --git a/.clang_complete b/.clang_complete index 3a6e39713..11bc75101 100644 --- a/.clang_complete +++ b/.clang_complete @@ -1,5 +1,5 @@ -Isrc --Ispec +-Itest -Iinclude -Iexternals/utf8proc -Iexternals/json-parser diff --git a/.gitignore b/.gitignore index 7452c30a1..3857b495c 100644 --- a/.gitignore +++ b/.gitignore @@ -6,10 +6,10 @@ Makefile *.target.mk *.xcodeproj -spec/run.out* +test/run.out* externals/cpplint.py out *.pyc -spec/fixtures/grammars/* -!spec/fixtures/grammars/.gitkeep +test/fixtures/grammars/* +!test/fixtures/grammars/.gitkeep diff --git a/script/fetch-fixtures b/script/fetch-fixtures index d31e8a758..996fe8915 100755 --- a/script/fetch-fixtures +++ b/script/fetch-fixtures @@ -1,6 +1,6 @@ #!/usr/bin/env bash -GRAMMARS_DIR=$(dirname $0)/../spec/fixtures/grammars +GRAMMARS_DIR=$(dirname $0)/../test/fixtures/grammars fetch_grammar() { local grammar=$1 diff --git a/script/test b/script/test index 68485e7f9..39f217934 100755 --- a/script/test +++ b/script/test @@ -92,7 +92,7 @@ case ${mode} in --dsymutil=yes \ --leak-check=${leak_check} \ $cmd "${args[@]}" 2>&1 | \ - grep --color -E '\w+_specs?.cc:\d+|$' + grep --color -E '\w+_tests?.cc:\d+|$' ;; debug) diff --git a/script/trim-whitespace b/script/trim-whitespace index 19df440c9..b67791f52 100755 --- a/script/trim-whitespace +++ b/script/trim-whitespace @@ -1,3 +1,3 @@ #!/usr/bin/env bash -find src spec include -type f | xargs perl -pi -e 's/ +$//' +find src test include -type f | xargs perl -pi -e 's/ +$//' diff --git a/spec/compiler/build_tables/lex_conflict_manager_spec.cc b/test/compiler/build_tables/lex_conflict_manager_test.cc similarity index 99% rename from spec/compiler/build_tables/lex_conflict_manager_spec.cc rename to test/compiler/build_tables/lex_conflict_manager_test.cc index f7382a747..e360d78af 100644 --- a/spec/compiler/build_tables/lex_conflict_manager_spec.cc +++ b/test/compiler/build_tables/lex_conflict_manager_test.cc @@ -1,4 +1,4 @@ -#include "spec_helper.h" +#include "test_helper.h" #include "helpers/rule_helpers.h" #include "helpers/stream_methods.h" #include "compiler/rules/built_in_symbols.h" diff --git a/spec/compiler/build_tables/lex_item_spec.cc b/test/compiler/build_tables/lex_item_test.cc similarity index 99% rename from spec/compiler/build_tables/lex_item_spec.cc rename to test/compiler/build_tables/lex_item_test.cc index 27ceef69e..55413759e 100644 --- a/spec/compiler/build_tables/lex_item_spec.cc +++ b/test/compiler/build_tables/lex_item_test.cc @@ -1,4 +1,4 @@ -#include "spec_helper.h" +#include "test_helper.h" #include "compiler/build_tables/lex_item.h" #include "compiler/rules/metadata.h" #include "compiler/rules.h" diff --git a/spec/compiler/build_tables/parse_item_set_builder_spec.cc b/test/compiler/build_tables/parse_item_set_builder_test.cc similarity index 99% rename from spec/compiler/build_tables/parse_item_set_builder_spec.cc rename to test/compiler/build_tables/parse_item_set_builder_test.cc index 9493d2807..9bc4715b5 100644 --- a/spec/compiler/build_tables/parse_item_set_builder_spec.cc +++ b/test/compiler/build_tables/parse_item_set_builder_test.cc @@ -1,4 +1,4 @@ -#include "spec_helper.h" +#include "test_helper.h" #include "compiler/syntax_grammar.h" #include "compiler/lexical_grammar.h" #include "compiler/build_tables/parse_item_set_builder.h" diff --git a/spec/compiler/build_tables/rule_can_be_blank_spec.cc b/test/compiler/build_tables/rule_can_be_blank_test.cc similarity index 98% rename from spec/compiler/build_tables/rule_can_be_blank_spec.cc rename to test/compiler/build_tables/rule_can_be_blank_test.cc index 61aa92bc4..a3068f913 100644 --- a/spec/compiler/build_tables/rule_can_be_blank_spec.cc +++ b/test/compiler/build_tables/rule_can_be_blank_test.cc @@ -1,4 +1,4 @@ -#include "spec_helper.h" +#include "test_helper.h" #include "compiler/build_tables/rule_can_be_blank.h" #include "compiler/rules/metadata.h" #include "compiler/rules.h" diff --git a/spec/compiler/prepare_grammar/expand_repeats_spec.cc b/test/compiler/prepare_grammar/expand_repeats_test.cc similarity index 99% rename from spec/compiler/prepare_grammar/expand_repeats_spec.cc rename to test/compiler/prepare_grammar/expand_repeats_test.cc index d15f630ff..7d735a4af 100644 --- a/spec/compiler/prepare_grammar/expand_repeats_spec.cc +++ b/test/compiler/prepare_grammar/expand_repeats_test.cc @@ -1,4 +1,4 @@ -#include "spec_helper.h" +#include "test_helper.h" #include "compiler/prepare_grammar/initial_syntax_grammar.h" #include "compiler/prepare_grammar/expand_repeats.h" #include "helpers/rule_helpers.h" diff --git a/spec/compiler/prepare_grammar/expand_tokens_spec.cc b/test/compiler/prepare_grammar/expand_tokens_test.cc similarity index 99% rename from spec/compiler/prepare_grammar/expand_tokens_spec.cc rename to test/compiler/prepare_grammar/expand_tokens_test.cc index fdfea02c8..0c1e62098 100644 --- a/spec/compiler/prepare_grammar/expand_tokens_spec.cc +++ b/test/compiler/prepare_grammar/expand_tokens_test.cc @@ -1,4 +1,4 @@ -#include "spec_helper.h" +#include "test_helper.h" #include "compiler/lexical_grammar.h" #include "compiler/prepare_grammar/expand_tokens.h" #include "helpers/rule_helpers.h" diff --git a/spec/compiler/prepare_grammar/extract_choices_spec.cc b/test/compiler/prepare_grammar/extract_choices_test.cc similarity index 99% rename from spec/compiler/prepare_grammar/extract_choices_spec.cc rename to test/compiler/prepare_grammar/extract_choices_test.cc index 7ace3d642..f6891865e 100644 --- a/spec/compiler/prepare_grammar/extract_choices_spec.cc +++ b/test/compiler/prepare_grammar/extract_choices_test.cc @@ -1,4 +1,4 @@ -#include "spec_helper.h" +#include "test_helper.h" #include "compiler/prepare_grammar/extract_choices.h" #include "helpers/rule_helpers.h" diff --git a/spec/compiler/prepare_grammar/extract_tokens_spec.cc b/test/compiler/prepare_grammar/extract_tokens_test.cc similarity index 99% rename from spec/compiler/prepare_grammar/extract_tokens_spec.cc rename to test/compiler/prepare_grammar/extract_tokens_test.cc index ea9dd4155..76ed50a07 100644 --- a/spec/compiler/prepare_grammar/extract_tokens_spec.cc +++ b/test/compiler/prepare_grammar/extract_tokens_test.cc @@ -1,4 +1,4 @@ -#include "spec_helper.h" +#include "test_helper.h" #include "compiler/lexical_grammar.h" #include "compiler/prepare_grammar/interned_grammar.h" #include "compiler/prepare_grammar/initial_syntax_grammar.h" diff --git a/spec/compiler/prepare_grammar/flatten_grammar_spec.cc b/test/compiler/prepare_grammar/flatten_grammar_test.cc similarity index 99% rename from spec/compiler/prepare_grammar/flatten_grammar_spec.cc rename to test/compiler/prepare_grammar/flatten_grammar_test.cc index c93b6d52f..f935490c1 100644 --- a/spec/compiler/prepare_grammar/flatten_grammar_spec.cc +++ b/test/compiler/prepare_grammar/flatten_grammar_test.cc @@ -1,4 +1,4 @@ -#include "spec_helper.h" +#include "test_helper.h" #include "compiler/prepare_grammar/flatten_grammar.h" #include "compiler/prepare_grammar/initial_syntax_grammar.h" #include "compiler/syntax_grammar.h" diff --git a/spec/compiler/prepare_grammar/intern_symbols_spec.cc b/test/compiler/prepare_grammar/intern_symbols_test.cc similarity index 99% rename from spec/compiler/prepare_grammar/intern_symbols_spec.cc rename to test/compiler/prepare_grammar/intern_symbols_test.cc index 4682a7163..1950d6383 100644 --- a/spec/compiler/prepare_grammar/intern_symbols_spec.cc +++ b/test/compiler/prepare_grammar/intern_symbols_test.cc @@ -1,4 +1,4 @@ -#include "spec_helper.h" +#include "test_helper.h" #include "compiler/prepare_grammar/intern_symbols.h" #include "compiler/grammar.h" #include "compiler/rules/named_symbol.h" diff --git a/spec/compiler/prepare_grammar/parse_regex_spec.cc b/test/compiler/prepare_grammar/parse_regex_test.cc similarity index 99% rename from spec/compiler/prepare_grammar/parse_regex_spec.cc rename to test/compiler/prepare_grammar/parse_regex_test.cc index 4d226619b..72ca0a403 100644 --- a/spec/compiler/prepare_grammar/parse_regex_spec.cc +++ b/test/compiler/prepare_grammar/parse_regex_test.cc @@ -1,4 +1,4 @@ -#include "spec_helper.h" +#include "test_helper.h" #include "compiler/prepare_grammar/parse_regex.h" #include "helpers/equals_pointer.h" #include "helpers/rule_helpers.h" diff --git a/spec/compiler/rules/character_set_spec.cc b/test/compiler/rules/character_set_test.cc similarity index 99% rename from spec/compiler/rules/character_set_spec.cc rename to test/compiler/rules/character_set_test.cc index cf81ff8f3..4c8f415bd 100644 --- a/spec/compiler/rules/character_set_spec.cc +++ b/test/compiler/rules/character_set_test.cc @@ -1,4 +1,4 @@ -#include "spec_helper.h" +#include "test_helper.h" #include "compiler/rules/character_set.h" using namespace rules; diff --git a/spec/compiler/rules/choice_spec.cc b/test/compiler/rules/choice_test.cc similarity index 97% rename from spec/compiler/rules/choice_spec.cc rename to test/compiler/rules/choice_test.cc index 11d78f680..59b52740a 100644 --- a/spec/compiler/rules/choice_spec.cc +++ b/test/compiler/rules/choice_test.cc @@ -1,4 +1,4 @@ -#include "spec_helper.h" +#include "test_helper.h" #include "compiler/rules/choice.h" #include "helpers/rule_helpers.h" #include "helpers/equals_pointer.h" diff --git a/spec/compiler/rules/repeat_spec.cc b/test/compiler/rules/repeat_test.cc similarity index 95% rename from spec/compiler/rules/repeat_spec.cc rename to test/compiler/rules/repeat_test.cc index 9c84c8e56..693b2d43b 100644 --- a/spec/compiler/rules/repeat_spec.cc +++ b/test/compiler/rules/repeat_test.cc @@ -1,4 +1,4 @@ -#include "spec_helper.h" +#include "test_helper.h" #include "compiler/rules/repeat.h" #include "compiler/rules/symbol.h" diff --git a/spec/compiler/util/string_helpers_spec.cc b/test/compiler/util/string_helpers_test.cc similarity index 96% rename from spec/compiler/util/string_helpers_spec.cc rename to test/compiler/util/string_helpers_test.cc index 8a16a2c6a..62b883de8 100644 --- a/spec/compiler/util/string_helpers_spec.cc +++ b/test/compiler/util/string_helpers_test.cc @@ -1,4 +1,4 @@ -#include "spec_helper.h" +#include "test_helper.h" #include "compiler/util/string_helpers.h" using util::escape_char; diff --git a/spec/fixtures/error_corpus/c_errors.txt b/test/fixtures/error_corpus/c_errors.txt similarity index 100% rename from spec/fixtures/error_corpus/c_errors.txt rename to test/fixtures/error_corpus/c_errors.txt diff --git a/spec/fixtures/error_corpus/javascript_errors.txt b/test/fixtures/error_corpus/javascript_errors.txt similarity index 100% rename from spec/fixtures/error_corpus/javascript_errors.txt rename to test/fixtures/error_corpus/javascript_errors.txt diff --git a/spec/fixtures/error_corpus/json_errors.txt b/test/fixtures/error_corpus/json_errors.txt similarity index 100% rename from spec/fixtures/error_corpus/json_errors.txt rename to test/fixtures/error_corpus/json_errors.txt diff --git a/spec/fixtures/error_corpus/python_errors.txt b/test/fixtures/error_corpus/python_errors.txt similarity index 100% rename from spec/fixtures/error_corpus/python_errors.txt rename to test/fixtures/error_corpus/python_errors.txt diff --git a/spec/fixtures/grammars/.gitkeep b/test/fixtures/grammars/.gitkeep similarity index 100% rename from spec/fixtures/grammars/.gitkeep rename to test/fixtures/grammars/.gitkeep diff --git a/spec/fixtures/test_grammars/anonymous_tokens_with_escaped_chars/corpus.txt b/test/fixtures/test_grammars/anonymous_tokens_with_escaped_chars/corpus.txt similarity index 100% rename from spec/fixtures/test_grammars/anonymous_tokens_with_escaped_chars/corpus.txt rename to test/fixtures/test_grammars/anonymous_tokens_with_escaped_chars/corpus.txt diff --git a/spec/fixtures/test_grammars/anonymous_tokens_with_escaped_chars/grammar.json b/test/fixtures/test_grammars/anonymous_tokens_with_escaped_chars/grammar.json similarity index 100% rename from spec/fixtures/test_grammars/anonymous_tokens_with_escaped_chars/grammar.json rename to test/fixtures/test_grammars/anonymous_tokens_with_escaped_chars/grammar.json diff --git a/spec/fixtures/test_grammars/anonymous_tokens_with_escaped_chars/readme.md b/test/fixtures/test_grammars/anonymous_tokens_with_escaped_chars/readme.md similarity index 100% rename from spec/fixtures/test_grammars/anonymous_tokens_with_escaped_chars/readme.md rename to test/fixtures/test_grammars/anonymous_tokens_with_escaped_chars/readme.md diff --git a/spec/fixtures/test_grammars/associativity_left/corpus.txt b/test/fixtures/test_grammars/associativity_left/corpus.txt similarity index 100% rename from spec/fixtures/test_grammars/associativity_left/corpus.txt rename to test/fixtures/test_grammars/associativity_left/corpus.txt diff --git a/spec/fixtures/test_grammars/associativity_left/grammar.json b/test/fixtures/test_grammars/associativity_left/grammar.json similarity index 100% rename from spec/fixtures/test_grammars/associativity_left/grammar.json rename to test/fixtures/test_grammars/associativity_left/grammar.json diff --git a/spec/fixtures/test_grammars/associativity_missing/expected_error.txt b/test/fixtures/test_grammars/associativity_missing/expected_error.txt similarity index 100% rename from spec/fixtures/test_grammars/associativity_missing/expected_error.txt rename to test/fixtures/test_grammars/associativity_missing/expected_error.txt diff --git a/spec/fixtures/test_grammars/associativity_missing/grammar.json b/test/fixtures/test_grammars/associativity_missing/grammar.json similarity index 100% rename from spec/fixtures/test_grammars/associativity_missing/grammar.json rename to test/fixtures/test_grammars/associativity_missing/grammar.json diff --git a/spec/fixtures/test_grammars/associativity_right/corpus.txt b/test/fixtures/test_grammars/associativity_right/corpus.txt similarity index 100% rename from spec/fixtures/test_grammars/associativity_right/corpus.txt rename to test/fixtures/test_grammars/associativity_right/corpus.txt diff --git a/spec/fixtures/test_grammars/associativity_right/grammar.json b/test/fixtures/test_grammars/associativity_right/grammar.json similarity index 100% rename from spec/fixtures/test_grammars/associativity_right/grammar.json rename to test/fixtures/test_grammars/associativity_right/grammar.json diff --git a/spec/fixtures/test_grammars/conflicting_precedence/expected_error.txt b/test/fixtures/test_grammars/conflicting_precedence/expected_error.txt similarity index 100% rename from spec/fixtures/test_grammars/conflicting_precedence/expected_error.txt rename to test/fixtures/test_grammars/conflicting_precedence/expected_error.txt diff --git a/spec/fixtures/test_grammars/conflicting_precedence/grammar.json b/test/fixtures/test_grammars/conflicting_precedence/grammar.json similarity index 100% rename from spec/fixtures/test_grammars/conflicting_precedence/grammar.json rename to test/fixtures/test_grammars/conflicting_precedence/grammar.json diff --git a/spec/fixtures/test_grammars/epsilon_rules/expected_error.txt b/test/fixtures/test_grammars/epsilon_rules/expected_error.txt similarity index 100% rename from spec/fixtures/test_grammars/epsilon_rules/expected_error.txt rename to test/fixtures/test_grammars/epsilon_rules/expected_error.txt diff --git a/spec/fixtures/test_grammars/epsilon_rules/grammar.json b/test/fixtures/test_grammars/epsilon_rules/grammar.json similarity index 100% rename from spec/fixtures/test_grammars/epsilon_rules/grammar.json rename to test/fixtures/test_grammars/epsilon_rules/grammar.json diff --git a/spec/fixtures/test_grammars/external_and_internal_tokens/corpus.txt b/test/fixtures/test_grammars/external_and_internal_tokens/corpus.txt similarity index 100% rename from spec/fixtures/test_grammars/external_and_internal_tokens/corpus.txt rename to test/fixtures/test_grammars/external_and_internal_tokens/corpus.txt diff --git a/spec/fixtures/test_grammars/external_and_internal_tokens/grammar.json b/test/fixtures/test_grammars/external_and_internal_tokens/grammar.json similarity index 100% rename from spec/fixtures/test_grammars/external_and_internal_tokens/grammar.json rename to test/fixtures/test_grammars/external_and_internal_tokens/grammar.json diff --git a/spec/fixtures/test_grammars/external_and_internal_tokens/readme.md b/test/fixtures/test_grammars/external_and_internal_tokens/readme.md similarity index 100% rename from spec/fixtures/test_grammars/external_and_internal_tokens/readme.md rename to test/fixtures/test_grammars/external_and_internal_tokens/readme.md diff --git a/spec/fixtures/test_grammars/external_and_internal_tokens/scanner.c b/test/fixtures/test_grammars/external_and_internal_tokens/scanner.c similarity index 100% rename from spec/fixtures/test_grammars/external_and_internal_tokens/scanner.c rename to test/fixtures/test_grammars/external_and_internal_tokens/scanner.c diff --git a/spec/fixtures/test_grammars/external_extra_tokens/corpus.txt b/test/fixtures/test_grammars/external_extra_tokens/corpus.txt similarity index 100% rename from spec/fixtures/test_grammars/external_extra_tokens/corpus.txt rename to test/fixtures/test_grammars/external_extra_tokens/corpus.txt diff --git a/spec/fixtures/test_grammars/external_extra_tokens/grammar.json b/test/fixtures/test_grammars/external_extra_tokens/grammar.json similarity index 100% rename from spec/fixtures/test_grammars/external_extra_tokens/grammar.json rename to test/fixtures/test_grammars/external_extra_tokens/grammar.json diff --git a/spec/fixtures/test_grammars/external_extra_tokens/scanner.c b/test/fixtures/test_grammars/external_extra_tokens/scanner.c similarity index 100% rename from spec/fixtures/test_grammars/external_extra_tokens/scanner.c rename to test/fixtures/test_grammars/external_extra_tokens/scanner.c diff --git a/spec/fixtures/test_grammars/external_tokens/corpus.txt b/test/fixtures/test_grammars/external_tokens/corpus.txt similarity index 100% rename from spec/fixtures/test_grammars/external_tokens/corpus.txt rename to test/fixtures/test_grammars/external_tokens/corpus.txt diff --git a/spec/fixtures/test_grammars/external_tokens/grammar.json b/test/fixtures/test_grammars/external_tokens/grammar.json similarity index 100% rename from spec/fixtures/test_grammars/external_tokens/grammar.json rename to test/fixtures/test_grammars/external_tokens/grammar.json diff --git a/spec/fixtures/test_grammars/external_tokens/scanner.c b/test/fixtures/test_grammars/external_tokens/scanner.c similarity index 100% rename from spec/fixtures/test_grammars/external_tokens/scanner.c rename to test/fixtures/test_grammars/external_tokens/scanner.c diff --git a/spec/fixtures/test_grammars/lexical_conflicts_due_to_state_merging/corpus.txt b/test/fixtures/test_grammars/lexical_conflicts_due_to_state_merging/corpus.txt similarity index 100% rename from spec/fixtures/test_grammars/lexical_conflicts_due_to_state_merging/corpus.txt rename to test/fixtures/test_grammars/lexical_conflicts_due_to_state_merging/corpus.txt diff --git a/spec/fixtures/test_grammars/lexical_conflicts_due_to_state_merging/grammar.json b/test/fixtures/test_grammars/lexical_conflicts_due_to_state_merging/grammar.json similarity index 100% rename from spec/fixtures/test_grammars/lexical_conflicts_due_to_state_merging/grammar.json rename to test/fixtures/test_grammars/lexical_conflicts_due_to_state_merging/grammar.json diff --git a/spec/fixtures/test_grammars/lexical_conflicts_due_to_state_merging/readme.md b/test/fixtures/test_grammars/lexical_conflicts_due_to_state_merging/readme.md similarity index 100% rename from spec/fixtures/test_grammars/lexical_conflicts_due_to_state_merging/readme.md rename to test/fixtures/test_grammars/lexical_conflicts_due_to_state_merging/readme.md diff --git a/spec/fixtures/test_grammars/precedence_on_single_child_missing/expected_error.txt b/test/fixtures/test_grammars/precedence_on_single_child_missing/expected_error.txt similarity index 100% rename from spec/fixtures/test_grammars/precedence_on_single_child_missing/expected_error.txt rename to test/fixtures/test_grammars/precedence_on_single_child_missing/expected_error.txt diff --git a/spec/fixtures/test_grammars/precedence_on_single_child_missing/grammar.json b/test/fixtures/test_grammars/precedence_on_single_child_missing/grammar.json similarity index 100% rename from spec/fixtures/test_grammars/precedence_on_single_child_missing/grammar.json rename to test/fixtures/test_grammars/precedence_on_single_child_missing/grammar.json diff --git a/spec/fixtures/test_grammars/precedence_on_single_child_missing/readme.md b/test/fixtures/test_grammars/precedence_on_single_child_missing/readme.md similarity index 100% rename from spec/fixtures/test_grammars/precedence_on_single_child_missing/readme.md rename to test/fixtures/test_grammars/precedence_on_single_child_missing/readme.md diff --git a/spec/fixtures/test_grammars/precedence_on_single_child_negative/corpus.txt b/test/fixtures/test_grammars/precedence_on_single_child_negative/corpus.txt similarity index 100% rename from spec/fixtures/test_grammars/precedence_on_single_child_negative/corpus.txt rename to test/fixtures/test_grammars/precedence_on_single_child_negative/corpus.txt diff --git a/spec/fixtures/test_grammars/precedence_on_single_child_negative/grammar.json b/test/fixtures/test_grammars/precedence_on_single_child_negative/grammar.json similarity index 100% rename from spec/fixtures/test_grammars/precedence_on_single_child_negative/grammar.json rename to test/fixtures/test_grammars/precedence_on_single_child_negative/grammar.json diff --git a/spec/fixtures/test_grammars/precedence_on_single_child_negative/readme.md b/test/fixtures/test_grammars/precedence_on_single_child_negative/readme.md similarity index 100% rename from spec/fixtures/test_grammars/precedence_on_single_child_negative/readme.md rename to test/fixtures/test_grammars/precedence_on_single_child_negative/readme.md diff --git a/spec/fixtures/test_grammars/precedence_on_single_child_positive/corpus.txt b/test/fixtures/test_grammars/precedence_on_single_child_positive/corpus.txt similarity index 100% rename from spec/fixtures/test_grammars/precedence_on_single_child_positive/corpus.txt rename to test/fixtures/test_grammars/precedence_on_single_child_positive/corpus.txt diff --git a/spec/fixtures/test_grammars/precedence_on_single_child_positive/grammar.json b/test/fixtures/test_grammars/precedence_on_single_child_positive/grammar.json similarity index 100% rename from spec/fixtures/test_grammars/precedence_on_single_child_positive/grammar.json rename to test/fixtures/test_grammars/precedence_on_single_child_positive/grammar.json diff --git a/spec/fixtures/test_grammars/precedence_on_single_child_positive/readme.md b/test/fixtures/test_grammars/precedence_on_single_child_positive/readme.md similarity index 100% rename from spec/fixtures/test_grammars/precedence_on_single_child_positive/readme.md rename to test/fixtures/test_grammars/precedence_on_single_child_positive/readme.md diff --git a/spec/fixtures/test_grammars/precedence_on_subsequence/corpus.txt b/test/fixtures/test_grammars/precedence_on_subsequence/corpus.txt similarity index 100% rename from spec/fixtures/test_grammars/precedence_on_subsequence/corpus.txt rename to test/fixtures/test_grammars/precedence_on_subsequence/corpus.txt diff --git a/spec/fixtures/test_grammars/precedence_on_subsequence/grammar.json b/test/fixtures/test_grammars/precedence_on_subsequence/grammar.json similarity index 100% rename from spec/fixtures/test_grammars/precedence_on_subsequence/grammar.json rename to test/fixtures/test_grammars/precedence_on_subsequence/grammar.json diff --git a/spec/fixtures/test_grammars/readme.md b/test/fixtures/test_grammars/readme.md similarity index 100% rename from spec/fixtures/test_grammars/readme.md rename to test/fixtures/test_grammars/readme.md diff --git a/spec/fixtures/test_grammars/readme_grammar/corpus.txt b/test/fixtures/test_grammars/readme_grammar/corpus.txt similarity index 100% rename from spec/fixtures/test_grammars/readme_grammar/corpus.txt rename to test/fixtures/test_grammars/readme_grammar/corpus.txt diff --git a/spec/fixtures/test_grammars/readme_grammar/grammar.json b/test/fixtures/test_grammars/readme_grammar/grammar.json similarity index 100% rename from spec/fixtures/test_grammars/readme_grammar/grammar.json rename to test/fixtures/test_grammars/readme_grammar/grammar.json diff --git a/spec/fixtures/test_grammars/start_rule_is_blank/corpus.txt b/test/fixtures/test_grammars/start_rule_is_blank/corpus.txt similarity index 100% rename from spec/fixtures/test_grammars/start_rule_is_blank/corpus.txt rename to test/fixtures/test_grammars/start_rule_is_blank/corpus.txt diff --git a/spec/fixtures/test_grammars/start_rule_is_blank/grammar.json b/test/fixtures/test_grammars/start_rule_is_blank/grammar.json similarity index 100% rename from spec/fixtures/test_grammars/start_rule_is_blank/grammar.json rename to test/fixtures/test_grammars/start_rule_is_blank/grammar.json diff --git a/spec/fixtures/test_grammars/start_rule_is_token/corpus.txt b/test/fixtures/test_grammars/start_rule_is_token/corpus.txt similarity index 100% rename from spec/fixtures/test_grammars/start_rule_is_token/corpus.txt rename to test/fixtures/test_grammars/start_rule_is_token/corpus.txt diff --git a/spec/fixtures/test_grammars/start_rule_is_token/grammar.json b/test/fixtures/test_grammars/start_rule_is_token/grammar.json similarity index 100% rename from spec/fixtures/test_grammars/start_rule_is_token/grammar.json rename to test/fixtures/test_grammars/start_rule_is_token/grammar.json diff --git a/spec/helpers/dedent.h b/test/helpers/dedent.h similarity index 100% rename from spec/helpers/dedent.h rename to test/helpers/dedent.h diff --git a/spec/helpers/encoding_helpers.cc b/test/helpers/encoding_helpers.cc similarity index 100% rename from spec/helpers/encoding_helpers.cc rename to test/helpers/encoding_helpers.cc diff --git a/spec/helpers/encoding_helpers.h b/test/helpers/encoding_helpers.h similarity index 100% rename from spec/helpers/encoding_helpers.h rename to test/helpers/encoding_helpers.h diff --git a/spec/helpers/equals_pointer.h b/test/helpers/equals_pointer.h similarity index 100% rename from spec/helpers/equals_pointer.h rename to test/helpers/equals_pointer.h diff --git a/spec/helpers/file_helpers.cc b/test/helpers/file_helpers.cc similarity index 100% rename from spec/helpers/file_helpers.cc rename to test/helpers/file_helpers.cc diff --git a/spec/helpers/file_helpers.h b/test/helpers/file_helpers.h similarity index 100% rename from spec/helpers/file_helpers.h rename to test/helpers/file_helpers.h diff --git a/spec/helpers/load_language.cc b/test/helpers/load_language.cc similarity index 98% rename from spec/helpers/load_language.cc rename to test/helpers/load_language.cc index 71829c5df..cb67243a1 100644 --- a/spec/helpers/load_language.cc +++ b/test/helpers/load_language.cc @@ -1,4 +1,4 @@ -#include "spec_helper.h" +#include "test_helper.h" #include "helpers/load_language.h" #include "helpers/file_helpers.h" #include @@ -144,7 +144,7 @@ const TSLanguage *load_real_language(const string &language_name) { if (loaded_languages[language_name]) return loaded_languages[language_name]; - string language_dir = string("spec/fixtures/grammars/") + language_name; + string language_dir = string("test/fixtures/grammars/") + language_name; string grammar_filename = language_dir + "/src/grammar.json"; string parser_filename = language_dir + "/src/parser.c"; string external_scanner_filename = language_dir + "/src/scanner.cc"; diff --git a/spec/helpers/load_language.h b/test/helpers/load_language.h similarity index 100% rename from spec/helpers/load_language.h rename to test/helpers/load_language.h diff --git a/spec/helpers/point_helpers.cc b/test/helpers/point_helpers.cc similarity index 100% rename from spec/helpers/point_helpers.cc rename to test/helpers/point_helpers.cc diff --git a/spec/helpers/point_helpers.h b/test/helpers/point_helpers.h similarity index 100% rename from spec/helpers/point_helpers.h rename to test/helpers/point_helpers.h diff --git a/spec/helpers/random_helpers.cc b/test/helpers/random_helpers.cc similarity index 100% rename from spec/helpers/random_helpers.cc rename to test/helpers/random_helpers.cc diff --git a/spec/helpers/random_helpers.h b/test/helpers/random_helpers.h similarity index 100% rename from spec/helpers/random_helpers.h rename to test/helpers/random_helpers.h diff --git a/spec/helpers/read_test_entries.cc b/test/helpers/read_test_entries.cc similarity index 98% rename from spec/helpers/read_test_entries.cc rename to test/helpers/read_test_entries.cc index e743253f0..9a3dd8fac 100644 --- a/spec/helpers/read_test_entries.cc +++ b/test/helpers/read_test_entries.cc @@ -12,7 +12,7 @@ using std::smatch; using std::string; using std::vector; -string fixtures_dir = "spec/fixtures/"; +string fixtures_dir = "test/fixtures/"; static string trim_output(const string &input) { string result(input); diff --git a/spec/helpers/read_test_entries.h b/test/helpers/read_test_entries.h similarity index 100% rename from spec/helpers/read_test_entries.h rename to test/helpers/read_test_entries.h diff --git a/spec/helpers/record_alloc.cc b/test/helpers/record_alloc.cc similarity index 100% rename from spec/helpers/record_alloc.cc rename to test/helpers/record_alloc.cc diff --git a/spec/helpers/record_alloc.h b/test/helpers/record_alloc.h similarity index 100% rename from spec/helpers/record_alloc.h rename to test/helpers/record_alloc.h diff --git a/spec/helpers/rule_helpers.cc b/test/helpers/rule_helpers.cc similarity index 100% rename from spec/helpers/rule_helpers.cc rename to test/helpers/rule_helpers.cc diff --git a/spec/helpers/rule_helpers.h b/test/helpers/rule_helpers.h similarity index 100% rename from spec/helpers/rule_helpers.h rename to test/helpers/rule_helpers.h diff --git a/spec/helpers/scope_sequence.cc b/test/helpers/scope_sequence.cc similarity index 100% rename from spec/helpers/scope_sequence.cc rename to test/helpers/scope_sequence.cc diff --git a/spec/helpers/scope_sequence.h b/test/helpers/scope_sequence.h similarity index 100% rename from spec/helpers/scope_sequence.h rename to test/helpers/scope_sequence.h diff --git a/spec/helpers/spy_input.cc b/test/helpers/spy_input.cc similarity index 100% rename from spec/helpers/spy_input.cc rename to test/helpers/spy_input.cc diff --git a/spec/helpers/spy_input.h b/test/helpers/spy_input.h similarity index 100% rename from spec/helpers/spy_input.h rename to test/helpers/spy_input.h diff --git a/spec/helpers/spy_logger.cc b/test/helpers/spy_logger.cc similarity index 100% rename from spec/helpers/spy_logger.cc rename to test/helpers/spy_logger.cc diff --git a/spec/helpers/spy_logger.h b/test/helpers/spy_logger.h similarity index 100% rename from spec/helpers/spy_logger.h rename to test/helpers/spy_logger.h diff --git a/spec/helpers/stderr_logger.cc b/test/helpers/stderr_logger.cc similarity index 100% rename from spec/helpers/stderr_logger.cc rename to test/helpers/stderr_logger.cc diff --git a/spec/helpers/stderr_logger.h b/test/helpers/stderr_logger.h similarity index 100% rename from spec/helpers/stderr_logger.h rename to test/helpers/stderr_logger.h diff --git a/spec/helpers/stream_methods.cc b/test/helpers/stream_methods.cc similarity index 99% rename from spec/helpers/stream_methods.cc rename to test/helpers/stream_methods.cc index 5ef2898cb..20338b474 100644 --- a/spec/helpers/stream_methods.cc +++ b/test/helpers/stream_methods.cc @@ -1,5 +1,5 @@ #include "helpers/stream_methods.h" -#include "spec_helper.h" +#include "test_helper.h" #include "tree_sitter/compiler.h" #include "compiler/parse_table.h" #include "compiler/syntax_grammar.h" diff --git a/spec/helpers/stream_methods.h b/test/helpers/stream_methods.h similarity index 100% rename from spec/helpers/stream_methods.h rename to test/helpers/stream_methods.h diff --git a/spec/helpers/tree_helpers.cc b/test/helpers/tree_helpers.cc similarity index 100% rename from spec/helpers/tree_helpers.cc rename to test/helpers/tree_helpers.cc diff --git a/spec/helpers/tree_helpers.h b/test/helpers/tree_helpers.h similarity index 100% rename from spec/helpers/tree_helpers.h rename to test/helpers/tree_helpers.h diff --git a/spec/integration/real_grammars.cc b/test/integration/real_grammars.cc similarity index 99% rename from spec/integration/real_grammars.cc rename to test/integration/real_grammars.cc index a7c2137db..d20f119b8 100644 --- a/spec/integration/real_grammars.cc +++ b/test/integration/real_grammars.cc @@ -1,4 +1,4 @@ -#include "spec_helper.h" +#include "test_helper.h" #include "runtime/alloc.h" #include "helpers/load_language.h" #include "helpers/read_test_entries.h" diff --git a/spec/integration/test_grammars.cc b/test/integration/test_grammars.cc similarity index 96% rename from spec/integration/test_grammars.cc rename to test/integration/test_grammars.cc index 128dd6ccd..f72043d99 100644 --- a/spec/integration/test_grammars.cc +++ b/test/integration/test_grammars.cc @@ -1,4 +1,4 @@ -#include "spec_helper.h" +#include "test_helper.h" #include "helpers/read_test_entries.h" #include "helpers/load_language.h" #include "helpers/stderr_logger.h" @@ -7,7 +7,7 @@ START_TEST -string grammars_dir_path = "spec/fixtures/test_grammars"; +string grammars_dir_path = "test/fixtures/test_grammars"; vector test_languages = list_directory(grammars_dir_path); for (auto &language_name : test_languages) { diff --git a/spec/runtime/document_spec.cc b/test/runtime/document_test.cc similarity index 99% rename from spec/runtime/document_spec.cc rename to test/runtime/document_test.cc index 1863e210e..71d7b8c76 100644 --- a/spec/runtime/document_spec.cc +++ b/test/runtime/document_test.cc @@ -1,4 +1,4 @@ -#include "spec_helper.h" +#include "test_helper.h" #include "runtime/alloc.h" #include "helpers/record_alloc.h" #include "helpers/stream_methods.h" diff --git a/spec/runtime/node_spec.cc b/test/runtime/node_test.cc similarity index 99% rename from spec/runtime/node_spec.cc rename to test/runtime/node_test.cc index f01a862f0..00c6a2675 100644 --- a/spec/runtime/node_spec.cc +++ b/test/runtime/node_test.cc @@ -1,4 +1,4 @@ -#include "spec_helper.h" +#include "test_helper.h" #include "runtime/alloc.h" #include "helpers/tree_helpers.h" #include "helpers/point_helpers.h" diff --git a/spec/runtime/parser_spec.cc b/test/runtime/parser_test.cc similarity index 99% rename from spec/runtime/parser_spec.cc rename to test/runtime/parser_test.cc index c1c3a5475..0052c4abf 100644 --- a/spec/runtime/parser_spec.cc +++ b/test/runtime/parser_test.cc @@ -1,4 +1,4 @@ -#include "spec_helper.h" +#include "test_helper.h" #include "runtime/alloc.h" #include "helpers/record_alloc.h" #include "helpers/spy_input.h" diff --git a/spec/runtime/stack_spec.cc b/test/runtime/stack_test.cc similarity index 99% rename from spec/runtime/stack_spec.cc rename to test/runtime/stack_test.cc index 201808434..bf0514b3b 100644 --- a/spec/runtime/stack_spec.cc +++ b/test/runtime/stack_test.cc @@ -1,4 +1,4 @@ -#include "spec_helper.h" +#include "test_helper.h" #include "helpers/tree_helpers.h" #include "helpers/point_helpers.h" #include "helpers/record_alloc.h" diff --git a/spec/runtime/tree_spec.cc b/test/runtime/tree_test.cc similarity index 99% rename from spec/runtime/tree_spec.cc rename to test/runtime/tree_test.cc index bdc8145f2..4b3da73df 100644 --- a/spec/runtime/tree_spec.cc +++ b/test/runtime/tree_test.cc @@ -1,4 +1,4 @@ -#include "spec_helper.h" +#include "test_helper.h" #include "helpers/tree_helpers.h" #include "helpers/point_helpers.h" #include "runtime/tree.h" diff --git a/spec/spec_helper.h b/test/test_helper.h similarity index 81% rename from spec/spec_helper.h rename to test/test_helper.h index 7a3d5bceb..6947452bc 100644 --- a/spec/spec_helper.h +++ b/test/test_helper.h @@ -1,5 +1,5 @@ -#ifndef SPEC_HELPER_ -#define SPEC_HELPER_ +#ifndef TEST_HELPER_ +#define TEST_HELPER_ #include "bandit/bandit.h" #include "tree_sitter/compiler.h" @@ -16,4 +16,4 @@ using namespace tree_sitter; #define TREE_SITTER_WRAP_MALLOC -#endif // SPEC_HELPER_ +#endif // TEST_HELPER_ diff --git a/spec/specs.cc b/test/tests.cc similarity index 91% rename from spec/specs.cc rename to test/tests.cc index 0c23199ce..2b7c35ba8 100644 --- a/spec/specs.cc +++ b/test/tests.cc @@ -1,4 +1,4 @@ -#include "spec_helper.h" +#include "test_helper.h" int main(int argc, char *argv[]) { int seed; diff --git a/tests.gyp b/tests.gyp index c19600075..9a792820e 100644 --- a/tests.gyp +++ b/tests.gyp @@ -9,16 +9,16 @@ ], 'include_dirs': [ 'src', - 'spec', + 'test', 'externals/bandit', 'externals/utf8proc', ], 'sources': [ - 'spec/specs.cc', - '