From d913fdb2800d83680e413cd8a5f07b7f85deac6e Mon Sep 17 00:00:00 2001 From: "rumpf_a@web.de" <> Date: Sun, 21 Feb 2010 19:42:36 +0100 Subject: [PATCH] start of tests refactoring; sqlite3 new wrapper fixes --- lib/newwrap/sqlite3.nim | 64 +++---- lib/pure/times.nim | 6 +- tests/{ => accept/compile}/tarrindx.nim | 0 tests/{ => accept/compile}/tassign.nim | 0 tests/{ => accept/compile}/tcmdline.nim | 0 tests/{ => accept/compile}/tcolors.nim | 0 tests/{ => accept/compile}/tconsteval.nim | 0 tests/{ => accept/compile}/tconvert.nim | 0 tests/{ => accept/compile}/tdeprecated.nim | 0 tests/{ => accept/compile}/tdialogs.nim | 0 tests/{ => accept/compile}/tdllvar.nim | 0 tests/{ => accept/compile}/tdumpast.nim | 0 tests/{ => accept/compile}/techo.nim | 0 tests/{ => accept/compile}/tendian.nim | 0 tests/{ => accept/compile}/tenum.nim | 0 tests/{ => accept/compile}/tforwty.nim | 0 tests/{ => accept/compile}/tforwty2.nim | 0 tests/{ => accept/compile}/tgtk.nim | 0 tests/{ => accept/compile}/thallo.nim | 0 tests/{ => accept/compile}/tident.nim | 0 tests/{ => accept/compile}/tindent1.nim | 0 tests/{ => accept/compile}/tio.nim | 0 tests/{ => accept/compile}/titer.nim | 0 tests/{ => accept/compile}/tlastmod.nim | 0 .../compile/tlexer.nim} | 5 - tests/{ => accept/compile}/tlibs.nim | 0 tests/{ => accept/compile}/tloops.nim | 0 tests/{ => accept/compile}/tmath.nim | 0 tests/{ => accept/compile}/tnew.nim | 0 tests/{ => accept/compile}/tnewlibs.nim | 0 tests/{ => accept/compile}/tnewsets.nim | 0 tests/{ => accept/compile}/tnewuns.nim | 0 tests/{ => accept/compile}/tobjcov.nim | 0 tests/{ => accept/compile}/tobject2.nim | 0 tests/{ => accept/compile}/tobjects.nim | 0 tests/{ => accept/compile}/toptions.nim | 0 tests/{ => accept/compile}/tos.nim | 0 tests/{ => accept/compile}/toverprc.nim | 0 tests/{ => accept/compile}/tparedef.nim | 0 tests/{ => accept/compile}/tparscfg.nim | 0 tests/{ => accept/compile}/tparsefloat.nim | 0 tests/{ => accept/compile}/tparsopt.nim | 0 tests/{ => accept/compile}/tposix.nim | 0 tests/{ => accept/compile}/tprep.nim | 0 tests/{ => accept/compile}/tpush.nim | 0 tests/{ => accept/compile}/tquicksort.nim | 0 tests/{ => accept/compile}/tquit.nim | 0 tests/{ => accept/compile}/tradix.nim | 0 tests/{ => accept/compile}/treadln.nim | 0 tests/{ => accept/compile}/treadx.nim | 0 tests/{ => accept/compile}/trecmod.nim | 0 tests/{ => accept/compile}/trecmod2.nim | 0 tests/{ => accept/compile}/trepr.nim | 0 tests/{ => accept/compile}/tseq2.nim | 0 tests/{ => accept/compile}/tseqcon2.nim | 0 tests/{ => accept/compile}/tsizeof.nim | 0 tests/{ => accept/compile}/tsockets.nim | 0 tests/{ => accept/compile}/tstrace.nim | 0 tests/{ => accept/compile}/tstrdesc.nim | 0 tests/{ => accept/compile}/tstrdist.nim | 0 tests/{ => accept/compile}/tstreams.nim | 0 tests/{ => accept/compile}/tstrset.nim | 0 tests/{ => accept/compile}/tstrtabs.nim | 0 tests/{ => accept/compile}/ttempl.nim | 0 tests/{ => accept/compile}/ttempl3.nim | 0 tests/{ => accept/compile}/ttime.nim | 0 tests/{ => accept/compile}/ttuple1.nim | 0 tests/{ => accept/compile}/tvarious.nim | 0 tests/{ => accept/compile}/twalker.nim | 0 tests/{ => accept/compile}/typalias.nim | 0 tests/{ => accept/run}/tack.nim | 0 tests/{ => accept/run}/tambsym2.nim | 0 tests/{ => accept/run}/tambsys.nim | 0 tests/{ => accept/run}/tarray.nim | 0 tests/{ => accept/run}/tarray2.nim | 0 tests/{ => accept/run}/tassert.nim | 0 tests/{ => accept/run}/tbind1.nim | 0 tests/{ => accept/run}/tbind3.nim | 0 tests/{ => accept/run}/tbintre2.nim | 0 tests/{ => accept/run}/tbintree.nim | 0 tests/{ => accept/run}/tcasestm.nim | 0 tests/{ => accept/run}/tclosure.nim | 0 tests/{ => accept/run}/tcnstseq.nim | 0 tests/{ => accept/run}/tconstr2.nim | 0 tests/{ => accept/run}/tcopy.nim | 0 tests/{ => accept/run}/tcurrncy.nim | 0 tests/{ => accept/run}/tfinally.nim | 0 tests/{ => accept/run}/tfloat1.nim | 0 tests/{ => accept/run}/tfloat2.nim | 0 tests/{ => accept/run}/tformat.nim | 0 tests/{ => accept/run}/thintoff.nim | 0 tests/{ => accept/run}/tinit.nim | 0 tests/{ => accept/run}/tints.nim | 0 tests/{ => accept/run}/tisopr.nim | 0 tests/{ => accept/run}/titer2.nim | 0 tests/{ => accept/run}/titer3.nim | 0 tests/{ => accept/run}/titer5.nim | 0 tests/{ => accept/run}/tlowhigh.nim | 0 tests/{ => accept/run}/tmatrix.nim | 0 tests/{ => accept/run}/tmultim1.nim | 0 tests/{ => accept/run}/tmultim2.nim | 0 tests/{ => accept/run}/tnestif.nim | 0 tests/{ => accept/run}/tnestprc.nim | 0 tests/{ => accept/run}/toop1.nim | 0 tests/{ => accept/run}/topenarrayrepr.nim | 0 tests/{ => accept/run}/topenlen.nim | 0 tests/{ => accept/run}/toverflw.nim | 0 tests/{ => accept/run}/toverl2.nim | 0 tests/{ => accept/run}/toverlop.nim | 0 tests/{ => accept/run}/toverwr.nim | 0 tests/{ => accept/run}/tovfint.nim | 0 tests/{ => accept/run}/tpos.nim | 0 tests/{ => accept/run}/tprintf.nim | 0 tests/{ => accept/run}/tprocvar.nim | 0 tests/{ => accept/run}/tquotewords.nim | 0 tests/{ => accept/run}/tregex.nim | 0 tests/{ => accept/run}/treguse.nim | 0 tests/{ => accept/run}/tromans.nim | 0 tests/{ => accept/run}/tseqcon.nim | 0 tests/{ => accept/run}/tsets.nim | 0 tests/{ => accept/run}/tsidee2.nim | 0 tests/{ => accept/run}/tsidee3.nim | 0 tests/{ => accept/run}/tsimmeth.nim | 0 tests/{ => accept/run}/tsplit.nim | 0 tests/{ => accept/run}/tstrange.nim | 0 tests/{ => accept/run}/tstrlits.nim | 0 tests/{ => accept/run}/tstrutil.nim | 0 tests/{ => accept/run}/tvardecl.nim | 0 tests/{ => accept/run}/tvarnums.nim | 0 tests/{ => accept/run}/tvartup.nim | 0 tests/gc/gcbench.nim | 163 +++++++++++++++++ tests/{ => gc}/gctest.nim | 0 tests/gcbench.nim | 171 ------------------ tests/mbind3.nim | 9 - tests/mbind4.nim | 9 - tests/mvarious.nim | 6 - tests/{ => reject}/99bottles.nim | 0 tests/{ => reject}/t99bott.nim | 0 tests/{ => reject}/tadrdisc.nim | 0 tests/{ => reject}/tambsym.nim | 0 tests/{ => reject}/tambsym3.nim | 0 tests/{ => reject}/tbind2.nim | 0 tests/{ => reject}/tbind4.nim | 0 tests/{ => reject}/tblock1.nim | 0 tests/{ => reject}/tconstr1.nim | 0 tests/{ => reject}/tillrec.nim | 0 tests/{ => reject}/tinout.nim | 0 tests/{ => reject}/tinvalidnewseq.nim | 0 tests/{ => reject}/tinvwhen.nim | 0 tests/{ => reject}/titer4.nim | 0 tests/{ => reject}/tnamspc.nim | 0 tests/{ => reject}/tnoop.nim | 0 tests/{ => reject}/tnot.nim | 0 tests/{ => reject}/topaque.nim | 0 tests/{ => reject}/topena1.nim | 0 tests/{ => reject}/toverl.nim | 0 tests/{ => reject}/trawstr.nim | 0 tests/{ => reject}/trecinca.nim | 0 tests/{ => reject}/trecincb.nim | 0 tests/{ => reject}/treciter.nim | 0 tests/{ => reject}/trectype.nim | 0 tests/{ => reject}/trefs.nim | 0 tests/{ => reject}/tsidee1.nim | 0 tests/{ => reject}/tsidee4.nim | 0 tests/{ => reject}/tsimtych.nim | 0 tests/{ => reject}/tstatret.nim | 0 tests/{ => reject}/tstmtexp.nim | 0 tests/{ => reject}/ttempl2.nim | 0 tests/{ => reject}/tunderscores.nim | 0 tests/{ => reject}/typredef.nim | 0 tests/tester.nim | 4 +- tests/x11test.nim | 6 +- web/news.txt | 1 + 173 files changed, 206 insertions(+), 238 deletions(-) rename tests/{ => accept/compile}/tarrindx.nim (100%) rename tests/{ => accept/compile}/tassign.nim (100%) rename tests/{ => accept/compile}/tcmdline.nim (100%) rename tests/{ => accept/compile}/tcolors.nim (100%) rename tests/{ => accept/compile}/tconsteval.nim (100%) rename tests/{ => accept/compile}/tconvert.nim (100%) rename tests/{ => accept/compile}/tdeprecated.nim (100%) rename tests/{ => accept/compile}/tdialogs.nim (100%) rename tests/{ => accept/compile}/tdllvar.nim (100%) rename tests/{ => accept/compile}/tdumpast.nim (100%) rename tests/{ => accept/compile}/techo.nim (100%) rename tests/{ => accept/compile}/tendian.nim (100%) rename tests/{ => accept/compile}/tenum.nim (100%) rename tests/{ => accept/compile}/tforwty.nim (100%) rename tests/{ => accept/compile}/tforwty2.nim (100%) rename tests/{ => accept/compile}/tgtk.nim (100%) rename tests/{ => accept/compile}/thallo.nim (100%) rename tests/{ => accept/compile}/tident.nim (100%) rename tests/{ => accept/compile}/tindent1.nim (100%) rename tests/{ => accept/compile}/tio.nim (100%) rename tests/{ => accept/compile}/titer.nim (100%) rename tests/{ => accept/compile}/tlastmod.nim (100%) rename tests/{scantest.nim => accept/compile/tlexer.nim} (92%) rename tests/{ => accept/compile}/tlibs.nim (100%) rename tests/{ => accept/compile}/tloops.nim (100%) rename tests/{ => accept/compile}/tmath.nim (100%) rename tests/{ => accept/compile}/tnew.nim (100%) rename tests/{ => accept/compile}/tnewlibs.nim (100%) rename tests/{ => accept/compile}/tnewsets.nim (100%) rename tests/{ => accept/compile}/tnewuns.nim (100%) rename tests/{ => accept/compile}/tobjcov.nim (100%) rename tests/{ => accept/compile}/tobject2.nim (100%) rename tests/{ => accept/compile}/tobjects.nim (100%) rename tests/{ => accept/compile}/toptions.nim (100%) rename tests/{ => accept/compile}/tos.nim (100%) rename tests/{ => accept/compile}/toverprc.nim (100%) rename tests/{ => accept/compile}/tparedef.nim (100%) rename tests/{ => accept/compile}/tparscfg.nim (100%) rename tests/{ => accept/compile}/tparsefloat.nim (100%) rename tests/{ => accept/compile}/tparsopt.nim (100%) rename tests/{ => accept/compile}/tposix.nim (100%) rename tests/{ => accept/compile}/tprep.nim (100%) rename tests/{ => accept/compile}/tpush.nim (100%) rename tests/{ => accept/compile}/tquicksort.nim (100%) rename tests/{ => accept/compile}/tquit.nim (100%) rename tests/{ => accept/compile}/tradix.nim (100%) rename tests/{ => accept/compile}/treadln.nim (100%) rename tests/{ => accept/compile}/treadx.nim (100%) rename tests/{ => accept/compile}/trecmod.nim (100%) rename tests/{ => accept/compile}/trecmod2.nim (100%) rename tests/{ => accept/compile}/trepr.nim (100%) rename tests/{ => accept/compile}/tseq2.nim (100%) rename tests/{ => accept/compile}/tseqcon2.nim (100%) rename tests/{ => accept/compile}/tsizeof.nim (100%) rename tests/{ => accept/compile}/tsockets.nim (100%) rename tests/{ => accept/compile}/tstrace.nim (100%) rename tests/{ => accept/compile}/tstrdesc.nim (100%) rename tests/{ => accept/compile}/tstrdist.nim (100%) rename tests/{ => accept/compile}/tstreams.nim (100%) rename tests/{ => accept/compile}/tstrset.nim (100%) rename tests/{ => accept/compile}/tstrtabs.nim (100%) rename tests/{ => accept/compile}/ttempl.nim (100%) rename tests/{ => accept/compile}/ttempl3.nim (100%) rename tests/{ => accept/compile}/ttime.nim (100%) rename tests/{ => accept/compile}/ttuple1.nim (100%) rename tests/{ => accept/compile}/tvarious.nim (100%) rename tests/{ => accept/compile}/twalker.nim (100%) rename tests/{ => accept/compile}/typalias.nim (100%) rename tests/{ => accept/run}/tack.nim (100%) rename tests/{ => accept/run}/tambsym2.nim (100%) rename tests/{ => accept/run}/tambsys.nim (100%) rename tests/{ => accept/run}/tarray.nim (100%) rename tests/{ => accept/run}/tarray2.nim (100%) rename tests/{ => accept/run}/tassert.nim (100%) rename tests/{ => accept/run}/tbind1.nim (100%) rename tests/{ => accept/run}/tbind3.nim (100%) rename tests/{ => accept/run}/tbintre2.nim (100%) rename tests/{ => accept/run}/tbintree.nim (100%) rename tests/{ => accept/run}/tcasestm.nim (100%) rename tests/{ => accept/run}/tclosure.nim (100%) rename tests/{ => accept/run}/tcnstseq.nim (100%) rename tests/{ => accept/run}/tconstr2.nim (100%) rename tests/{ => accept/run}/tcopy.nim (100%) rename tests/{ => accept/run}/tcurrncy.nim (100%) rename tests/{ => accept/run}/tfinally.nim (100%) rename tests/{ => accept/run}/tfloat1.nim (100%) rename tests/{ => accept/run}/tfloat2.nim (100%) rename tests/{ => accept/run}/tformat.nim (100%) rename tests/{ => accept/run}/thintoff.nim (100%) rename tests/{ => accept/run}/tinit.nim (100%) rename tests/{ => accept/run}/tints.nim (100%) rename tests/{ => accept/run}/tisopr.nim (100%) rename tests/{ => accept/run}/titer2.nim (100%) rename tests/{ => accept/run}/titer3.nim (100%) rename tests/{ => accept/run}/titer5.nim (100%) rename tests/{ => accept/run}/tlowhigh.nim (100%) rename tests/{ => accept/run}/tmatrix.nim (100%) rename tests/{ => accept/run}/tmultim1.nim (100%) rename tests/{ => accept/run}/tmultim2.nim (100%) rename tests/{ => accept/run}/tnestif.nim (100%) rename tests/{ => accept/run}/tnestprc.nim (100%) rename tests/{ => accept/run}/toop1.nim (100%) rename tests/{ => accept/run}/topenarrayrepr.nim (100%) rename tests/{ => accept/run}/topenlen.nim (100%) rename tests/{ => accept/run}/toverflw.nim (100%) rename tests/{ => accept/run}/toverl2.nim (100%) rename tests/{ => accept/run}/toverlop.nim (100%) rename tests/{ => accept/run}/toverwr.nim (100%) rename tests/{ => accept/run}/tovfint.nim (100%) rename tests/{ => accept/run}/tpos.nim (100%) rename tests/{ => accept/run}/tprintf.nim (100%) rename tests/{ => accept/run}/tprocvar.nim (100%) rename tests/{ => accept/run}/tquotewords.nim (100%) rename tests/{ => accept/run}/tregex.nim (100%) rename tests/{ => accept/run}/treguse.nim (100%) rename tests/{ => accept/run}/tromans.nim (100%) rename tests/{ => accept/run}/tseqcon.nim (100%) rename tests/{ => accept/run}/tsets.nim (100%) rename tests/{ => accept/run}/tsidee2.nim (100%) rename tests/{ => accept/run}/tsidee3.nim (100%) rename tests/{ => accept/run}/tsimmeth.nim (100%) rename tests/{ => accept/run}/tsplit.nim (100%) rename tests/{ => accept/run}/tstrange.nim (100%) rename tests/{ => accept/run}/tstrlits.nim (100%) rename tests/{ => accept/run}/tstrutil.nim (100%) rename tests/{ => accept/run}/tvardecl.nim (100%) rename tests/{ => accept/run}/tvarnums.nim (100%) rename tests/{ => accept/run}/tvartup.nim (100%) create mode 100644 tests/gc/gcbench.nim rename tests/{ => gc}/gctest.nim (100%) delete mode 100644 tests/gcbench.nim delete mode 100644 tests/mbind3.nim delete mode 100644 tests/mbind4.nim delete mode 100644 tests/mvarious.nim rename tests/{ => reject}/99bottles.nim (100%) rename tests/{ => reject}/t99bott.nim (100%) rename tests/{ => reject}/tadrdisc.nim (100%) rename tests/{ => reject}/tambsym.nim (100%) rename tests/{ => reject}/tambsym3.nim (100%) rename tests/{ => reject}/tbind2.nim (100%) rename tests/{ => reject}/tbind4.nim (100%) rename tests/{ => reject}/tblock1.nim (100%) rename tests/{ => reject}/tconstr1.nim (100%) rename tests/{ => reject}/tillrec.nim (100%) rename tests/{ => reject}/tinout.nim (100%) rename tests/{ => reject}/tinvalidnewseq.nim (100%) rename tests/{ => reject}/tinvwhen.nim (100%) rename tests/{ => reject}/titer4.nim (100%) rename tests/{ => reject}/tnamspc.nim (100%) rename tests/{ => reject}/tnoop.nim (100%) rename tests/{ => reject}/tnot.nim (100%) rename tests/{ => reject}/topaque.nim (100%) rename tests/{ => reject}/topena1.nim (100%) rename tests/{ => reject}/toverl.nim (100%) rename tests/{ => reject}/trawstr.nim (100%) rename tests/{ => reject}/trecinca.nim (100%) rename tests/{ => reject}/trecincb.nim (100%) rename tests/{ => reject}/treciter.nim (100%) rename tests/{ => reject}/trectype.nim (100%) rename tests/{ => reject}/trefs.nim (100%) rename tests/{ => reject}/tsidee1.nim (100%) rename tests/{ => reject}/tsidee4.nim (100%) rename tests/{ => reject}/tsimtych.nim (100%) rename tests/{ => reject}/tstatret.nim (100%) rename tests/{ => reject}/tstmtexp.nim (100%) rename tests/{ => reject}/ttempl2.nim (100%) rename tests/{ => reject}/tunderscores.nim (100%) rename tests/{ => reject}/typredef.nim (100%) diff --git a/lib/newwrap/sqlite3.nim b/lib/newwrap/sqlite3.nim index f2912f05f6..23aaf091d2 100644 --- a/lib/newwrap/sqlite3.nim +++ b/lib/newwrap/sqlite3.nim @@ -1,7 +1,7 @@ # # # Nimrod's Runtime Library -# (c) Copyright 2009 Andreas Rumpf +# (c) Copyright 2010 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. @@ -17,13 +17,13 @@ elif defined(macosx): else: const Lib = "libsqlite3.so" + const SQLITE_INTEGER* = 1 SQLITE_FLOAT* = 2 SQLITE_BLOB* = 4 SQLITE_NULL* = 5 SQLITE_TEXT* = 3 - TEXT* = 3 SQLITE_UTF8* = 1 SQLITE_UTF16LE* = 2 SQLITE_UTF16BE* = 3 # Use native byte order @@ -98,9 +98,9 @@ const type sqlite_int64* = int64 PPPChar* = ptr ptr cstring - T{.pure, final.} = object - P* = ptr T - PPSqlite3* = ptr P + TSqlite3 {.pure, final.} = object + PSqlite3* = ptr TSqlite3 + PPSqlite3* = ptr PSqlite3 TSqlLite3Context{.pure, final.} = object Pcontext* = ptr TSqlLite3Context Tstmt{.pure, final.} = object @@ -124,30 +124,30 @@ type Tresult_func* = proc (para1: pointer){.cdecl.} Tcreate_collation_func* = proc (para1: pointer, para2: int32, para3: pointer, para4: int32, para5: pointer): int32{.cdecl.} - Tcollation_needed_func* = proc (para1: pointer, para2: P, eTextRep: int32, + Tcollation_needed_func* = proc (para1: pointer, para2: PSqlite3, eTextRep: int32, para4: cstring){.cdecl.} -proc close*(para1: P): int32{.cdecl, dynlib: Lib, importc: "sqlite3_close".} -proc exec*(para1: P, sql: cstring, para3: Tcallback, para4: pointer, +proc close*(para1: PSqlite3): int32{.cdecl, dynlib: Lib, importc: "sqlite3_close".} +proc exec*(para1: PSqlite3, sql: cstring, para3: Tcallback, para4: pointer, errmsg: var cstring): int32{.cdecl, dynlib: Lib, importc: "sqlite3_exec".} -proc last_insert_rowid*(para1: P): sqlite_int64{.cdecl, dynlib: Lib, +proc last_insert_rowid*(para1: PSqlite3): sqlite_int64{.cdecl, dynlib: Lib, importc: "sqlite3_last_insert_rowid".} -proc changes*(para1: P): int32{.cdecl, dynlib: Lib, importc: "sqlite3_changes".} -proc total_changes*(para1: P): int32{.cdecl, dynlib: Lib, +proc changes*(para1: PSqlite3): int32{.cdecl, dynlib: Lib, importc: "sqlite3_changes".} +proc total_changes*(para1: PSqlite3): int32{.cdecl, dynlib: Lib, importc: "sqlite3_total_changes".} -proc interrupt*(para1: P){.cdecl, dynlib: Lib, importc: "sqlite3_interrupt".} +proc interrupt*(para1: PSqlite3){.cdecl, dynlib: Lib, importc: "sqlite3_interrupt".} proc complete*(sql: cstring): int32{.cdecl, dynlib: Lib, importc: "sqlite3_complete".} proc complete16*(sql: pointer): int32{.cdecl, dynlib: Lib, importc: "sqlite3_complete16".} -proc busy_handler*(para1: P, +proc busy_handler*(para1: PSqlite3, para2: proc (para1: pointer, para2: int32): int32{.cdecl.}, para3: pointer): int32{.cdecl, dynlib: Lib, importc: "sqlite3_busy_handler".} -proc busy_timeout*(para1: P, ms: int32): int32{.cdecl, dynlib: Lib, +proc busy_timeout*(para1: PSqlite3, ms: int32): int32{.cdecl, dynlib: Lib, importc: "sqlite3_busy_timeout".} -proc get_table*(para1: P, sql: cstring, resultp: var cstringArray, +proc get_table*(para1: PSqlite3, sql: cstring, resultp: var cstringArray, nrow, ncolumn: var cint, errmsg: ptr cstring): int32{.cdecl, dynlib: Lib, importc: "sqlite3_get_table".} proc free_table*(result: cstringArray){.cdecl, dynlib: Lib, @@ -161,32 +161,32 @@ proc free*(z: cstring){.cdecl, dynlib: Lib, importc: "sqlite3_free".} #function sqlite3_snprintf(_para1:longint; _para2:Pchar; _para3:Pchar; args:array of const):Pchar;cdecl; external Sqlite3Lib name 'sqlite3_snprintf'; proc snprintf*(para1: int32, para2: cstring, para3: cstring): cstring{.cdecl, dynlib: Lib, varargs, importc: "sqlite3_snprintf".} -proc set_authorizer*(para1: P, xAuth: proc (para1: pointer, para2: int32, +proc set_authorizer*(para1: PSqlite3, xAuth: proc (para1: pointer, para2: int32, para3: cstring, para4: cstring, para5: cstring, para6: cstring): int32{. cdecl.}, pUserData: pointer): int32{.cdecl, dynlib: Lib, importc: "sqlite3_set_authorizer".} -proc trace*(para1: P, xTrace: proc (para1: pointer, para2: cstring){.cdecl.}, +proc trace*(para1: PSqlite3, xTrace: proc (para1: pointer, para2: cstring){.cdecl.}, para3: pointer): pointer{.cdecl, dynlib: Lib, importc: "sqlite3_trace".} -proc progress_handler*(para1: P, para2: int32, +proc progress_handler*(para1: PSqlite3, para2: int32, para3: proc (para1: pointer): int32{.cdecl.}, para4: pointer){.cdecl, dynlib: Lib, importc: "sqlite3_progress_handler".} -proc commit_hook*(para1: P, para2: proc (para1: pointer): int32{.cdecl.}, +proc commit_hook*(para1: PSqlite3, para2: proc (para1: pointer): int32{.cdecl.}, para3: pointer): pointer{.cdecl, dynlib: Lib, importc: "sqlite3_commit_hook".} -proc open*(filename: cstring, ppDb: var P): int32{.cdecl, dynlib: Lib, +proc open*(filename: cstring, ppDb: var PSqlite3): int32{.cdecl, dynlib: Lib, importc: "sqlite3_open".} -proc open16*(filename: pointer, ppDb: var P): int32{.cdecl, dynlib: Lib, +proc open16*(filename: pointer, ppDb: var PSqlite3): int32{.cdecl, dynlib: Lib, importc: "sqlite3_open16".} -proc errcode*(db: P): int32{.cdecl, dynlib: Lib, importc: "sqlite3_errcode".} -proc errmsg*(para1: P): cstring{.cdecl, dynlib: Lib, importc: "sqlite3_errmsg".} -proc errmsg16*(para1: P): pointer{.cdecl, dynlib: Lib, +proc errcode*(db: PSqlite3): int32{.cdecl, dynlib: Lib, importc: "sqlite3_errcode".} +proc errmsg*(para1: PSqlite3): cstring{.cdecl, dynlib: Lib, importc: "sqlite3_errmsg".} +proc errmsg16*(para1: PSqlite3): pointer{.cdecl, dynlib: Lib, importc: "sqlite3_errmsg16".} -proc prepare*(db: P, zSql: cstring, nBytes: int32, ppStmt: PPsqlite3_stmt, +proc prepare*(db: PSqlite3, zSql: cstring, nBytes: int32, ppStmt: PPsqlite3_stmt, pzTail: ptr cstring): int32{.cdecl, dynlib: Lib, importc: "sqlite3_prepare".} -proc prepare16*(db: P, zSql: pointer, nBytes: int32, ppStmt: PPsqlite3_stmt, +proc prepare16*(db: PSqlite3, zSql: pointer, nBytes: int32, ppStmt: PPsqlite3_stmt, pzTail: var pointer): int32{.cdecl, dynlib: Lib, importc: "sqlite3_prepare16".} proc bind_blob*(para1: Pstmt, para2: int32, para3: pointer, n: int32, @@ -259,13 +259,13 @@ proc column_type*(para1: Pstmt, iCol: int32): int32{.cdecl, dynlib: Lib, proc finalize*(pStmt: Pstmt): int32{.cdecl, dynlib: Lib, importc: "sqlite3_finalize".} proc reset*(pStmt: Pstmt): int32{.cdecl, dynlib: Lib, importc: "sqlite3_reset".} -proc create_function*(para1: P, zFunctionName: cstring, nArg: int32, +proc create_function*(para1: PSqlite3, zFunctionName: cstring, nArg: int32, eTextRep: int32, para5: pointer, xFunc: Tcreate_function_func_func, xStep: Tcreate_function_step_func, xFinal: Tcreate_function_final_func): int32{.cdecl, dynlib: Lib, importc: "sqlite3_create_function".} -proc create_function16*(para1: P, zFunctionName: pointer, nArg: int32, +proc create_function16*(para1: PSqlite3, zFunctionName: pointer, nArg: int32, eTextRep: int32, para5: pointer, xFunc: Tcreate_function_func_func, xStep: Tcreate_function_step_func, @@ -333,15 +333,15 @@ proc result_text16be*(para1: Pcontext, para2: pointer, para3: int32, importc: "sqlite3_result_text16be".} proc result_value*(para1: Pcontext, para2: Pvalue){.cdecl, dynlib: Lib, importc: "sqlite3_result_value".} -proc create_collation*(para1: P, zName: cstring, eTextRep: int32, +proc create_collation*(para1: PSqlite3, zName: cstring, eTextRep: int32, para4: pointer, xCompare: Tcreate_collation_func): int32{. cdecl, dynlib: Lib, importc: "sqlite3_create_collation".} -proc create_collation16*(para1: P, zName: cstring, eTextRep: int32, +proc create_collation16*(para1: PSqlite3, zName: cstring, eTextRep: int32, para4: pointer, xCompare: Tcreate_collation_func): int32{. cdecl, dynlib: Lib, importc: "sqlite3_create_collation16".} -proc collation_needed*(para1: P, para2: pointer, para3: Tcollation_needed_func): int32{. +proc collation_needed*(para1: PSqlite3, para2: pointer, para3: Tcollation_needed_func): int32{. cdecl, dynlib: Lib, importc: "sqlite3_collation_needed".} -proc collation_needed16*(para1: P, para2: pointer, para3: Tcollation_needed_func): int32{. +proc collation_needed16*(para1: PSqlite3, para2: pointer, para3: Tcollation_needed_func): int32{. cdecl, dynlib: Lib, importc: "sqlite3_collation_needed16".} proc libversion*(): cstring{.cdecl, dynlib: Lib, importc: "sqlite3_libversion".} #Alias for allowing better code portability (win32 is not working with external variables) diff --git a/lib/pure/times.nim b/lib/pure/times.nim index a54af32541..70cb038a7a 100644 --- a/lib/pure/times.nim +++ b/lib/pure/times.nim @@ -196,7 +196,11 @@ when not defined(ECMAScript): proc `-` (a, b: TTime): int64 = return toBiggestInt(difftime(a, b)) - proc getStartMilsecs(): int = return clock() div (clocksPerSec div 1000) + proc getStartMilsecs(): int = + #echo "clocks per sec: ", clocksPerSec + #return clock() div (clocksPerSec div 1000) + result = toInt(toFloat(clock()) / (toFloat(clocksPerSec) / 1000.0)) + proc getTime(): TTime = return timec(nil) proc getLocalTime(t: TTime): TTimeInfo = var a = t diff --git a/tests/tarrindx.nim b/tests/accept/compile/tarrindx.nim similarity index 100% rename from tests/tarrindx.nim rename to tests/accept/compile/tarrindx.nim diff --git a/tests/tassign.nim b/tests/accept/compile/tassign.nim similarity index 100% rename from tests/tassign.nim rename to tests/accept/compile/tassign.nim diff --git a/tests/tcmdline.nim b/tests/accept/compile/tcmdline.nim similarity index 100% rename from tests/tcmdline.nim rename to tests/accept/compile/tcmdline.nim diff --git a/tests/tcolors.nim b/tests/accept/compile/tcolors.nim similarity index 100% rename from tests/tcolors.nim rename to tests/accept/compile/tcolors.nim diff --git a/tests/tconsteval.nim b/tests/accept/compile/tconsteval.nim similarity index 100% rename from tests/tconsteval.nim rename to tests/accept/compile/tconsteval.nim diff --git a/tests/tconvert.nim b/tests/accept/compile/tconvert.nim similarity index 100% rename from tests/tconvert.nim rename to tests/accept/compile/tconvert.nim diff --git a/tests/tdeprecated.nim b/tests/accept/compile/tdeprecated.nim similarity index 100% rename from tests/tdeprecated.nim rename to tests/accept/compile/tdeprecated.nim diff --git a/tests/tdialogs.nim b/tests/accept/compile/tdialogs.nim similarity index 100% rename from tests/tdialogs.nim rename to tests/accept/compile/tdialogs.nim diff --git a/tests/tdllvar.nim b/tests/accept/compile/tdllvar.nim similarity index 100% rename from tests/tdllvar.nim rename to tests/accept/compile/tdllvar.nim diff --git a/tests/tdumpast.nim b/tests/accept/compile/tdumpast.nim similarity index 100% rename from tests/tdumpast.nim rename to tests/accept/compile/tdumpast.nim diff --git a/tests/techo.nim b/tests/accept/compile/techo.nim similarity index 100% rename from tests/techo.nim rename to tests/accept/compile/techo.nim diff --git a/tests/tendian.nim b/tests/accept/compile/tendian.nim similarity index 100% rename from tests/tendian.nim rename to tests/accept/compile/tendian.nim diff --git a/tests/tenum.nim b/tests/accept/compile/tenum.nim similarity index 100% rename from tests/tenum.nim rename to tests/accept/compile/tenum.nim diff --git a/tests/tforwty.nim b/tests/accept/compile/tforwty.nim similarity index 100% rename from tests/tforwty.nim rename to tests/accept/compile/tforwty.nim diff --git a/tests/tforwty2.nim b/tests/accept/compile/tforwty2.nim similarity index 100% rename from tests/tforwty2.nim rename to tests/accept/compile/tforwty2.nim diff --git a/tests/tgtk.nim b/tests/accept/compile/tgtk.nim similarity index 100% rename from tests/tgtk.nim rename to tests/accept/compile/tgtk.nim diff --git a/tests/thallo.nim b/tests/accept/compile/thallo.nim similarity index 100% rename from tests/thallo.nim rename to tests/accept/compile/thallo.nim diff --git a/tests/tident.nim b/tests/accept/compile/tident.nim similarity index 100% rename from tests/tident.nim rename to tests/accept/compile/tident.nim diff --git a/tests/tindent1.nim b/tests/accept/compile/tindent1.nim similarity index 100% rename from tests/tindent1.nim rename to tests/accept/compile/tindent1.nim diff --git a/tests/tio.nim b/tests/accept/compile/tio.nim similarity index 100% rename from tests/tio.nim rename to tests/accept/compile/tio.nim diff --git a/tests/titer.nim b/tests/accept/compile/titer.nim similarity index 100% rename from tests/titer.nim rename to tests/accept/compile/titer.nim diff --git a/tests/tlastmod.nim b/tests/accept/compile/tlastmod.nim similarity index 100% rename from tests/tlastmod.nim rename to tests/accept/compile/tlastmod.nim diff --git a/tests/scantest.nim b/tests/accept/compile/tlexer.nim similarity index 92% rename from tests/scantest.nim rename to tests/accept/compile/tlexer.nim index c9779c7627..fe784280c0 100644 --- a/tests/scantest.nim +++ b/tests/accept/compile/tlexer.nim @@ -3,11 +3,6 @@ # This is a new one! -# This should not be allowed! - -export -main - import lexbase, os, strutils diff --git a/tests/tlibs.nim b/tests/accept/compile/tlibs.nim similarity index 100% rename from tests/tlibs.nim rename to tests/accept/compile/tlibs.nim diff --git a/tests/tloops.nim b/tests/accept/compile/tloops.nim similarity index 100% rename from tests/tloops.nim rename to tests/accept/compile/tloops.nim diff --git a/tests/tmath.nim b/tests/accept/compile/tmath.nim similarity index 100% rename from tests/tmath.nim rename to tests/accept/compile/tmath.nim diff --git a/tests/tnew.nim b/tests/accept/compile/tnew.nim similarity index 100% rename from tests/tnew.nim rename to tests/accept/compile/tnew.nim diff --git a/tests/tnewlibs.nim b/tests/accept/compile/tnewlibs.nim similarity index 100% rename from tests/tnewlibs.nim rename to tests/accept/compile/tnewlibs.nim diff --git a/tests/tnewsets.nim b/tests/accept/compile/tnewsets.nim similarity index 100% rename from tests/tnewsets.nim rename to tests/accept/compile/tnewsets.nim diff --git a/tests/tnewuns.nim b/tests/accept/compile/tnewuns.nim similarity index 100% rename from tests/tnewuns.nim rename to tests/accept/compile/tnewuns.nim diff --git a/tests/tobjcov.nim b/tests/accept/compile/tobjcov.nim similarity index 100% rename from tests/tobjcov.nim rename to tests/accept/compile/tobjcov.nim diff --git a/tests/tobject2.nim b/tests/accept/compile/tobject2.nim similarity index 100% rename from tests/tobject2.nim rename to tests/accept/compile/tobject2.nim diff --git a/tests/tobjects.nim b/tests/accept/compile/tobjects.nim similarity index 100% rename from tests/tobjects.nim rename to tests/accept/compile/tobjects.nim diff --git a/tests/toptions.nim b/tests/accept/compile/toptions.nim similarity index 100% rename from tests/toptions.nim rename to tests/accept/compile/toptions.nim diff --git a/tests/tos.nim b/tests/accept/compile/tos.nim similarity index 100% rename from tests/tos.nim rename to tests/accept/compile/tos.nim diff --git a/tests/toverprc.nim b/tests/accept/compile/toverprc.nim similarity index 100% rename from tests/toverprc.nim rename to tests/accept/compile/toverprc.nim diff --git a/tests/tparedef.nim b/tests/accept/compile/tparedef.nim similarity index 100% rename from tests/tparedef.nim rename to tests/accept/compile/tparedef.nim diff --git a/tests/tparscfg.nim b/tests/accept/compile/tparscfg.nim similarity index 100% rename from tests/tparscfg.nim rename to tests/accept/compile/tparscfg.nim diff --git a/tests/tparsefloat.nim b/tests/accept/compile/tparsefloat.nim similarity index 100% rename from tests/tparsefloat.nim rename to tests/accept/compile/tparsefloat.nim diff --git a/tests/tparsopt.nim b/tests/accept/compile/tparsopt.nim similarity index 100% rename from tests/tparsopt.nim rename to tests/accept/compile/tparsopt.nim diff --git a/tests/tposix.nim b/tests/accept/compile/tposix.nim similarity index 100% rename from tests/tposix.nim rename to tests/accept/compile/tposix.nim diff --git a/tests/tprep.nim b/tests/accept/compile/tprep.nim similarity index 100% rename from tests/tprep.nim rename to tests/accept/compile/tprep.nim diff --git a/tests/tpush.nim b/tests/accept/compile/tpush.nim similarity index 100% rename from tests/tpush.nim rename to tests/accept/compile/tpush.nim diff --git a/tests/tquicksort.nim b/tests/accept/compile/tquicksort.nim similarity index 100% rename from tests/tquicksort.nim rename to tests/accept/compile/tquicksort.nim diff --git a/tests/tquit.nim b/tests/accept/compile/tquit.nim similarity index 100% rename from tests/tquit.nim rename to tests/accept/compile/tquit.nim diff --git a/tests/tradix.nim b/tests/accept/compile/tradix.nim similarity index 100% rename from tests/tradix.nim rename to tests/accept/compile/tradix.nim diff --git a/tests/treadln.nim b/tests/accept/compile/treadln.nim similarity index 100% rename from tests/treadln.nim rename to tests/accept/compile/treadln.nim diff --git a/tests/treadx.nim b/tests/accept/compile/treadx.nim similarity index 100% rename from tests/treadx.nim rename to tests/accept/compile/treadx.nim diff --git a/tests/trecmod.nim b/tests/accept/compile/trecmod.nim similarity index 100% rename from tests/trecmod.nim rename to tests/accept/compile/trecmod.nim diff --git a/tests/trecmod2.nim b/tests/accept/compile/trecmod2.nim similarity index 100% rename from tests/trecmod2.nim rename to tests/accept/compile/trecmod2.nim diff --git a/tests/trepr.nim b/tests/accept/compile/trepr.nim similarity index 100% rename from tests/trepr.nim rename to tests/accept/compile/trepr.nim diff --git a/tests/tseq2.nim b/tests/accept/compile/tseq2.nim similarity index 100% rename from tests/tseq2.nim rename to tests/accept/compile/tseq2.nim diff --git a/tests/tseqcon2.nim b/tests/accept/compile/tseqcon2.nim similarity index 100% rename from tests/tseqcon2.nim rename to tests/accept/compile/tseqcon2.nim diff --git a/tests/tsizeof.nim b/tests/accept/compile/tsizeof.nim similarity index 100% rename from tests/tsizeof.nim rename to tests/accept/compile/tsizeof.nim diff --git a/tests/tsockets.nim b/tests/accept/compile/tsockets.nim similarity index 100% rename from tests/tsockets.nim rename to tests/accept/compile/tsockets.nim diff --git a/tests/tstrace.nim b/tests/accept/compile/tstrace.nim similarity index 100% rename from tests/tstrace.nim rename to tests/accept/compile/tstrace.nim diff --git a/tests/tstrdesc.nim b/tests/accept/compile/tstrdesc.nim similarity index 100% rename from tests/tstrdesc.nim rename to tests/accept/compile/tstrdesc.nim diff --git a/tests/tstrdist.nim b/tests/accept/compile/tstrdist.nim similarity index 100% rename from tests/tstrdist.nim rename to tests/accept/compile/tstrdist.nim diff --git a/tests/tstreams.nim b/tests/accept/compile/tstreams.nim similarity index 100% rename from tests/tstreams.nim rename to tests/accept/compile/tstreams.nim diff --git a/tests/tstrset.nim b/tests/accept/compile/tstrset.nim similarity index 100% rename from tests/tstrset.nim rename to tests/accept/compile/tstrset.nim diff --git a/tests/tstrtabs.nim b/tests/accept/compile/tstrtabs.nim similarity index 100% rename from tests/tstrtabs.nim rename to tests/accept/compile/tstrtabs.nim diff --git a/tests/ttempl.nim b/tests/accept/compile/ttempl.nim similarity index 100% rename from tests/ttempl.nim rename to tests/accept/compile/ttempl.nim diff --git a/tests/ttempl3.nim b/tests/accept/compile/ttempl3.nim similarity index 100% rename from tests/ttempl3.nim rename to tests/accept/compile/ttempl3.nim diff --git a/tests/ttime.nim b/tests/accept/compile/ttime.nim similarity index 100% rename from tests/ttime.nim rename to tests/accept/compile/ttime.nim diff --git a/tests/ttuple1.nim b/tests/accept/compile/ttuple1.nim similarity index 100% rename from tests/ttuple1.nim rename to tests/accept/compile/ttuple1.nim diff --git a/tests/tvarious.nim b/tests/accept/compile/tvarious.nim similarity index 100% rename from tests/tvarious.nim rename to tests/accept/compile/tvarious.nim diff --git a/tests/twalker.nim b/tests/accept/compile/twalker.nim similarity index 100% rename from tests/twalker.nim rename to tests/accept/compile/twalker.nim diff --git a/tests/typalias.nim b/tests/accept/compile/typalias.nim similarity index 100% rename from tests/typalias.nim rename to tests/accept/compile/typalias.nim diff --git a/tests/tack.nim b/tests/accept/run/tack.nim similarity index 100% rename from tests/tack.nim rename to tests/accept/run/tack.nim diff --git a/tests/tambsym2.nim b/tests/accept/run/tambsym2.nim similarity index 100% rename from tests/tambsym2.nim rename to tests/accept/run/tambsym2.nim diff --git a/tests/tambsys.nim b/tests/accept/run/tambsys.nim similarity index 100% rename from tests/tambsys.nim rename to tests/accept/run/tambsys.nim diff --git a/tests/tarray.nim b/tests/accept/run/tarray.nim similarity index 100% rename from tests/tarray.nim rename to tests/accept/run/tarray.nim diff --git a/tests/tarray2.nim b/tests/accept/run/tarray2.nim similarity index 100% rename from tests/tarray2.nim rename to tests/accept/run/tarray2.nim diff --git a/tests/tassert.nim b/tests/accept/run/tassert.nim similarity index 100% rename from tests/tassert.nim rename to tests/accept/run/tassert.nim diff --git a/tests/tbind1.nim b/tests/accept/run/tbind1.nim similarity index 100% rename from tests/tbind1.nim rename to tests/accept/run/tbind1.nim diff --git a/tests/tbind3.nim b/tests/accept/run/tbind3.nim similarity index 100% rename from tests/tbind3.nim rename to tests/accept/run/tbind3.nim diff --git a/tests/tbintre2.nim b/tests/accept/run/tbintre2.nim similarity index 100% rename from tests/tbintre2.nim rename to tests/accept/run/tbintre2.nim diff --git a/tests/tbintree.nim b/tests/accept/run/tbintree.nim similarity index 100% rename from tests/tbintree.nim rename to tests/accept/run/tbintree.nim diff --git a/tests/tcasestm.nim b/tests/accept/run/tcasestm.nim similarity index 100% rename from tests/tcasestm.nim rename to tests/accept/run/tcasestm.nim diff --git a/tests/tclosure.nim b/tests/accept/run/tclosure.nim similarity index 100% rename from tests/tclosure.nim rename to tests/accept/run/tclosure.nim diff --git a/tests/tcnstseq.nim b/tests/accept/run/tcnstseq.nim similarity index 100% rename from tests/tcnstseq.nim rename to tests/accept/run/tcnstseq.nim diff --git a/tests/tconstr2.nim b/tests/accept/run/tconstr2.nim similarity index 100% rename from tests/tconstr2.nim rename to tests/accept/run/tconstr2.nim diff --git a/tests/tcopy.nim b/tests/accept/run/tcopy.nim similarity index 100% rename from tests/tcopy.nim rename to tests/accept/run/tcopy.nim diff --git a/tests/tcurrncy.nim b/tests/accept/run/tcurrncy.nim similarity index 100% rename from tests/tcurrncy.nim rename to tests/accept/run/tcurrncy.nim diff --git a/tests/tfinally.nim b/tests/accept/run/tfinally.nim similarity index 100% rename from tests/tfinally.nim rename to tests/accept/run/tfinally.nim diff --git a/tests/tfloat1.nim b/tests/accept/run/tfloat1.nim similarity index 100% rename from tests/tfloat1.nim rename to tests/accept/run/tfloat1.nim diff --git a/tests/tfloat2.nim b/tests/accept/run/tfloat2.nim similarity index 100% rename from tests/tfloat2.nim rename to tests/accept/run/tfloat2.nim diff --git a/tests/tformat.nim b/tests/accept/run/tformat.nim similarity index 100% rename from tests/tformat.nim rename to tests/accept/run/tformat.nim diff --git a/tests/thintoff.nim b/tests/accept/run/thintoff.nim similarity index 100% rename from tests/thintoff.nim rename to tests/accept/run/thintoff.nim diff --git a/tests/tinit.nim b/tests/accept/run/tinit.nim similarity index 100% rename from tests/tinit.nim rename to tests/accept/run/tinit.nim diff --git a/tests/tints.nim b/tests/accept/run/tints.nim similarity index 100% rename from tests/tints.nim rename to tests/accept/run/tints.nim diff --git a/tests/tisopr.nim b/tests/accept/run/tisopr.nim similarity index 100% rename from tests/tisopr.nim rename to tests/accept/run/tisopr.nim diff --git a/tests/titer2.nim b/tests/accept/run/titer2.nim similarity index 100% rename from tests/titer2.nim rename to tests/accept/run/titer2.nim diff --git a/tests/titer3.nim b/tests/accept/run/titer3.nim similarity index 100% rename from tests/titer3.nim rename to tests/accept/run/titer3.nim diff --git a/tests/titer5.nim b/tests/accept/run/titer5.nim similarity index 100% rename from tests/titer5.nim rename to tests/accept/run/titer5.nim diff --git a/tests/tlowhigh.nim b/tests/accept/run/tlowhigh.nim similarity index 100% rename from tests/tlowhigh.nim rename to tests/accept/run/tlowhigh.nim diff --git a/tests/tmatrix.nim b/tests/accept/run/tmatrix.nim similarity index 100% rename from tests/tmatrix.nim rename to tests/accept/run/tmatrix.nim diff --git a/tests/tmultim1.nim b/tests/accept/run/tmultim1.nim similarity index 100% rename from tests/tmultim1.nim rename to tests/accept/run/tmultim1.nim diff --git a/tests/tmultim2.nim b/tests/accept/run/tmultim2.nim similarity index 100% rename from tests/tmultim2.nim rename to tests/accept/run/tmultim2.nim diff --git a/tests/tnestif.nim b/tests/accept/run/tnestif.nim similarity index 100% rename from tests/tnestif.nim rename to tests/accept/run/tnestif.nim diff --git a/tests/tnestprc.nim b/tests/accept/run/tnestprc.nim similarity index 100% rename from tests/tnestprc.nim rename to tests/accept/run/tnestprc.nim diff --git a/tests/toop1.nim b/tests/accept/run/toop1.nim similarity index 100% rename from tests/toop1.nim rename to tests/accept/run/toop1.nim diff --git a/tests/topenarrayrepr.nim b/tests/accept/run/topenarrayrepr.nim similarity index 100% rename from tests/topenarrayrepr.nim rename to tests/accept/run/topenarrayrepr.nim diff --git a/tests/topenlen.nim b/tests/accept/run/topenlen.nim similarity index 100% rename from tests/topenlen.nim rename to tests/accept/run/topenlen.nim diff --git a/tests/toverflw.nim b/tests/accept/run/toverflw.nim similarity index 100% rename from tests/toverflw.nim rename to tests/accept/run/toverflw.nim diff --git a/tests/toverl2.nim b/tests/accept/run/toverl2.nim similarity index 100% rename from tests/toverl2.nim rename to tests/accept/run/toverl2.nim diff --git a/tests/toverlop.nim b/tests/accept/run/toverlop.nim similarity index 100% rename from tests/toverlop.nim rename to tests/accept/run/toverlop.nim diff --git a/tests/toverwr.nim b/tests/accept/run/toverwr.nim similarity index 100% rename from tests/toverwr.nim rename to tests/accept/run/toverwr.nim diff --git a/tests/tovfint.nim b/tests/accept/run/tovfint.nim similarity index 100% rename from tests/tovfint.nim rename to tests/accept/run/tovfint.nim diff --git a/tests/tpos.nim b/tests/accept/run/tpos.nim similarity index 100% rename from tests/tpos.nim rename to tests/accept/run/tpos.nim diff --git a/tests/tprintf.nim b/tests/accept/run/tprintf.nim similarity index 100% rename from tests/tprintf.nim rename to tests/accept/run/tprintf.nim diff --git a/tests/tprocvar.nim b/tests/accept/run/tprocvar.nim similarity index 100% rename from tests/tprocvar.nim rename to tests/accept/run/tprocvar.nim diff --git a/tests/tquotewords.nim b/tests/accept/run/tquotewords.nim similarity index 100% rename from tests/tquotewords.nim rename to tests/accept/run/tquotewords.nim diff --git a/tests/tregex.nim b/tests/accept/run/tregex.nim similarity index 100% rename from tests/tregex.nim rename to tests/accept/run/tregex.nim diff --git a/tests/treguse.nim b/tests/accept/run/treguse.nim similarity index 100% rename from tests/treguse.nim rename to tests/accept/run/treguse.nim diff --git a/tests/tromans.nim b/tests/accept/run/tromans.nim similarity index 100% rename from tests/tromans.nim rename to tests/accept/run/tromans.nim diff --git a/tests/tseqcon.nim b/tests/accept/run/tseqcon.nim similarity index 100% rename from tests/tseqcon.nim rename to tests/accept/run/tseqcon.nim diff --git a/tests/tsets.nim b/tests/accept/run/tsets.nim similarity index 100% rename from tests/tsets.nim rename to tests/accept/run/tsets.nim diff --git a/tests/tsidee2.nim b/tests/accept/run/tsidee2.nim similarity index 100% rename from tests/tsidee2.nim rename to tests/accept/run/tsidee2.nim diff --git a/tests/tsidee3.nim b/tests/accept/run/tsidee3.nim similarity index 100% rename from tests/tsidee3.nim rename to tests/accept/run/tsidee3.nim diff --git a/tests/tsimmeth.nim b/tests/accept/run/tsimmeth.nim similarity index 100% rename from tests/tsimmeth.nim rename to tests/accept/run/tsimmeth.nim diff --git a/tests/tsplit.nim b/tests/accept/run/tsplit.nim similarity index 100% rename from tests/tsplit.nim rename to tests/accept/run/tsplit.nim diff --git a/tests/tstrange.nim b/tests/accept/run/tstrange.nim similarity index 100% rename from tests/tstrange.nim rename to tests/accept/run/tstrange.nim diff --git a/tests/tstrlits.nim b/tests/accept/run/tstrlits.nim similarity index 100% rename from tests/tstrlits.nim rename to tests/accept/run/tstrlits.nim diff --git a/tests/tstrutil.nim b/tests/accept/run/tstrutil.nim similarity index 100% rename from tests/tstrutil.nim rename to tests/accept/run/tstrutil.nim diff --git a/tests/tvardecl.nim b/tests/accept/run/tvardecl.nim similarity index 100% rename from tests/tvardecl.nim rename to tests/accept/run/tvardecl.nim diff --git a/tests/tvarnums.nim b/tests/accept/run/tvarnums.nim similarity index 100% rename from tests/tvarnums.nim rename to tests/accept/run/tvarnums.nim diff --git a/tests/tvartup.nim b/tests/accept/run/tvartup.nim similarity index 100% rename from tests/tvartup.nim rename to tests/accept/run/tvartup.nim diff --git a/tests/gc/gcbench.nim b/tests/gc/gcbench.nim new file mode 100644 index 0000000000..d9e1523265 --- /dev/null +++ b/tests/gc/gcbench.nim @@ -0,0 +1,163 @@ +# This is adapted from a benchmark written by John Ellis and Pete Kovac +# of Post Communications. +# It was modified by Hans Boehm of Silicon Graphics. +# +# This is no substitute for real applications. No actual application +# is likely to behave in exactly this way. However, this benchmark was +# designed to be more representative of real applications than other +# Java GC benchmarks of which we are aware. +# It attempts to model those properties of allocation requests that +# are important to current GC techniques. +# It is designed to be used either to obtain a single overall performance +# number, or to give a more detailed estimate of how collector +# performance varies with object lifetimes. It prints the time +# required to allocate and collect balanced binary trees of various +# sizes. Smaller trees result in shorter object lifetimes. Each cycle +# allocates roughly the same amount of memory. +# Two data structures are kept around during the entire process, so +# that the measured performance is representative of applications +# that maintain some live in-memory data. One of these is a tree +# containing many pointers. The other is a large array containing +# double precision floating point numbers. Both should be of comparable +# size. +# +# The results are only really meaningful together with a specification +# of how much memory was used. It is possible to trade memory for +# better time performance. This benchmark should be run in a 32 MB +# heap, though we don't currently know how to enforce that uniformly. +# +# Unlike the original Ellis and Kovac benchmark, we do not attempt +# measure pause times. This facility should eventually be added back +# in. There are several reasons for omitting it for now. The original +# implementation depended on assumptions about the thread scheduler +# that don't hold uniformly. The results really measure both the +# scheduler and GC. Pause time measurements tend to not fit well with +# current benchmark suites. As far as we know, none of the current +# commercial Java implementations seriously attempt to minimize GC pause +# times. +# +# Known deficiencies: +# - No way to check on memory use +# - No cyclic data structures +# - No attempt to measure variation with object size +# - Results are sensitive to locking cost, but we dont +# check for proper locking +# + +import + strutils, times + +type + PNode = ref TNode + TNode {.final.} = object + left, right: PNode + i, j: int + +proc newNode(L, r: PNode): PNode = + new(result) + result.left = L + result.right = r + +const + kStretchTreeDepth = 18 # about 16Mb + kLongLivedTreeDepth = 16 # about 4Mb + kArraySize = 500000 # about 4Mb + kMinTreeDepth = 4 + kMaxTreeDepth = 16 + +# Nodes used by a tree of a given size +proc TreeSize(i: int): int = return ((1 shl (i + 1)) - 1) + +# Number of iterations to use for a given tree depth +proc NumIters(i: int): int = + return 2 * TreeSize(kStretchTreeDepth) div TreeSize(i) + +# Build tree top down, assigning to older objects. +proc Populate(iDepth: int, thisNode: PNode) = + if iDepth <= 0: + return + else: + new(thisNode.left) + new(thisNode.right) + Populate(iDepth-1, thisNode.left) + Populate(iDepth-1, thisNode.right) + +# Build tree bottom-up +proc MakeTree(iDepth: int): PNode = + if iDepth <= 0: + new(result) + else: + return newNode(MakeTree(iDepth-1), MakeTree(iDepth-1)) + +proc PrintDiagnostics() = + echo("Total memory available: " & $getTotalMem() & " bytes") + echo("Free memory: " & $getFreeMem() & " bytes") + +proc TimeConstruction(depth: int) = + var + root, tempTree: PNode + t: int + iNumIters: int + + iNumIters = NumIters(depth) + + echo("Creating " & $iNumIters & " trees of depth " & $depth) + t = getStartMilsecs() + for i in 0..iNumIters-1: + new(tempTree) + Populate(depth, tempTree) + tempTree = nil + echo("\tTop down construction took " & $(getStartMilsecs() - t) & "msecs") + t = getStartMilsecs() + for i in 0..iNumIters-1: + tempTree = MakeTree(depth) + tempTree = nil + echo("\tBottom up construction took " & $(getStartMilsecs() - t) & "msecs") + +type + tMyArray = seq[float] + +proc main() = + var + root, longLivedTree, tempTree: PNode + t: int + myarray: tMyArray + + echo("Garbage Collector Test") + echo(" Stretching memory with a binary tree of depth " & $kStretchTreeDepth) + PrintDiagnostics() + t = getStartMilsecs() + + # Stretch the memory space quickly + tempTree = MakeTree(kStretchTreeDepth) + tempTree = nil + + # Create a long lived object + echo(" Creating a long-lived binary tree of depth " & + $kLongLivedTreeDepth) + new(longLivedTree) + Populate(kLongLivedTreeDepth, longLivedTree) + + # Create long-lived array, filling half of it + echo(" Creating a long-lived array of " & $kArraySize & " doubles") + newSeq(myarray, kArraySize) + for i in 0..kArraySize div 2 -1: + myarray[i] = 1.0 / toFloat(i) + + PrintDiagnostics() + + var d = kMinTreeDepth + while d <= kMaxTreeDepth: + TimeConstruction(d) + inc(d, 2) + + if longLivedTree == nil or myarray[1000] != 1.0/1000.0: + echo("Failed") + # fake reference to LongLivedTree + # and array to keep them from being optimized away + + var elapsed = getStartMilsecs() - t + PrintDiagnostics() + echo("Completed in " & $elapsed & "ms.") + +main() diff --git a/tests/gctest.nim b/tests/gc/gctest.nim similarity index 100% rename from tests/gctest.nim rename to tests/gc/gctest.nim diff --git a/tests/gcbench.nim b/tests/gcbench.nim deleted file mode 100644 index 72daad210f..0000000000 --- a/tests/gcbench.nim +++ /dev/null @@ -1,171 +0,0 @@ -# This is adapted from a benchmark written by John Ellis and Pete Kovac -# of Post Communications. -# It was modified by Hans Boehm of Silicon Graphics. -# -# This is no substitute for real applications. No actual application -# is likely to behave in exactly this way. However, this benchmark was -# designed to be more representative of real applications than other -# Java GC benchmarks of which we are aware. -# It attempts to model those properties of allocation requests that -# are important to current GC techniques. -# It is designed to be used either to obtain a single overall performance -# number, or to give a more detailed estimate of how collector -# performance varies with object lifetimes. It prints the time -# required to allocate and collect balanced binary trees of various -# sizes. Smaller trees result in shorter object lifetimes. Each cycle -# allocates roughly the same amount of memory. -# Two data structures are kept around during the entire process, so -# that the measured performance is representative of applications -# that maintain some live in-memory data. One of these is a tree -# containing many pointers. The other is a large array containing -# double precision floating point numbers. Both should be of comparable -# size. -# -# The results are only really meaningful together with a specification -# of how much memory was used. It is possible to trade memory for -# better time performance. This benchmark should be run in a 32 MB -# heap, though we don't currently know how to enforce that uniformly. -# -# Unlike the original Ellis and Kovac benchmark, we do not attempt -# measure pause times. This facility should eventually be added back -# in. There are several reasons for omitting it for now. The original -# implementation depended on assumptions about the thread scheduler -# that don't hold uniformly. The results really measure both the -# scheduler and GC. Pause time measurements tend to not fit well with -# current benchmark suites. As far as we know, none of the current -# commercial Java implementations seriously attempt to minimize GC pause -# times. -# -# Known deficiencies: -# - No way to check on memory use -# - No cyclic data structures -# - No attempt to measure variation with object size -# - Results are sensitive to locking cost, but we dont -# check for proper locking -# - -import - strutils, times - -type - PNode = ref TNode - TNode {.final.} = object - left, right: PNode - i, j: int - -proc newNode(l, r: PNode): PNode = - new(result) - result.left = l - result.right = r - -const - kStretchTreeDepth = 18 # about 16Mb - kLongLivedTreeDepth = 16 # about 4Mb - kArraySize = 500000 # about 4Mb - kMinTreeDepth = 4 - kMaxTreeDepth = 16 - -# Nodes used by a tree of a given size -proc TreeSize(i: int): int = return ((1 shl (i + 1)) - 1) - -# Number of iterations to use for a given tree depth -proc NumIters(i: int): int = - return 2 * TreeSize(kStretchTreeDepth) div TreeSize(i) - -# Build tree top down, assigning to older objects. -proc Populate(iDepth: int, thisNode: PNode) = - if iDepth <= 0: - return - else: - new(thisNode.left) - new(thisNode.right) - Populate(iDepth-1, thisNode.left) - Populate(iDepth-1, thisNode.right) - -# Build tree bottom-up -proc MakeTree(iDepth: int): PNode = - if iDepth <= 0: - new(result) - else: - return newNode(MakeTree(iDepth-1), - MakeTree(iDepth-1)) - -proc PrintDiagnostics() = - var - FreeMemory = getFreeMem() - TotalMemory = getTotalMem() - - echo("Total memory available: " & $TotalMemory & " bytes") - echo("Free memory: " & $FreeMemory & " bytes") - -proc TimeConstruction(depth: int) = - var - root, tempTree: PNode - t: int - iNumIters: int - - iNumIters = NumIters(depth) - - echo("Creating " & $iNumIters & " trees of depth " & $depth) - t = getStartMilsecs() - for i in 0..iNumIters-1: - new(tempTree) - Populate(depth, tempTree) - tempTree = nil - echo("\tTop down construction took " & - $(getStartMilsecs() - t) & "msecs") - t = getStartMilsecs() - for i in 0..iNumIters-1: - tempTree = MakeTree(depth) - tempTree = nil - echo("\tBottom up construction took " & - $(getStartMilsecs() - t) & "msecs") - -type - tMyArray = seq[float] - -proc main() = - var - root, longLivedTree, tempTree: PNode - t: int - myarray: tMyArray - - echo("Garbage Collector Test") - echo(" Stretching memory with a binary tree of depth " & - $kStretchTreeDepth) - PrintDiagnostics() - t = getStartMilsecs() - - # Stretch the memory space quickly - tempTree = MakeTree(kStretchTreeDepth) - tempTree = nil - - # Create a long lived object - echo(" Creating a long-lived binary tree of depth " & - $kLongLivedTreeDepth) - new(longLivedTree) - Populate(kLongLivedTreeDepth, longLivedTree) - - # Create long-lived array, filling half of it - echo(" Creating a long-lived array of " & $kArraySize & " doubles") - newSeq(myarray, kArraySize) - for i in 0..kArraySize div 2 -1: - myarray[i] = 1.0 / toFloat(i) - - PrintDiagnostics() - - var d = kMinTreeDepth - while d <= kMaxTreeDepth: - TimeConstruction(d) - inc(d, 2) - - if longLivedTree == nil or myarray[1000] != 1.0/1000.0: - echo("Failed") - # fake reference to LongLivedTree - # and array to keep them from being optimized away - - var elapsed = getStartMilsecs() - t - PrintDiagnostics() - echo("Completed in " & $elapsed & "ms.") - -main() diff --git a/tests/mbind3.nim b/tests/mbind3.nim deleted file mode 100644 index 586222eb87..0000000000 --- a/tests/mbind3.nim +++ /dev/null @@ -1,9 +0,0 @@ -# Module A -var - lastId = 0 - -template genId*: expr = - inc(bind lastId) - lastId - - diff --git a/tests/mbind4.nim b/tests/mbind4.nim deleted file mode 100644 index 53b8331cd6..0000000000 --- a/tests/mbind4.nim +++ /dev/null @@ -1,9 +0,0 @@ -# Module A -var - lastId = 0 - -template genId*: expr = - inc(lastId) - lastId - - diff --git a/tests/mvarious.nim b/tests/mvarious.nim deleted file mode 100644 index 333b34d338..0000000000 --- a/tests/mvarious.nim +++ /dev/null @@ -1,6 +0,0 @@ -# Test a submodule - -#type -# TStringArr = array [0.. *] of string - -proc exportme* = nil diff --git a/tests/99bottles.nim b/tests/reject/99bottles.nim similarity index 100% rename from tests/99bottles.nim rename to tests/reject/99bottles.nim diff --git a/tests/t99bott.nim b/tests/reject/t99bott.nim similarity index 100% rename from tests/t99bott.nim rename to tests/reject/t99bott.nim diff --git a/tests/tadrdisc.nim b/tests/reject/tadrdisc.nim similarity index 100% rename from tests/tadrdisc.nim rename to tests/reject/tadrdisc.nim diff --git a/tests/tambsym.nim b/tests/reject/tambsym.nim similarity index 100% rename from tests/tambsym.nim rename to tests/reject/tambsym.nim diff --git a/tests/tambsym3.nim b/tests/reject/tambsym3.nim similarity index 100% rename from tests/tambsym3.nim rename to tests/reject/tambsym3.nim diff --git a/tests/tbind2.nim b/tests/reject/tbind2.nim similarity index 100% rename from tests/tbind2.nim rename to tests/reject/tbind2.nim diff --git a/tests/tbind4.nim b/tests/reject/tbind4.nim similarity index 100% rename from tests/tbind4.nim rename to tests/reject/tbind4.nim diff --git a/tests/tblock1.nim b/tests/reject/tblock1.nim similarity index 100% rename from tests/tblock1.nim rename to tests/reject/tblock1.nim diff --git a/tests/tconstr1.nim b/tests/reject/tconstr1.nim similarity index 100% rename from tests/tconstr1.nim rename to tests/reject/tconstr1.nim diff --git a/tests/tillrec.nim b/tests/reject/tillrec.nim similarity index 100% rename from tests/tillrec.nim rename to tests/reject/tillrec.nim diff --git a/tests/tinout.nim b/tests/reject/tinout.nim similarity index 100% rename from tests/tinout.nim rename to tests/reject/tinout.nim diff --git a/tests/tinvalidnewseq.nim b/tests/reject/tinvalidnewseq.nim similarity index 100% rename from tests/tinvalidnewseq.nim rename to tests/reject/tinvalidnewseq.nim diff --git a/tests/tinvwhen.nim b/tests/reject/tinvwhen.nim similarity index 100% rename from tests/tinvwhen.nim rename to tests/reject/tinvwhen.nim diff --git a/tests/titer4.nim b/tests/reject/titer4.nim similarity index 100% rename from tests/titer4.nim rename to tests/reject/titer4.nim diff --git a/tests/tnamspc.nim b/tests/reject/tnamspc.nim similarity index 100% rename from tests/tnamspc.nim rename to tests/reject/tnamspc.nim diff --git a/tests/tnoop.nim b/tests/reject/tnoop.nim similarity index 100% rename from tests/tnoop.nim rename to tests/reject/tnoop.nim diff --git a/tests/tnot.nim b/tests/reject/tnot.nim similarity index 100% rename from tests/tnot.nim rename to tests/reject/tnot.nim diff --git a/tests/topaque.nim b/tests/reject/topaque.nim similarity index 100% rename from tests/topaque.nim rename to tests/reject/topaque.nim diff --git a/tests/topena1.nim b/tests/reject/topena1.nim similarity index 100% rename from tests/topena1.nim rename to tests/reject/topena1.nim diff --git a/tests/toverl.nim b/tests/reject/toverl.nim similarity index 100% rename from tests/toverl.nim rename to tests/reject/toverl.nim diff --git a/tests/trawstr.nim b/tests/reject/trawstr.nim similarity index 100% rename from tests/trawstr.nim rename to tests/reject/trawstr.nim diff --git a/tests/trecinca.nim b/tests/reject/trecinca.nim similarity index 100% rename from tests/trecinca.nim rename to tests/reject/trecinca.nim diff --git a/tests/trecincb.nim b/tests/reject/trecincb.nim similarity index 100% rename from tests/trecincb.nim rename to tests/reject/trecincb.nim diff --git a/tests/treciter.nim b/tests/reject/treciter.nim similarity index 100% rename from tests/treciter.nim rename to tests/reject/treciter.nim diff --git a/tests/trectype.nim b/tests/reject/trectype.nim similarity index 100% rename from tests/trectype.nim rename to tests/reject/trectype.nim diff --git a/tests/trefs.nim b/tests/reject/trefs.nim similarity index 100% rename from tests/trefs.nim rename to tests/reject/trefs.nim diff --git a/tests/tsidee1.nim b/tests/reject/tsidee1.nim similarity index 100% rename from tests/tsidee1.nim rename to tests/reject/tsidee1.nim diff --git a/tests/tsidee4.nim b/tests/reject/tsidee4.nim similarity index 100% rename from tests/tsidee4.nim rename to tests/reject/tsidee4.nim diff --git a/tests/tsimtych.nim b/tests/reject/tsimtych.nim similarity index 100% rename from tests/tsimtych.nim rename to tests/reject/tsimtych.nim diff --git a/tests/tstatret.nim b/tests/reject/tstatret.nim similarity index 100% rename from tests/tstatret.nim rename to tests/reject/tstatret.nim diff --git a/tests/tstmtexp.nim b/tests/reject/tstmtexp.nim similarity index 100% rename from tests/tstmtexp.nim rename to tests/reject/tstmtexp.nim diff --git a/tests/ttempl2.nim b/tests/reject/ttempl2.nim similarity index 100% rename from tests/ttempl2.nim rename to tests/reject/ttempl2.nim diff --git a/tests/tunderscores.nim b/tests/reject/tunderscores.nim similarity index 100% rename from tests/tunderscores.nim rename to tests/reject/tunderscores.nim diff --git a/tests/typredef.nim b/tests/reject/typredef.nim similarity index 100% rename from tests/typredef.nim rename to tests/reject/typredef.nim diff --git a/tests/tester.nim b/tests/tester.nim index 25a6dd4288..bd1b56188e 100644 --- a/tests/tester.nim +++ b/tests/tester.nim @@ -1,7 +1,7 @@ # # # Nimrod Tester -# (c) Copyright 2009 Andreas Rumpf +# (c) Copyright 2010 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. @@ -14,7 +14,7 @@ ## directive.) ## The format for '#ERROR_IN' is: ## #ERROR_IN filename linenumber -## One can omit the extension of the filename ('.nim' is then assumed). +## One can omit the extension of the filename ('.nim' is then used). ## Tests which contain none of the two directives should compile. Thus they ## are executed after successful compilation and their output is verified ## against the results specified with the '#OUT' directive. diff --git a/tests/x11test.nim b/tests/x11test.nim index 2769b6c74a..db51df2e01 100644 --- a/tests/x11test.nim +++ b/tests/x11test.nim @@ -61,9 +61,9 @@ proc eventloop = discard XFlush(display) var num_events = int(XPending(display)) while num_events != 0: - dec(num_events) - discard XNextEvent(display, addr(xev)) - process_event() + dec(num_events) + discard XNextEvent(display, addr(xev)) + process_event() create_window() while true: diff --git a/web/news.txt b/web/news.txt index 178bdead71..7ac039e666 100644 --- a/web/news.txt +++ b/web/news.txt @@ -23,6 +23,7 @@ Bugfixes - Fixed a serious bug in ``strutils.cmpIgnoreCase``. - Fixed ``unicode.toUTF8``. - The compiler now rejects ``'\n'``. +- ``times.getStartMilsecs()`` now works on Mac OS X. Additions