summaryrefslogtreecommitdiff
path: root/libcr/tests
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-11-25 08:39:44 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-11-25 08:39:44 -0700
commit92de40d33e085040e4b9936ae1ddebf152dff102 (patch)
tree7f1156acb9a3af4e720319ba17120176cdf28a2e /libcr/tests
parent839c3c83993b2b8d9d6be20407afdf59be23e701 (diff)
libcr: Return if all coroutines exit
Diffstat (limited to 'libcr/tests')
-rw-r--r--libcr/tests/test_matrix.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libcr/tests/test_matrix.c b/libcr/tests/test_matrix.c
index f1aa6fe..1f23455 100644
--- a/libcr/tests/test_matrix.c
+++ b/libcr/tests/test_matrix.c
@@ -4,17 +4,21 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
-#include <stdlib.h> /* for exit(3) */
-
#include <libcr/coroutine.h>
+int a = 1;
+
COROUTINE cr_init(void *) {
cr_begin();
- exit(0);
+ a = 2;
cr_end();
}
int main() {
coroutine_add("init", cr_init, NULL);
coroutine_main();
+ if (a != 2)
+ return 1;
+ coroutine_main();
+ return 0;
}