some test files added
This commit is contained in:
parent
868f8f8af7
commit
a4ba67dd2e
5 changed files with 116 additions and 0 deletions
6
tests/tdeprecated.nim
Executable file
6
tests/tdeprecated.nim
Executable file
|
|
@ -0,0 +1,6 @@
|
||||||
|
var
|
||||||
|
a {.deprecated.}: array[0..11, int]
|
||||||
|
|
||||||
|
a[8] = 1
|
||||||
|
|
||||||
|
|
||||||
16
tests/tnewlibs.cfg
Executable file
16
tests/tnewlibs.cfg
Executable file
|
|
@ -0,0 +1,16 @@
|
||||||
|
path="$lib/pure"
|
||||||
|
path="$lib/impure"
|
||||||
|
path="$lib/newwrap"
|
||||||
|
path="$lib/newwrap/cairo"
|
||||||
|
path="$lib/newwrap/gtk"
|
||||||
|
path="$lib/newwrap/lua"
|
||||||
|
path="$lib/newwrap/opengl"
|
||||||
|
path="$lib/newwrap/pcre"
|
||||||
|
path="$lib/newwrap/sdl"
|
||||||
|
path="$lib/newwrap/x11"
|
||||||
|
path="$lib/newwrap/zip"
|
||||||
|
path="$lib/wrappers/x11"
|
||||||
|
path="$lib/windows"
|
||||||
|
path="$lib/posix"
|
||||||
|
path="$lib/ecmas"
|
||||||
|
|
||||||
19
tests/tnewlibs.nim
Executable file
19
tests/tnewlibs.nim
Executable file
|
|
@ -0,0 +1,19 @@
|
||||||
|
# Test wether the bindings at least compile...
|
||||||
|
|
||||||
|
import
|
||||||
|
unicode, cgi, terminal, libcurl,
|
||||||
|
parsexml, parseopt, parsecfg,
|
||||||
|
osproc,
|
||||||
|
cairowin32, cairoxlib,
|
||||||
|
gl, glut, glu, glx, glext, wingl,
|
||||||
|
lua, lualib, lauxlib, mysql, sqlite3, python, tcl,
|
||||||
|
sdl, smpeg, sdl_gfx, sdl_net, sdl_mixer, sdl_ttf,
|
||||||
|
sdl_image, sdl_mixer_nosmpeg,
|
||||||
|
gtk2, glib2, pango, gdk2
|
||||||
|
|
||||||
|
|
||||||
|
when defined(linux):
|
||||||
|
import
|
||||||
|
zlib, zipfiles
|
||||||
|
|
||||||
|
writeln(stdout, "test compilation of binding modules")
|
||||||
11
tests/topenarrayrepr.nim
Executable file
11
tests/topenarrayrepr.nim
Executable file
|
|
@ -0,0 +1,11 @@
|
||||||
|
type
|
||||||
|
TProc = proc (n: int, m: openarray[int64])
|
||||||
|
|
||||||
|
proc Foo(x: int, P: TProc) =
|
||||||
|
P(x, [ 1'i64 ])
|
||||||
|
|
||||||
|
proc Bar(n: int, m: openarray[int64]) =
|
||||||
|
echo($n & " - " & repr(m))
|
||||||
|
|
||||||
|
Foo(5, Bar) #OUT 5 - [1]
|
||||||
|
|
||||||
64
tools/noprefix.nim
Executable file
64
tools/noprefix.nim
Executable file
|
|
@ -0,0 +1,64 @@
|
||||||
|
# strip those silly GTK/ATK prefixes...
|
||||||
|
|
||||||
|
import
|
||||||
|
expandimportc, os
|
||||||
|
|
||||||
|
const
|
||||||
|
filelist = [
|
||||||
|
("sdl/sdl", "sdl"),
|
||||||
|
("sdl/sdl_net", "sdl"),
|
||||||
|
("sdl/sdl_gfx", "sdl"),
|
||||||
|
("sdl/sdl_image", "sdl"),
|
||||||
|
("sdl/sdl_mixer_nosmpeg", "sdl"),
|
||||||
|
("sdl/sdl_mixer", "sdl"),
|
||||||
|
("sdl/sdl_ttf", "sdl"),
|
||||||
|
("sdl/smpeg", "sdl"),
|
||||||
|
|
||||||
|
("libcurl", "curl"),
|
||||||
|
("mysql", "mysql"),
|
||||||
|
("postgres", ""),
|
||||||
|
("sqlite3", "sqlite3"),
|
||||||
|
("tcl", "tcl"),
|
||||||
|
("cairo/cairo", "cairo"),
|
||||||
|
("cairo/cairoft", "cairo"),
|
||||||
|
("cairo/cairowin32", "cairo"),
|
||||||
|
("cairo/cairoxlib", "cairo"),
|
||||||
|
|
||||||
|
("gtk/atk", "atk"),
|
||||||
|
("gtk/gdk2", "gdk"),
|
||||||
|
("gtk/gdk2pixbuf", "gdk"),
|
||||||
|
("gtk/gdkglext", "gdk"),
|
||||||
|
("gtk/glib2", ""),
|
||||||
|
("gtk/gtk2", "gtk"),
|
||||||
|
("gtk/gtkglext", "gtk"),
|
||||||
|
("gtk/gtkhtml", "gtk"),
|
||||||
|
("gtk/libglade2", "glade"),
|
||||||
|
("gtk/pango", "pango"),
|
||||||
|
("gtk/pangoutils", "pango"),
|
||||||
|
|
||||||
|
("lua/lua", "lua"),
|
||||||
|
("lua/lauxlib", "luaL"),
|
||||||
|
("lua/lualib", "lua"),
|
||||||
|
|
||||||
|
("opengl/gl", ""),
|
||||||
|
("opengl/glext", ""),
|
||||||
|
("opengl/wingl", ""),
|
||||||
|
("opengl/glu", ""),
|
||||||
|
("opengl/glut", ""),
|
||||||
|
("opengl/glx", ""),
|
||||||
|
|
||||||
|
("pcre/pcre", "pcre")
|
||||||
|
]
|
||||||
|
|
||||||
|
proc createDirs =
|
||||||
|
createDir("lib/newwrap/sdl")
|
||||||
|
createDir("lib/newwrap/cairo")
|
||||||
|
createDir("lib/newwrap/gtk")
|
||||||
|
createDir("lib/newwrap/lua")
|
||||||
|
createDir("lib/newwrap/opengl")
|
||||||
|
createDir("lib/newwrap/pcre")
|
||||||
|
|
||||||
|
for filename, prefix in items(filelist):
|
||||||
|
var f = addFileExt(filename, "nim")
|
||||||
|
main("lib/wrappers" / f, "lib/newwrap" / f, prefix)
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue