summaryrefslogtreecommitdiffhomepage
path: root/test/init_mrbtest.c
diff options
context:
space:
mode:
authortake_cheeze <[email protected]>2014-07-10 21:43:07 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-07-12 20:36:45 +0900
commit4a6c651f82c2d416682e9729842d4fda6beee2bf (patch)
tree890a25f96916c8eea4906f423f8ffcfc9d41f01c /test/init_mrbtest.c
parentaff65afe97cc241af396ceb8df15bed27788c108 (diff)
downloadmruby-4a6c651f82c2d416682e9729842d4fda6beee2bf.tar.gz
mruby-4a6c651f82c2d416682e9729842d4fda6beee2bf.zip
Run mrbgem and core tests on minimum dependencies.
Solves #2355. In test drivers: * Uses `mrb_t_pass_result` to check and pass test result to main `mrb_state`. * Adds `mrb_init_test_driver` to init test `mrb_state`.
Diffstat (limited to 'test/init_mrbtest.c')
-rw-r--r--test/init_mrbtest.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/init_mrbtest.c b/test/init_mrbtest.c
index 3ce42f661..3a61a6f39 100644
--- a/test/init_mrbtest.c
+++ b/test/init_mrbtest.c
@@ -6,15 +6,26 @@ extern const uint8_t mrbtest_assert_irep[];
extern const uint8_t mrbtest_irep[];
void mrbgemtest_init(mrb_state* mrb);
+void mrb_init_test_driver(mrb_state* mrb);
+void mrb_t_pass_result(mrb_state *mrb_dst, mrb_state *mrb_src);
void
mrb_init_mrbtest(mrb_state *mrb)
{
+ mrb_state *core_test;
+
mrb_load_irep(mrb, mrbtest_assert_irep);
- mrb_load_irep(mrb, mrbtest_irep);
+
+ core_test = mrb_open_core(mrb_default_allocf, NULL);
+ mrb_init_test_driver(core_test);
+ mrb_load_irep(core_test, mrbtest_assert_irep);
+ mrb_load_irep(core_test, mrbtest_irep);
+ mrb_t_pass_result(mrb, core_test);
+
#ifndef DISABLE_GEMS
mrbgemtest_init(mrb);
#endif
+
if (mrb->exc) {
mrb_print_error(mrb);
exit(EXIT_FAILURE);