summaryrefslogtreecommitdiffhomepage
path: root/mrbgems
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2019-03-13 22:30:08 +0900
committerGitHub <[email protected]>2019-03-13 22:30:08 +0900
commit63124bf63350529f5c601d12a7c0bf16d763af78 (patch)
treebceb7adb985e9ee00aa04b6416da681214ad23c4 /mrbgems
parentad0a8888f3c7fb99304347760a746dcf64539f5e (diff)
parentc3122c887a7fb842aac78b4735a64004a9b71a20 (diff)
downloadmruby-63124bf63350529f5c601d12a7c0bf16d763af78.tar.gz
mruby-63124bf63350529f5c601d12a7c0bf16d763af78.zip
Merge pull request #4327 from shuujii/do-not-raise-an-exception-when-bintest-fail
Do not raise an exception when bintest fail
Diffstat (limited to 'mrbgems')
-rw-r--r--mrbgems/mruby-test/driver.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/mrbgems/mruby-test/driver.c b/mrbgems/mruby-test/driver.c
index 6e58c3e28..6b91b7457 100644
--- a/mrbgems/mruby-test/driver.c
+++ b/mrbgems/mruby-test/driver.c
@@ -30,31 +30,19 @@ print_hint(void)
}
static int
-check_error(mrb_state *mrb)
-{
- /* Error check */
- /* $ko_test and $kill_test should be 0 */
- mrb_value ko_test = mrb_gv_get(mrb, mrb_intern_lit(mrb, "$ko_test"));
- mrb_value kill_test = mrb_gv_get(mrb, mrb_intern_lit(mrb, "$kill_test"));
-
- return mrb_fixnum_p(ko_test) && mrb_fixnum(ko_test) == 0 && mrb_fixnum_p(kill_test) && mrb_fixnum(kill_test) == 0;
-}
-
-static int
eval_test(mrb_state *mrb)
{
/* evaluate the test */
- mrb_funcall(mrb, mrb_top_self(mrb), "report", 0);
+ mrb_value result = mrb_funcall(mrb, mrb_top_self(mrb), "report", 0);
/* did an exception occur? */
if (mrb->exc) {
mrb_print_error(mrb);
mrb->exc = 0;
return EXIT_FAILURE;
}
- else if (!check_error(mrb)) {
- return EXIT_FAILURE;
+ else {
+ return mrb_bool(result) ? EXIT_SUCCESS : EXIT_FAILURE;
}
- return EXIT_SUCCESS;
}
static void