summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Makefile19
-rw-r--r--test/init_mrbtest.c3
2 files changed, 19 insertions, 3 deletions
diff --git a/test/Makefile b/test/Makefile
index 3df07b280..b06343084 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -10,6 +10,8 @@ MLIB := $(TARGET).o
CLIB := $(TARGET).c
INIT := init_$(TARGET).c
DLIB := $(TARGET).ctmp
+GEMDIR := ../mrbgems
+GEMDLIB := $(GEMDIR)/g/mrbgemtest.ctmp
RLIB := $(TARGET).rbtmp
DEPLIB := $(TARGET).d driver.d
ASSLIB := $(BASEDIR)/assert.rb
@@ -49,6 +51,13 @@ endif
# mruby compiler and test driver
ifeq ($(OS),Windows_NT)
+<<<<<<< HEAD
+ MRBC = ../bin/mrbc.exe
+ EXE := $(TARGET).exe
+else
+ MRBC = ../bin/mrbc
+ EXE := $(TARGET)
+=======
MRBC = ../bin/mrbc.exe
MRUBY= ../bin/mruby.exe
EXE := $(TARGET).exe
@@ -56,9 +65,9 @@ else
MRBC = ../bin/mrbc
MRUBY= ../bin/mruby
EXE := $(TARGET)
+>>>>>>> upstream/master
endif
-
##############################
# generic build targets, rules
@@ -85,8 +94,12 @@ $(OBJS) : %.o : %.c
$(CC) $(ALL_CFLAGS) -MMD $(INCLUDES) -c $< -o $@
# Compile C source from merged mruby source
-$(CLIB) : $(RLIB) $(MRBC) $(INIT)
- $(MRBC) -Bmrbtest_irep -o$(DLIB) $(RLIB); $(CAT) $(INIT) $(DLIB) > $@
+$(CLIB) : $(DLIB) $(INIT)
+ @$(MAKE) prepare-test -C $(GEMDIR)
+ $(CAT) $(INIT) $(DLIB) $(GEMDLIB) > $@
+
+$(DLIB) : $(RLIB) $(MRBC)
+ $(MRBC) -Bmrbtest_irep -o$@ $(RLIB)
# merge mruby sources
$(RLIB) : $(ASSLIB) $(MRBS)
diff --git a/test/init_mrbtest.c b/test/init_mrbtest.c
index b9f09dd2f..2bc2f2e4b 100644
--- a/test/init_mrbtest.c
+++ b/test/init_mrbtest.c
@@ -5,13 +5,16 @@
#include "mruby/proc.h"
extern const char mrbtest_irep[];
+extern const char mrbgemtest_irep[];
void
mrb_init_mrbtest(mrb_state *mrb)
{
int n = mrb_read_irep(mrb, mrbtest_irep);
+ int m = mrb_read_irep(mrb, mrbgemtest_irep);
mrb_run(mrb, mrb_proc_new(mrb, mrb->irep[n]), mrb_top_self(mrb));
+ mrb_run(mrb, mrb_proc_new(mrb, mrb->irep[m]), mrb_top_self(mrb));
if (mrb->exc) {
mrb_p(mrb, mrb_obj_value(mrb->exc));
exit(0);