| 1036 | } |
| 1037 | |
| 1038 | bool tf_suite_enter(const char *suite) { |
| 1039 | if (tf_current_suite) { |
| 1040 | /* A suite run from inside another: its tests belong to the registered |
| 1041 | * suite that runs it, which is the name a token and argv both use. */ |
| 1042 | return true; |
| 1043 | } |
| 1044 | if (tf_only_active) { |
| 1045 | tf_only_suite_first = tf_only_suite_run(suite, &tf_only_suite_end); |
| 1046 | if (tf_only_suite_first == tf_only_suite_end) { |
| 1047 | return false; /* no token names it: its body, setup included, never runs */ |
| 1048 | } |
| 1049 | tf_only_raise(tf_only_suite_first, tf_only_suite_end, TF_ONLY_ENTERED); |
| 1050 | for (size_t i = tf_only_suite_first; i < tf_only_suite_end; i++) { |
| 1051 | if (!tf_only_tokens[i].test[0]) { |
| 1052 | /* Entering fulfills a whole-suite token even when it has no tests. */ |
| 1053 | tf_only_tokens[i].state = TF_ONLY_MATCHED; |
| 1054 | } |
| 1055 | } |
| 1056 | } |
| 1057 | tf_current_suite = suite; |
| 1058 | return true; |
| 1059 | } |
| 1060 | |
| 1061 | void tf_suite_leave(const char *suite) { |
| 1062 | if (tf_current_suite && strcmp(tf_current_suite, suite) == 0) { |
nothing calls this directly
no test coverage detected