Skip to content

Commit

Permalink
use travis ci
Browse files Browse the repository at this point in the history
  • Loading branch information
yuin committed Apr 1, 2015
1 parent d448c3f commit c4ff22e
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 42 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: go

go:
- 1.3
- 1.4

script:
- go test -cover
3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ GopherLua: VM and compiler for Lua in Go.
.. image:: https://godoc.org/github.com/yuin/gopher-lua?status.svg
:target: http://godoc.org/github.com/yuin/gopher-lua

.. image:: https://travis-ci.org/yuin/gopher-lua.svg
:target: https://travis-ci.org/yuin/gopher-lua

|
GopherLua is a Lua5.1 VM and compiler written in Go. GopherLua has a same goal
Expand Down
42 changes: 0 additions & 42 deletions runtests.sh

This file was deleted.

53 changes: 53 additions & 0 deletions script_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package lua

import (
"fmt"
"os"
"testing"
)

const maxMemory = 40

var gluaTests []string = []string{
"bugs.lua",
}

var luaTests []string = []string{
"attrib.lua",
"calls.lua",
"closure.lua",
"constructs.lua",
"events.lua",
"literals.lua",
"locals.lua",
"math.lua",
"sort.lua",
"strings.lua",
"vararg.lua",
"pm.lua",
"files.lua",
}

func testScriptDir(t *testing.T, tests []string, directory string) {
if err := os.Chdir(directory); err != nil {
t.Error(err)
}
defer os.Chdir("..")
for _, script := range tests {
fmt.Printf("testing %s/%s\n", directory, script)
L := NewState()
L.SetMx(maxMemory)
if err := L.DoFile(script); err != nil {
t.Error(err)
}
L.Close()
}
}

func TestGlua(t *testing.T) {
testScriptDir(t, gluaTests, "_glua-tests")
}

func TestLua(t *testing.T) {
testScriptDir(t, luaTests, "_lua5.1-tests")
}

0 comments on commit c4ff22e

Please sign in to comment.