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
8085817c
Commit
8085817c
authored
May 14, 2012
by
Yukihiro Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make test restructuring
parent
0c6ff97b
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
63 additions
and
113 deletions
+63
-113
Makefile
Makefile
+3
-5
test/Makefile
test/Makefile
+50
-15
test/driver.c
test/driver.c
+7
-7
test/init_mrbtest.c
test/init_mrbtest.c
+3
-4
test/t/_assert.rb
test/t/_assert.rb
+0
-0
test/t/array.rb
test/t/array.rb
+0
-0
test/t/time.rb
test/t/time.rb
+0
-0
tools/mrit/Makefile
tools/mrit/Makefile
+0
-82
No files found.
Makefile
View file @
8085817c
...
...
@@ -27,11 +27,10 @@ all :
@
$(MAKE)
-C
tools/mruby
$(MAKE_FLAGS)
@
$(MAKE)
-C
tools/mirb
$(MAKE_FLAGS)
# mruby
iso
test
.PHONY
:
mri
t
mri
t
:
# mruby test
.PHONY
:
tes
t
tes
t
:
@
$(MAKE)
-C
test
$(MAKE_FLAGS)
@
$(MAKE)
-C
tools/mrit
$(MAKE_FLAGS)
# clean up
.PHONY
:
clean
...
...
@@ -39,5 +38,4 @@ clean :
@
$(MAKE)
clean
-C
src
$(MAKE_FLAGS)
@
$(MAKE)
clean
-C
tools/mruby
$(MAKE_FLAGS)
@
$(MAKE)
clean
-C
tools/mirb
$(MAKE_FLAGS)
@
$(MAKE)
clean
-C
tools/mrit
$(MAKE_FLAGS)
@
$(MAKE)
clean
-C
test
$(MAKE_FLAGS)
test/Makefile
View file @
8085817c
...
...
@@ -4,15 +4,16 @@
# project-specific macros
# extension of the executable-file is modifiable(.exe .out ...)
BASEDIR
=
.
TARGET
:=
mritlib
TARGET
:=
mrbtest
LIBR
:=
../lib/libmruby.a
MLIB
:=
$(TARGET)
.o
CLIB
:=
$(TARGET)
.c
INIT
:=
init_
$(TARGET)
.c
DLIB
:=
$(TARGET)
.ctmp
RLIB
:=
$(TARGET)
.rbtmp
DEPLIB
:=
$(TARGET)
.d
MRB1
:=
$(BASEDIR)
/
*
.rb
MRBS
:=
$(MRB1)
LIBR
:=
../lib/libmrit.a
DEPLIB
:=
$(TARGET)
.d driver.d
MRBS
:=
$(BASEDIR)
/t/
*
.rb
OBJS
:=
driver.o
$(MLIB)
# C compiler (gcc)
CC
=
gcc
...
...
@@ -32,28 +33,63 @@ else
MAKE_FLAGS
=
CC
=
'
$(CC)
'
LL
=
'
$(LL)
'
ALL_CFLAGS
=
'
$(ALL_CFLAGS)
'
endif
# mruby compiler
# mruby compiler
and test driver
ifeq
($(OS),Windows_NT)
MRBC
=
../bin/mrbc.exe
EXE
:=
$(TARGET)
.exe
else
MRBC
=
../bin/mrbc
EXE
:=
$(TARGET)
endif
# libraries, includes
LIBS
=
-lm
# compiler, linker (gcc)
CC
=
gcc
LL
=
gcc
YACC
=
bison
DEBUG_MODE
=
1
ifeq
($(DEBUG_MODE),1)
CFLAGS
=
-g
-O3
else
CFLAGS
=
-O3
endif
ALL_CFLAGS
=
-Wall
-Werror-implicit-function-declaration
$(CFLAGS)
ifeq
($(OS),Windows_NT)
MAKE_FLAGS
=
CC
=
$(CC)
LL
=
$(LL)
ALL_CFLAGS
=
"
$(ALL_CFLAGS)
"
else
MAKE_FLAGS
=
CC
=
'
$(CC)
'
LL
=
'
$(LL)
'
ALL_CFLAGS
=
'
$(ALL_CFLAGS)
'
endif
##############################
# generic build targets, rules
.PHONY
:
all
all
:
$(MRBC) $(MLIB)
$(AR)
r
$(LIBR)
$(MLIB)
all
:
$(LIBR) $(EXE)
@
echo
"make: built targets of
`
pwd
`
"
# Compile mrblib source
$(MLIB)
:
$(CLIB)
$(CC)
$(ALL_CFLAGS)
-MMD
$(INCLUDES)
-c
$(CLIB)
-o
$(MLIB)
.PHONY
:
test
all
:
$(LIBR) $(EXE)
./
$(EXE)
# executable constructed using linker from object files
$(EXE)
:
$(LIBR) $(OBJS)
$(LL)
-o
$@
$(CFLAGS)
$(OBJS)
$(LIBR)
$(LIBS)
-include
$(OBJS:.o=.d)
# objects compiled from source
$(OBJS)
:
%.o : %.c
$(CC)
$(ALL_CFLAGS)
-MMD
$(INCLUDES)
-c
$<
-o
$@
# C library compile
$(LIBR)
:
@
$(MAKE)
-C
$(BASEDIR)
$(MAKE_FLAGS)
# Compile C source from merged mruby source
$(CLIB)
:
$(RLIB) $(MRBC)
$(MRBC)
-Bmr
itlib_irep
-o
$(DLIB)
$(RLIB)
;
cat
init_
$(TARGET)
.c
$(DLIB)
>
$@
$(CLIB)
:
$(RLIB) $(MRBC)
$(INIT)
$(MRBC)
-Bmr
btest_irep
-o
$(DLIB)
$(RLIB)
;
cat
$(INIT)
$(DLIB)
>
$@
$(MRBC)
:
../src/opcode.h ../src/codegen.c ../src/parse.y
$(MAKE)
-C
../tools/mrbc
$(MAKE_FLAGS)
...
...
@@ -66,5 +102,4 @@ $(RLIB) : $(MRBS)
.PHONY
:
clean
clean
:
@
echo
"make: removing targets, objects and depend files of
`
pwd
`
"
-
rm
-f
$(MRBC)
$(MLIB)
$(CLIB)
$(RLIB)
$(DLIB)
$(DEPLIB)
$(LIBR)
-
rm
-f
$(MRBC)
$(MLIB)
$(CLIB)
$(RLIB)
$(DLIB)
$(DEPLIB)
$(OBJS)
$(EXE)
t
ools/mrit/mrit
.c
→
t
est/driver
.c
View file @
8085817c
/*
** mr
it - Embeddable Ruby ISO Test
** mr
btest - Test for Embeddable Ruby
**
** This program
verifies ISO/IEC 30170:2012
** This program
runs Ruby test programs in test/t directory
** against the current mruby implementation.
*/
...
...
@@ -13,12 +13,12 @@
#include <compile.h>
void
mrb_init_mr
itlib
(
mrb_state
*
);
mrb_init_mr
btest
(
mrb_state
*
);
/* Print a short remark for the user */
void
print_hint
(
void
)
{
printf
(
"mr
it - Embeddable Ruby ISO
Test
\n
"
);
printf
(
"mr
btest - Embeddable Ruby
Test
\n
"
);
printf
(
"
\n
This is a very early version, please test and report errors.
\n
"
);
printf
(
"Thanks :)
\n\n
"
);
}
...
...
@@ -35,7 +35,7 @@ main(void)
/* new interpreter instance */
mrb_interpreter
=
mrb_open
();
mrb_init_mr
itlib
(
mrb_interpreter
);
mrb_init_mr
btest
(
mrb_interpreter
);
parser
=
mrb_parse_nstring_ext
(
mrb_interpreter
,
"report()"
,
strlen
(
"report()"
));
/* generate bytecode */
...
...
@@ -48,7 +48,7 @@ main(void)
mrb_top_self
(
mrb_interpreter
));
/* did an exception occur? */
if
(
mrb_interpreter
->
exc
)
{
mrb_p
(
mrb_interpreter
,
mrb_
obj_value
(
mrb_interpreter
->
exc
)
);
mrb_p
(
mrb_interpreter
,
mrb_
return_value
);
mrb_interpreter
->
exc
=
0
;
}
else
{
...
...
test/init_mr
itlib
.c
→
test/init_mr
btest
.c
View file @
8085817c
...
...
@@ -4,14 +4,13 @@
#include "mruby/string.h"
#include "mruby/proc.h"
extern
const
char
mr
itlib
_irep
[];
extern
const
char
mr
btest
_irep
[];
void
mrb_init_mr
itlib
(
mrb_state
*
mrb
)
mrb_init_mr
btest
(
mrb_state
*
mrb
)
{
int
n
=
mrb_read_irep
(
mrb
,
mr
itlib
_irep
);
int
n
=
mrb_read_irep
(
mrb
,
mr
btest
_irep
);
extern
mrb_value
mrb_top_self
(
mrb_state
*
mrb
);
mrb_run
(
mrb
,
mrb_proc_new
(
mrb
,
mrb
->
irep
[
n
]),
mrb_top_self
(
mrb
));
}
test/_assert.rb
→
test/
t/
_assert.rb
View file @
8085817c
File moved
test/array.rb
→
test/
t/
array.rb
View file @
8085817c
File moved
test/time.rb
→
test/t
/t
ime.rb
View file @
8085817c
File moved
tools/mrit/Makefile
deleted
100644 → 0
View file @
0c6ff97b
# makefile discription.
# basic build file for mrit executable
# project-specific macros
# extension of the executable-file is modifiable(.exe .out ...)
BASEDIR
=
../../src
TARGET
:=
../../bin/mrit
LIBR
:=
../../lib/libmruby.a
LIBRIT
:=
../../lib/libmrit.a
ifeq
($(OS),Windows_NT)
EXE
:=
$(TARGET)
.exe
else
EXE
:=
$(TARGET)
endif
OBJ0
:=
$(
patsubst
%.c,%.o,
$(
wildcard
$(BASEDIR)
/../tools/mrit/
*
.c
))
#OBJ1 := $(patsubst %.c,%.o,$(filter-out $(EXCEPT1),$(wildcard $(BASEDIR)/*.c)))
#OBJ2 := $(patsubst %.c,%.o,$(wildcard $(BASEDIR)/ext/regex/*.c))
#OBJ3 := $(patsubst %.c,%.o,$(wildcard $(BASEDIR)/ext/enc/*.c))
OBJS
:=
$(OBJ0)
# ext libraries
#EXT1 := $(patsubst %.c,%.o,$(wildcard $(BASEDIR)/../ext/socket/*.c))
EXTS
:=
$(EXT1)
# libraries, includes
LIBS
=
-lm
INCLUDES
=
-I
$(BASEDIR)
-I
$(BASEDIR)
/../include
# compiler, linker (gcc)
CC
=
gcc
LL
=
gcc
YACC
=
bison
DEBUG_MODE
=
1
ifeq
($(DEBUG_MODE),1)
CFLAGS
=
-g
-O3
else
CFLAGS
=
-O3
endif
ALL_CFLAGS
=
-Wall
-Werror-implicit-function-declaration
$(CFLAGS)
ifeq
($(OS),Windows_NT)
MAKE_FLAGS
=
CC
=
$(CC)
LL
=
$(LL)
ALL_CFLAGS
=
"
$(ALL_CFLAGS)
"
else
MAKE_FLAGS
=
CC
=
'
$(CC)
'
LL
=
'
$(LL)
'
ALL_CFLAGS
=
'
$(ALL_CFLAGS)
'
endif
##############################
# generic build targets, rules
.PHONY
:
all
all
:
$(LIBRIT) $(LIBR) $(EXE)
@
echo
"make: built targets of
`
pwd
`
"
# executable constructed using linker from object files
$(EXE)
:
$(LIBRIT) $(LIBR) $(OBJS) $(EXTS)
$(LL)
-o
$@
$(CFLAGS)
$(OBJS)
$(LIBRIT)
$(LIBR)
$(EXTS)
$(LIBS)
-include
$(OBJS:.o=.d)
# objects compiled from source
$(OBJS)
:
%.o : %.c
$(CC)
$(ALL_CFLAGS)
-MMD
$(INCLUDES)
-c
$<
-o
$@
# C library compile
$(LIBR)
:
@
$(MAKE)
-C
$(BASEDIR)
$(MAKE_FLAGS)
$(LIBRIT)
:
@
$(MAKE)
-C
$(BASEDIR)
$(MAKE_FLAGS)
# mrit library compile
# extend libraries complile
$(EXTS)
:
%.o : %.c
$(CC)
$(ALL_CFLAGS)
-MMD
$(INCLUDES)
-c
$<
-o
$@
# clean up
.PHONY
:
clean
#
cleandep
clean
:
$(MAKE)
clean
-C
../../test
$(MAKE_FLAGS)
$(MAKE)
clean
-C
../../mrblib
$(MAKE_FLAGS)
$(MAKE)
clean
-C
../mrbc
$(MAKE_FLAGS)
@
echo
"make: removing targets, objects and depend files of
`
pwd
`
"
-
rm
-f
$(EXE)
$(OBJS)
-
rm
-f
$(OBJS:.o=.d)
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