Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
0e7d5a2e
Commit
0e7d5a2e
authored
Sep 22, 2012
by
Daniel Bovensiepen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move Gem Tests into the main Test target
parent
80b7f45f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
28 deletions
+18
-28
Makefile
Makefile
+0
-1
mrbgems/Makefile
mrbgems/Makefile
+4
-3
mrbgems/generator.c
mrbgems/generator.c
+6
-22
test/Makefile
test/Makefile
+5
-2
test/init_mrbtest.c
test/init_mrbtest.c
+3
-0
No files found.
Makefile
View file @
0e7d5a2e
...
@@ -52,7 +52,6 @@ all :
...
@@ -52,7 +52,6 @@ all :
.PHONY
:
test
.PHONY
:
test
test
:
all
test
:
all
@
$(MAKE)
-C
test
$(MAKE_FLAGS)
@
$(MAKE)
-C
test
$(MAKE_FLAGS)
@
$(MAKE)
test
-C
mrbgems
$(MAKE_FLAGS)
# clean up
# clean up
.PHONY
:
clean
.PHONY
:
clean
...
...
mrbgems/Makefile
View file @
0e7d5a2e
...
@@ -5,7 +5,7 @@ LIBR := ../lib/libmruby.a
...
@@ -5,7 +5,7 @@ LIBR := ../lib/libmruby.a
INIT
:=
init_gems
INIT
:=
init_gems
RM_F
:=
rm
-f
RM_F
:=
rm
-f
CC_FLAGS
:=
-Wall
-Werror-implicit-function-declaration
-g
-O3
-MMD
-I
.
-I
./../include
CC_FLAGS
:=
-Wall
-Werror-implicit-function-declaration
-g
-O3
-MMD
-I
.
-I
./../include
MMAKER
:=
./ge
m_helpe
r
MMAKER
:=
./ge
nerato
r
MMAKER_BIN
:=
$(MMAKER)
MMAKER_BIN
:=
$(MMAKER)
export
CC
=
gcc
export
CC
=
gcc
export
LL
=
gcc
export
LL
=
gcc
...
@@ -43,8 +43,9 @@ $(MMAKER_BIN) : $(MMAKER).o
...
@@ -43,8 +43,9 @@ $(MMAKER_BIN) : $(MMAKER).o
$(MMAKER).o
:
$(MMAKER).c
$(MMAKER).o
:
$(MMAKER).c
$(CC)
$(CC_FLAGS)
-MMD
-c
$<
-o
$@
$(CC)
$(CC_FLAGS)
-MMD
-c
$<
-o
$@
test
:
.PHONY
:
prepare-test
@
$(MAKE)
test
-C
g
prepare-test
:
@
$(MAKE)
prepare-test
-C
g
# clean driver and all gems
# clean driver and all gems
.PHONY
:
clean
.PHONY
:
clean
...
...
mrbgems/ge
m_helpe
r.c
→
mrbgems/ge
nerato
r.c
View file @
0e7d5a2e
...
@@ -138,32 +138,16 @@ make_gem_makefile()
...
@@ -138,32 +138,16 @@ make_gem_makefile()
for_each_gem
(
" "
,
"/mrblib/*.rb"
,
"
\t
cat"
,
"> mrblib_gem.rbtmp"
,
"mrblib"
);
for_each_gem
(
" "
,
"/mrblib/*.rb"
,
"
\t
cat"
,
"> mrblib_gem.rbtmp"
,
"mrblib"
);
puts
(
""
);
puts
(
""
);
puts
(
".PHONY : test"
);
puts
(
".PHONY : prepare-test"
);
puts
(
"test : mrbtest"
);
puts
(
"prepare-test : mrbgemtest.ctmp"
);
puts
(
"
\t
@./mrbtest"
);
puts
(
""
);
puts
(
""
);
puts
(
"mrb
test : driver.o mrbtest.o
"
);
puts
(
"mrb
gemtest.ctmp : mrbgemtest.rbtmp
"
);
puts
(
"
\t
$(CC) $(CFLAGS) -o ./mrbtest ./mrbtest.o ../../lib/libmruby.a ./driver.o
"
);
puts
(
"
\t
../../bin/mrbc -Bmrbgemtest_irep -omrbgemtest.ctmp mrbgemtest.rbtmp
"
);
puts
(
""
);
puts
(
""
);
puts
(
"driver.o : ../../test/driver.c"
);
puts
(
"mrbgemtest.rbtmp :"
);
puts
(
"
\t
$(CC) $(CFLAGS) -o $@ -c $<"
);
for_each_gem
(
" "
,
"/test/*.rb "
,
"
\t
cat"
,
" > mrbgemtest.rbtmp"
,
""
);
puts
(
""
);
puts
(
"mrbtest.o : mrbtest.c"
);
puts
(
""
);
puts
(
"mrbtest.c : mrbtest.ctmp"
);
puts
(
"
\t
cat ../../test/init_mrbtest.c mrbtest.ctmp > mrbtest.c"
);
puts
(
""
);
puts
(
"mrbtest.ctmp : mrbtest.rbtmp"
);
puts
(
"
\t
../../bin/mrbc -Bmrbtest_irep -omrbtest.ctmp mrbtest.rbtmp"
);
puts
(
""
);
puts
(
"mrbtest.rbtmp :"
);
for_each_gem
(
""
,
"/test/*.rb "
,
"
\t
cat ../../test/assert.rb "
,
"> mrbtest.rbtmp"
,
""
);
puts
(
""
);
puts
(
""
);
puts
(
".PHONY : clean"
);
puts
(
".PHONY : clean"
);
...
...
test/Makefile
View file @
0e7d5a2e
...
@@ -68,13 +68,16 @@ $(OBJS) : %.o : %.c
...
@@ -68,13 +68,16 @@ $(OBJS) : %.o : %.c
$(CC)
$(ALL_CFLAGS)
-MMD
$(INCLUDES)
-c
$<
-o
$@
$(CC)
$(ALL_CFLAGS)
-MMD
$(INCLUDES)
-c
$<
-o
$@
# Compile C source from merged mruby source
# Compile C source from merged mruby source
$(CLIB)
:
$(RLIB) $(MRBC) $(INIT)
$(CLIB)
:
../mrbgems/g/mrbgemtest.ctmp
$(RLIB) $(MRBC) $(INIT)
$(MRBC)
-Bmrbtest_irep
-o
$(DLIB)
$(RLIB)
;
$(CAT)
$(INIT)
$(DLIB)
>
$@
$(MRBC)
-Bmrbtest_irep
-o
$(DLIB)
$(RLIB)
;
$(CAT)
$(INIT)
$(DLIB)
../mrbgems/g/mrbgemtest.ctmp
>
$@
# merge mruby sources
# merge mruby sources
$(RLIB)
:
$(ASSLIB) $(MRBS)
$(RLIB)
:
$(ASSLIB) $(MRBS)
$(CAT)
$(ASSLIB)
$(MRBS)
>
$@
$(CAT)
$(ASSLIB)
$(MRBS)
>
$@
../mrbgems/g/mrbgemtest.ctmp
:
@
$(MAKE)
prepare-test
-C
../mrbgems
# clean up
# clean up
.PHONY
:
clean
.PHONY
:
clean
clean
:
clean
:
...
...
test/init_mrbtest.c
View file @
0e7d5a2e
...
@@ -5,13 +5,16 @@
...
@@ -5,13 +5,16 @@
#include "mruby/proc.h"
#include "mruby/proc.h"
extern
const
char
mrbtest_irep
[];
extern
const
char
mrbtest_irep
[];
extern
const
char
mrbgemtest_irep
[];
void
void
mrb_init_mrbtest
(
mrb_state
*
mrb
)
mrb_init_mrbtest
(
mrb_state
*
mrb
)
{
{
int
n
=
mrb_read_irep
(
mrb
,
mrbtest_irep
);
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
[
n
]),
mrb_top_self
(
mrb
));
mrb_run
(
mrb
,
mrb_proc_new
(
mrb
,
mrb
->
irep
[
m
]),
mrb_top_self
(
mrb
));
if
(
mrb
->
exc
)
{
if
(
mrb
->
exc
)
{
mrb_p
(
mrb
,
mrb_obj_value
(
mrb
->
exc
));
mrb_p
(
mrb
,
mrb_obj_value
(
mrb
->
exc
));
exit
(
0
);
exit
(
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment