From: Jérémie Astor Date: Wed, 6 May 2020 17:38:46 +0000 (+0200) Subject: :white_check_mark: test forks X-Git-Tag: nightly~1648 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=65dbec72b24d2934384efaebc44f1d821dfc9759;p=gwion.git :white_check_mark: test forks --- diff --git a/tests/fork/fork.gw b/tests/fork/fork.gw new file mode 100644 index 00000000..63256ea8 --- /dev/null +++ b/tests/fork/fork.gw @@ -0,0 +1,11 @@ +fork { + <<< "start" >>>; + 12::samp => now; + me.test_cancel(); + <<< "stop" >>>; +} @=> Fork ref f; + +1 => f.set_cancel; +2::samp => now; +0 => f.set_cancel; +f.join(); diff --git a/tests/fork/fork_clean.gw b/tests/fork/fork_clean.gw new file mode 100644 index 00000000..4e6877b3 --- /dev/null +++ b/tests/fork/fork_clean.gw @@ -0,0 +1 @@ +fork { <<< __func__ >>>; second => now; }; diff --git a/tests/fork/fork_in_fork.gw b/tests/fork/fork_in_fork.gw new file mode 100644 index 00000000..f75af956 --- /dev/null +++ b/tests/fork/fork_in_fork.gw @@ -0,0 +1,10 @@ +fork { + fork { + <<< __func__ >>>; + second => now; + }; + <<< __func__ >>>; + second => now; +}; + +samp => now; diff --git a/tests/fork/fork_join.gw b/tests/fork/fork_join.gw new file mode 100644 index 00000000..e0b85d7e --- /dev/null +++ b/tests/fork/fork_join.gw @@ -0,0 +1,3 @@ +fork { <<< __func__ >>>; } @=> Fork ref f; +second => now; +f.join(); diff --git a/tests/fork/fork_join2.gw b/tests/fork/fork_join2.gw new file mode 100644 index 00000000..dd8d58f0 --- /dev/null +++ b/tests/fork/fork_join2.gw @@ -0,0 +1,2 @@ +fork { <<< __func__ >>>; minute => now; } @=> Fork ref f; +f.join();