mirror of https://github.com/tinygo-org/tinygo.git
Browse Source
This allows for adding more advanced tests, for example tests that use the compiler package so that test sources can be written in Go instead of LLVM IR.pull/1833/head
Ayke van Laethem
4 years ago
committed by
Ron Evans
13 changed files with 44 additions and 28 deletions
@ -1,10 +1,12 @@ |
|||||
package transform |
package transform_test |
||||
|
|
||||
import ( |
import ( |
||||
"testing" |
"testing" |
||||
|
|
||||
|
"github.com/tinygo-org/tinygo/transform" |
||||
) |
) |
||||
|
|
||||
func TestAllocs(t *testing.T) { |
func TestAllocs(t *testing.T) { |
||||
t.Parallel() |
t.Parallel() |
||||
testTransform(t, "testdata/allocs", OptimizeAllocs) |
testTransform(t, "testdata/allocs", transform.OptimizeAllocs) |
||||
} |
} |
||||
|
@ -1,10 +1,12 @@ |
|||||
package transform |
package transform_test |
||||
|
|
||||
import ( |
import ( |
||||
"testing" |
"testing" |
||||
|
|
||||
|
"github.com/tinygo-org/tinygo/transform" |
||||
) |
) |
||||
|
|
||||
func TestFuncLowering(t *testing.T) { |
func TestFuncLowering(t *testing.T) { |
||||
t.Parallel() |
t.Parallel() |
||||
testTransform(t, "testdata/func-lowering", LowerFuncValues) |
testTransform(t, "testdata/func-lowering", transform.LowerFuncValues) |
||||
} |
} |
||||
|
@ -1,21 +1,22 @@ |
|||||
package transform |
package transform_test |
||||
|
|
||||
import ( |
import ( |
||||
"testing" |
"testing" |
||||
|
|
||||
|
"github.com/tinygo-org/tinygo/transform" |
||||
"tinygo.org/x/go-llvm" |
"tinygo.org/x/go-llvm" |
||||
) |
) |
||||
|
|
||||
func TestAddGlobalsBitmap(t *testing.T) { |
func TestAddGlobalsBitmap(t *testing.T) { |
||||
t.Parallel() |
t.Parallel() |
||||
testTransform(t, "testdata/gc-globals", func(mod llvm.Module) { |
testTransform(t, "testdata/gc-globals", func(mod llvm.Module) { |
||||
AddGlobalsBitmap(mod) |
transform.AddGlobalsBitmap(mod) |
||||
}) |
}) |
||||
} |
} |
||||
|
|
||||
func TestMakeGCStackSlots(t *testing.T) { |
func TestMakeGCStackSlots(t *testing.T) { |
||||
t.Parallel() |
t.Parallel() |
||||
testTransform(t, "testdata/gc-stackslots", func(mod llvm.Module) { |
testTransform(t, "testdata/gc-stackslots", func(mod llvm.Module) { |
||||
MakeGCStackSlots(mod) |
transform.MakeGCStackSlots(mod) |
||||
}) |
}) |
||||
} |
} |
||||
|
@ -1,14 +1,15 @@ |
|||||
package transform |
package transform_test |
||||
|
|
||||
import ( |
import ( |
||||
"testing" |
"testing" |
||||
|
|
||||
|
"github.com/tinygo-org/tinygo/transform" |
||||
"tinygo.org/x/go-llvm" |
"tinygo.org/x/go-llvm" |
||||
) |
) |
||||
|
|
||||
func TestApplyFunctionSections(t *testing.T) { |
func TestApplyFunctionSections(t *testing.T) { |
||||
t.Parallel() |
t.Parallel() |
||||
testTransform(t, "testdata/globals-function-sections", func(mod llvm.Module) { |
testTransform(t, "testdata/globals-function-sections", func(mod llvm.Module) { |
||||
ApplyFunctionSections(mod) |
transform.ApplyFunctionSections(mod) |
||||
}) |
}) |
||||
} |
} |
||||
|
@ -1,10 +1,12 @@ |
|||||
package transform |
package transform_test |
||||
|
|
||||
import ( |
import ( |
||||
"testing" |
"testing" |
||||
|
|
||||
|
"github.com/tinygo-org/tinygo/transform" |
||||
) |
) |
||||
|
|
||||
func TestReplacePanicsWithTrap(t *testing.T) { |
func TestReplacePanicsWithTrap(t *testing.T) { |
||||
t.Parallel() |
t.Parallel() |
||||
testTransform(t, "testdata/panic", ReplacePanicsWithTrap) |
testTransform(t, "testdata/panic", transform.ReplacePanicsWithTrap) |
||||
} |
} |
||||
|
Loading…
Reference in new issue