move parseInt to jstrutils.nim to avoid conflicts; introduce travis testing
This commit is contained in:
parent
45931c5e4a
commit
08538f7f26
4 changed files with 34 additions and 3 deletions
18
.travis.yml
Normal file
18
.travis.yml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
sudo: false
|
||||
language: c
|
||||
os: linux
|
||||
install:
|
||||
- git clone https://github.com/nim-lang/nim
|
||||
- cd nim
|
||||
- git clone --depth 1 https://github.com/nim-lang/csources.git
|
||||
- cd csources
|
||||
- sh build.sh
|
||||
- cd ../
|
||||
- bin/nim c koch
|
||||
- ./koch boot -d:release
|
||||
- cd ..
|
||||
before_script:
|
||||
- set -e
|
||||
- export PATH=$(pwd)/nim/bin:$(pwd):$PATH
|
||||
script:
|
||||
- nim c -r tests/tester.nim
|
||||
|
|
@ -23,3 +23,4 @@ proc isInt*(s: cstring): bool {.asmNoStackFrame.} =
|
|||
"""
|
||||
|
||||
proc parseInt*(s: cstring): int {.importcpp: "parseInt(#, 10)", nodecl.}
|
||||
proc parseFloat*(s: cstring): BiggestFloat {.importc, nodecl.}
|
||||
|
|
|
|||
|
|
@ -547,9 +547,6 @@ proc decodeURIComponent*(uri: cstring): cstring {.importc, nodecl.}
|
|||
proc encodeURIComponent*(uri: cstring): cstring {.importc, nodecl.}
|
||||
proc isFinite*(x: BiggestFloat): bool {.importc, nodecl.}
|
||||
proc isNaN*(x: BiggestFloat): bool {.importc, nodecl.}
|
||||
proc parseFloat*(s: cstring): BiggestFloat {.importc, nodecl.}
|
||||
proc parseInt*(s: cstring): int {.importc, nodecl.}
|
||||
proc parseInt*(s: cstring, radix: int):int {.importc, nodecl.}
|
||||
|
||||
|
||||
proc id*(n: Node): cstring {.importcpp: "#.id", nodecl.}
|
||||
|
|
|
|||
15
tests/tester.nim
Normal file
15
tests/tester.nim
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# For now we only test that the things still compile.
|
||||
|
||||
import os
|
||||
|
||||
proc exec(cmd: string) =
|
||||
if os.execShellCmd(cmd) != 0:
|
||||
quit "command failed " & cmd
|
||||
|
||||
proc main =
|
||||
exec("nim js tests/diffDomTests.nim")
|
||||
exec("nim js examples/todoapp/todoapp.nim")
|
||||
exec("nim js examples/scrollapp/scrollapp.nim")
|
||||
exec("nim js examples/mediaplayer/playerapp.nim")
|
||||
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue