| 678 | } |
| 679 | |
| 680 | static bool dm_control_published(const char *db, const char *project, const char *label) { |
| 681 | char props[512], tail_reason[64], conflict_reason[64]; |
| 682 | int healthy = 0, tail = 0, conflict = 0; |
| 683 | dm_edge(db, "Healthy.Uses", "Healthy.Target", props, sizeof(props), &healthy); |
| 684 | dm_edge(db, "Bad.Tail", "Healthy.Target", props, sizeof(props), &tail); |
| 685 | dm_edge(db, "Healthy.TriesHidden", "Healthy.Hidden", props, sizeof(props), &conflict); |
| 686 | dm_row(db, "Bad.cs", "global::Good.Target", tail_reason, sizeof(tail_reason), NULL, 0); |
| 687 | dm_row(db, "Healthy.cs", "Hidden", conflict_reason, sizeof(conflict_reason), NULL, 0); |
| 688 | int errors = dm_count(db, "SELECT COUNT(*) FROM doc_link_unresolved WHERE reason = 'error'"); |
| 689 | char *status = dm_index_status(project, false); |
| 690 | const char *block = dm_doc_links_block(status); |
| 691 | bool status_ok = block && strstr(block, "\n status: ok"); |
| 692 | bool correct = healthy == 1 && tail == 1 && !tail_reason[0] && conflict == 0 && |
| 693 | strcmp(conflict_reason, "graph_gap") == 0 && errors == 0 && status_ok; |
| 694 | fprintf(stderr, |
| 695 | "doc control published case=%s healthy=%d tail=%d tail_reason=%s conflict=%d " |
| 696 | "conflict_reason=%s errors=%d status_ok=%d correct=%d\n", |
| 697 | label, healthy, tail, tail_reason, conflict, conflict_reason, errors, status_ok, |
| 698 | correct); |
| 699 | free(status); |
| 700 | return correct; |
| 701 | } |
| 702 | |
| 703 | TEST(doc_mentions_cs_control_publication) { |
| 704 | static const size_t cases[] = {1, 2, 4, 6, 7, 8}; |
no test coverage detected