Check-in [a52e2db53b]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:added BlitzMax test to makefile
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:a52e2db53bac193a4ae0e0f626352be1d7d3f962c996e39272f14ef58a87e6d8
User & Date: grable 2018-11-01 19:24:50
Context
2018-11-02
16:27
added optional support for jimtcl varaccess, for better variables. though it requires a customized jimtcl check-in: 381dd22404 user: grable tags: trunk
2018-11-01
19:24
added BlitzMax test to makefile check-in: a52e2db53b user: grable tags: trunk
19:16
updated BlitzMax test check-in: 1c412155ba user: grable tags: trunk
Changes

Changes to Makefile.

15
16
17
18
19
20
21
22
23
24
25
26
27
28






29
30
31
32
33
34
35
36
37
				strrpbrk.c

all: jimff.so test_lib.dll

jimff.so: $(JIMFF_H) $(JIMFF_C)
	$(CC) $(CFLAGS) $(INCLUDE) -Ofast -DNDEBUG -w $(LIB) $(LIBJIM) -shared -DJIMFF_DLL jimff.c $(LIBS) -o jimff.so

test_lib.dll: tests/test_lib.c
	$(CC) $(CFLAGS) -Os -s -DNDEBUG -shared tests/test_lib.c -o test_lib.dll

debug: $(JIMFF_H) $(JIMFF_C) tests/test_lib.c
	$(CC) $(CFLAGS) $(INCLUDE) -Og -g $(LIB) $(LIBJIM) -shared -DJIMFF_DLL jimff.c $(LIBS) -o jimff.so
	$(CC) $(CFLAGS) -Og -g -shared tests/test_lib.c -o test_lib.dll
	






test: jimff.so test_lib.dll
ifneq (,$(wildcard jimff_test.tcl))
	jimsh jimff_test.tcl
else
	jimsh tests/jimff_init.tcl
endif
	
clean:
	rm -rf test_lib.dll jimff.so







<
<
<



|
>
>
>
>
>
>
|







|
15
16
17
18
19
20
21



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
				strrpbrk.c

all: jimff.so test_lib.dll

jimff.so: $(JIMFF_H) $(JIMFF_C)
	$(CC) $(CFLAGS) $(INCLUDE) -Ofast -DNDEBUG -w $(LIB) $(LIBJIM) -shared -DJIMFF_DLL jimff.c $(LIBS) -o jimff.so




debug: $(JIMFF_H) $(JIMFF_C) tests/test_lib.c
	$(CC) $(CFLAGS) $(INCLUDE) -Og -g $(LIB) $(LIBJIM) -shared -DJIMFF_DLL jimff.c $(LIBS) -o jimff.so
	$(CC) $(CFLAGS) -Og -g -shared tests/test_lib.c -o test_lib.dll

test_lib.dll: tests/test_lib.c
	$(CC) $(CFLAGS) -Os -s -DNDEBUG -shared tests/test_lib.c -o test_lib.dll

jimff_test.exe: jimff.bmx tests/jimff_test.bmx
	bmk makeapp -r -t console -o jimff_test.exe tests/jimff_test.bmx

test: jimff.so test_lib.dll jimff_test.exe
ifneq (,$(wildcard jimff_test.tcl))
	jimsh jimff_test.tcl
else
	jimsh tests/jimff_init.tcl
endif
	
clean:
	rm -rf test_lib.dll jimff.so jimff_test.exe

Changes to tests/jimff_test.bmx.

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
..
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Import BRL.Retro

SuperStrict

'#RUN: makedef -x jimff_test.bmx
Import "jimff_test.s"

Import "jimff.bmx"

'
' testing jimff package
'
Local jim:TJimInterp = Jim_CreateInterp()
Jim_RegisterCoreCommands jim
Jim_InitStaticExtensions jim
................................................................................

eval jim, "proc test_1 {i s f} { puts ~q\ti=$i\n\tz=\~q$s\~q\n\tf=$f~q; expr $i + 1 }"

' run callback through C function
eval jim, "jimff ff"
eval jim, "ff::load test_lib.dll"
eval jim, "ff::import test_callback vzx(iizd)"
eval jim, "set cb [ff::callback test_1 iizd]"	;# note 'd' instead of 'f' since C promotes to double when uncertain
eval jim, "test_callback message $cb"
eval jim, "ff::free"

' run callback through BlitzMax function
eval jim, "jimff ff"
eval jim, "ff::load -self"
eval jim, "ff::import test_cb vzx(iizf)"
eval jim, "set cb [ff::callback test_1 iizf]"		;# note the 'f' instead of 'd' since BlitzMax does float when it says it will
eval jim, "test_cb message $cb"
eval jim, "ff::free"

' same as "test_lib.dll/test_callback"
Function test_cb( msg:Byte Ptr, cb:Int( i:Int, z$z, f:Float)) 'DLLEXPORT
	Print "begin test_cb " + String.FromCString(msg)
	Print "result=" + cb( 1, "2", 3.0)







|







 







|







|







3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
..
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Import BRL.Retro

SuperStrict

'#RUN: makedef -x jimff_test.bmx
Import "jimff_test.s"

Import "../jimff.bmx"

'
' testing jimff package
'
Local jim:TJimInterp = Jim_CreateInterp()
Jim_RegisterCoreCommands jim
Jim_InitStaticExtensions jim
................................................................................

eval jim, "proc test_1 {i s f} { puts ~q\ti=$i\n\tz=\~q$s\~q\n\tf=$f~q; expr $i + 1 }"

' run callback through C function
eval jim, "jimff ff"
eval jim, "ff::load test_lib.dll"
eval jim, "ff::import test_callback vzx(iizd)"
eval jim, "set cb [ff::callback test_1 iizd]"	' note 'd' instead of 'f' since C promotes to double when uncertain
eval jim, "test_callback message $cb"
eval jim, "ff::free"

' run callback through BlitzMax function
eval jim, "jimff ff"
eval jim, "ff::load -self"
eval jim, "ff::import test_cb vzx(iizf)"
eval jim, "set cb [ff::callback test_1 iizf]"		' note the 'f' instead of 'd' since BlitzMax does float when it says it will
eval jim, "test_cb message $cb"
eval jim, "ff::free"

' same as "test_lib.dll/test_callback"
Function test_cb( msg:Byte Ptr, cb:Int( i:Int, z$z, f:Float)) 'DLLEXPORT
	Print "begin test_cb " + String.FromCString(msg)
	Print "result=" + cb( 1, "2", 3.0)