summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <andreas@andreas-desktop>2010-01-08 00:31:57 +0100
committerAndreas Rumpf <andreas@andreas-desktop>2010-01-08 00:31:57 +0100
commita4ba67dd2eb335cb9c41a6a267b774a4830ea529 (patch)
tree3dbd567916a40639f8e241816d37080eca2834ba
parent868f8f8af7b2813a2ff95d5bf58ae918d3e4bfa3 (diff)
downloadNim-a4ba67dd2eb335cb9c41a6a267b774a4830ea529.tar.gz
some test files added
-rwxr-xr-xtests/tdeprecated.nim6
-rwxr-xr-xtests/tnewlibs.cfg16
-rwxr-xr-xtests/tnewlibs.nim19
-rwxr-xr-xtests/topenarrayrepr.nim11
-rwxr-xr-xtools/noprefix.nim64
5 files changed, 116 insertions, 0 deletions
diff --git a/tests/tdeprecated.nim b/tests/tdeprecated.nim
new file mode 100755
index 000000000..e287da3f9
--- /dev/null
+++ b/tests/tdeprecated.nim
@@ -0,0 +1,6 @@
+var
+  a {.deprecated.}: array[0..11, int]
+  
+a[8] = 1
+
+
diff --git a/tests/tnewlibs.cfg b/tests/tnewlibs.cfg
new file mode 100755
index 000000000..852209a36
--- /dev/null
+++ b/tests/tnewlibs.cfg
@@ -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"
+
diff --git a/tests/tnewlibs.nim b/tests/tnewlibs.nim
new file mode 100755
index 000000000..8c25a873a
--- /dev/null
+++ b/tests/tnewlibs.nim
@@ -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")
diff --git a/tests/topenarrayrepr.nim b/tests/topenarrayrepr.nim
new file mode 100755
index 000000000..7e976540f
--- /dev/null
+++ b/tests/topenarrayrepr.nim
@@ -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]
+
diff --git a/tools/noprefix.nim b/tools/noprefix.nim
new file mode 100755
index 000000000..e7ec26c56
--- /dev/null
+++ b/tools/noprefix.nim
@@ -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)
+