Skip to content

Commit

Permalink
Add testing capability and travis integration
Browse files Browse the repository at this point in the history
  • Loading branch information
chendrix committed Jun 18, 2015
1 parent a4d05a6 commit 9f092ff
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 2 deletions.
37 changes: 37 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,39 @@

### Elm ###
elm-stuff
elm.js

# Elm test artifacts
elm-io.sh
raw-test.js
test.js

### Node ###
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules

8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: haskell
install:
- wget http://deadfoxygrandpa.github.io/elm-travis-cache/elm-test-install.sh
- bash elm-test-install.sh
before_script:
- ./elm-make --yes --output raw-test.js TestRunner.elm
- bash elm-io.sh raw-test.js test.js
script: node test.js
18 changes: 18 additions & 0 deletions TestRunner.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import String

import IO.IO exposing (..)
import IO.Runner exposing (Request, Response, run)
import ElmTest.Runner.Console exposing (runDisplay)
import ElmTest.Test exposing (..)

import RogueTest

tests : Test
tests = suite "Rogue Tests"
[ RogueTest.tests
]

port requests : Signal Request
port requests = run responses (runDisplay tests)

port responses : Signal Response
7 changes: 5 additions & 2 deletions elm-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
"repository": "https://github.com/chendrix/elm-rogue.git",
"license": "MIT",
"source-directories": [
"src"
"src",
"test"
],
"exposed-modules": [],
"dependencies": {
"elm-lang/core": "2.0.1 <= v < 3.0.0"
"elm-lang/core": "2.0.1 <= v < 3.0.0",
"deadfoxygrandpa/Elm-Test" : "1.0.4 <= v < 2.0.0",
"maxsnew/IO" : "0.1.5 <= v < 2.0.0"
},
"elm-version": "0.15.0 <= v < 0.16.0"
}
14 changes: 14 additions & 0 deletions test/RogueTest.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module RogueTest where

import ElmTest.Test exposing (..)
import ElmTest.Assertion exposing (..)

import Rogue
import String

tests : Test
tests = suite "A Test Suite"
[ test "Addition" (assertEqual (3 + 7) 10)
, test "String.left" (assertEqual "a" (String.left 1 "abcdefg"))
, test "This test should fail" (assert False)
]

0 comments on commit 9f092ff

Please sign in to comment.