mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-02 06:45:49 +01:00
@@ -36,18 +36,10 @@ auto main(int argc, char** argv) -> int {
|
||||
ts_parser_set_language(parser, tree_sitter_carbon());
|
||||
|
||||
std::vector<std::string> failed;
|
||||
std::vector<std::string> skipped;
|
||||
for (int i = 1; i < argc; i++) {
|
||||
std::string file_path = argv[i];
|
||||
std::string source = ReadFile(file_path);
|
||||
|
||||
// `and` in where clauses is not parsed correctly.
|
||||
// TODO: remove once where clause is implemented correctly.
|
||||
if (source.find("where") != std::string::npos &&
|
||||
source.find("and") != std::string::npos) {
|
||||
skipped.push_back(file_path);
|
||||
continue;
|
||||
}
|
||||
auto* tree =
|
||||
ts_parser_parse_string(parser, nullptr, source.data(), source.size());
|
||||
|
||||
@@ -64,15 +56,9 @@ auto main(int argc, char** argv) -> int {
|
||||
ts_tree_delete(tree);
|
||||
}
|
||||
ts_parser_delete(parser);
|
||||
for (const auto& file : skipped) {
|
||||
std::cout << "SKIPPED " << file << "\n";
|
||||
}
|
||||
for (const auto& file : failed) {
|
||||
std::cout << "FAILED " << file << "\n";
|
||||
}
|
||||
if (!skipped.empty()) {
|
||||
std::cout << skipped.size() << " tests skipped.\n";
|
||||
}
|
||||
if (!failed.empty()) {
|
||||
std::cout << failed.size() << " tests failing.\n";
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user