Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tests in Parallel where possible #499

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions auxlib_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
)

func TestCheckInt(t *testing.T) {
t.Parallel()
L := NewState()
defer L.Close()
errorIfGFuncNotFail(t, L, func(L *LState) int {
Expand All @@ -19,6 +20,7 @@ func TestCheckInt(t *testing.T) {
}

func TestCheckInt64(t *testing.T) {
t.Parallel()
L := NewState()
defer L.Close()
errorIfGFuncNotFail(t, L, func(L *LState) int {
Expand All @@ -31,6 +33,7 @@ func TestCheckInt64(t *testing.T) {
}

func TestCheckNumber(t *testing.T) {
t.Parallel()
L := NewState()
defer L.Close()
errorIfGFuncNotFail(t, L, func(L *LState) int {
Expand All @@ -45,6 +48,7 @@ func TestCheckNumber(t *testing.T) {
}

func TestCheckString(t *testing.T) {
t.Parallel()
L := NewState()
defer L.Close()
errorIfGFuncNotFail(t, L, func(L *LState) int {
Expand All @@ -59,6 +63,7 @@ func TestCheckString(t *testing.T) {
}

func TestCheckBool(t *testing.T) {
t.Parallel()
L := NewState()
defer L.Close()
errorIfGFuncNotFail(t, L, func(L *LState) int {
Expand All @@ -71,6 +76,7 @@ func TestCheckBool(t *testing.T) {
}

func TestCheckTable(t *testing.T) {
t.Parallel()
L := NewState()
defer L.Close()
errorIfGFuncNotFail(t, L, func(L *LState) int {
Expand All @@ -84,6 +90,7 @@ func TestCheckTable(t *testing.T) {
}

func TestCheckFunction(t *testing.T) {
t.Parallel()
L := NewState()
defer L.Close()
errorIfGFuncNotFail(t, L, func(L *LState) int {
Expand All @@ -97,6 +104,7 @@ func TestCheckFunction(t *testing.T) {
}

func TestCheckUserData(t *testing.T) {
t.Parallel()
L := NewState()
defer L.Close()
errorIfGFuncNotFail(t, L, func(L *LState) int {
Expand All @@ -110,6 +118,7 @@ func TestCheckUserData(t *testing.T) {
}

func TestCheckThread(t *testing.T) {
t.Parallel()
L := NewState()
defer L.Close()
errorIfGFuncNotFail(t, L, func(L *LState) int {
Expand All @@ -123,6 +132,7 @@ func TestCheckThread(t *testing.T) {
}

func TestCheckChannel(t *testing.T) {
t.Parallel()
L := NewState()
defer L.Close()
errorIfGFuncNotFail(t, L, func(L *LState) int {
Expand All @@ -136,6 +146,7 @@ func TestCheckChannel(t *testing.T) {
}

func TestCheckType(t *testing.T) {
t.Parallel()
L := NewState()
defer L.Close()
errorIfGFuncNotFail(t, L, func(L *LState) int {
Expand All @@ -147,6 +158,7 @@ func TestCheckType(t *testing.T) {
}

func TestCheckTypes(t *testing.T) {
t.Parallel()
L := NewState()
defer L.Close()
errorIfGFuncNotFail(t, L, func(L *LState) int {
Expand All @@ -158,6 +170,7 @@ func TestCheckTypes(t *testing.T) {
}

func TestCheckOption(t *testing.T) {
t.Parallel()
opts := []string{
"opt1",
"opt2",
Expand All @@ -175,6 +188,7 @@ func TestCheckOption(t *testing.T) {
}

func TestOptInt(t *testing.T) {
t.Parallel()
L := NewState()
defer L.Close()
errorIfGFuncNotFail(t, L, func(L *LState) int {
Expand All @@ -188,6 +202,7 @@ func TestOptInt(t *testing.T) {
}

func TestOptInt64(t *testing.T) {
t.Parallel()
L := NewState()
defer L.Close()
errorIfGFuncNotFail(t, L, func(L *LState) int {
Expand All @@ -201,6 +216,7 @@ func TestOptInt64(t *testing.T) {
}

func TestOptNumber(t *testing.T) {
t.Parallel()
L := NewState()
defer L.Close()
errorIfGFuncNotFail(t, L, func(L *LState) int {
Expand All @@ -214,6 +230,7 @@ func TestOptNumber(t *testing.T) {
}

func TestOptString(t *testing.T) {
t.Parallel()
L := NewState()
defer L.Close()
errorIfGFuncNotFail(t, L, func(L *LState) int {
Expand All @@ -227,6 +244,7 @@ func TestOptString(t *testing.T) {
}

func TestOptBool(t *testing.T) {
t.Parallel()
L := NewState()
defer L.Close()
errorIfGFuncNotFail(t, L, func(L *LState) int {
Expand All @@ -240,6 +258,7 @@ func TestOptBool(t *testing.T) {
}

func TestOptTable(t *testing.T) {
t.Parallel()
L := NewState()
defer L.Close()
errorIfGFuncNotFail(t, L, func(L *LState) int {
Expand All @@ -255,6 +274,7 @@ func TestOptTable(t *testing.T) {
}

func TestOptFunction(t *testing.T) {
t.Parallel()
L := NewState()
defer L.Close()
errorIfGFuncNotFail(t, L, func(L *LState) int {
Expand All @@ -270,6 +290,7 @@ func TestOptFunction(t *testing.T) {
}

func TestOptUserData(t *testing.T) {
t.Parallel()
L := NewState()
defer L.Close()
errorIfGFuncNotFail(t, L, func(L *LState) int {
Expand All @@ -285,6 +306,7 @@ func TestOptUserData(t *testing.T) {
}

func TestOptChannel(t *testing.T) {
t.Parallel()
L := NewState()
defer L.Close()
errorIfGFuncNotFail(t, L, func(L *LState) int {
Expand All @@ -300,6 +322,7 @@ func TestOptChannel(t *testing.T) {
}

func TestLoadFileForShebang(t *testing.T) {
t.Parallel()
tmpFile, err := ioutil.TempFile("", "")
errorIfNotNil(t, err)

Expand All @@ -321,6 +344,7 @@ print("hello")
}

func TestLoadFileForEmptyFile(t *testing.T) {
t.Parallel()
tmpFile, err := ioutil.TempFile("", "")
errorIfNotNil(t, err)

Expand Down
9 changes: 9 additions & 0 deletions channellib_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
)

func TestChannelMake(t *testing.T) {
t.Parallel()
L := NewState()
defer L.Close()
errorIfScriptFail(t, L, `
Expand All @@ -30,6 +31,7 @@ func TestChannelMake(t *testing.T) {
}

func TestChannelSelectError(t *testing.T) {
t.Parallel()
L := NewState()
defer L.Close()
errorIfScriptFail(t, L, `ch = channel.make()`)
Expand All @@ -42,6 +44,7 @@ func TestChannelSelectError(t *testing.T) {
}

func TestChannelSelect1(t *testing.T) {
t.Parallel()
var result LValue
var wg sync.WaitGroup
receiver := func(ch, quit chan LValue) {
Expand Down Expand Up @@ -106,6 +109,7 @@ func TestChannelSelect1(t *testing.T) {
}

func TestChannelSelect2(t *testing.T) {
t.Parallel()
var wg sync.WaitGroup
receiver := func(ch, quit chan LValue) {
defer wg.Done()
Expand Down Expand Up @@ -150,6 +154,7 @@ func TestChannelSelect2(t *testing.T) {
}

func TestChannelSelect3(t *testing.T) {
t.Parallel()
var wg sync.WaitGroup
receiver := func(ch chan LValue) {
defer wg.Done()
Expand Down Expand Up @@ -196,6 +201,7 @@ func TestChannelSelect3(t *testing.T) {
}

func TestChannelSelect4(t *testing.T) {
t.Parallel()
var wg sync.WaitGroup
receiver := func(ch chan LValue) {
defer wg.Done()
Expand Down Expand Up @@ -227,6 +233,7 @@ func TestChannelSelect4(t *testing.T) {
}

func TestChannelSendReceive1(t *testing.T) {
t.Parallel()
var wg sync.WaitGroup
receiver := func(ch chan LValue) {
defer wg.Done()
Expand Down Expand Up @@ -262,6 +269,7 @@ func TestChannelSendReceive1(t *testing.T) {
}

func TestCancelChannelReceive(t *testing.T) {
t.Parallel()
done := make(chan struct{})
ctx, cancel := context.WithCancel(context.Background())
go func() {
Expand All @@ -278,6 +286,7 @@ func TestCancelChannelReceive(t *testing.T) {
}

func TestCancelChannelReceive2(t *testing.T) {
t.Parallel()
done := make(chan struct{})
ctx, cancel := context.WithCancel(context.Background())
go func() {
Expand Down
Loading