aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/compiler/compiler_test.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-08-27 15:08:11 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-08-27 15:28:49 +0200
commite2ffb4fc9111e28f1d8e0e987cb06172cbbd4e84 (patch)
tree8dc4d76063e3430321622cd81763a95a972f2e3a /pkg/compiler/compiler_test.go
parente71c87fbf52c83d8e514e4685d40da4d4d0f1a1c (diff)
pkg/compiler: move more const-processing code to compiler
Diffstat (limited to 'pkg/compiler/compiler_test.go')
-rw-r--r--pkg/compiler/compiler_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/pkg/compiler/compiler_test.go b/pkg/compiler/compiler_test.go
index e68d97d3e..5415234c6 100644
--- a/pkg/compiler/compiler_test.go
+++ b/pkg/compiler/compiler_test.go
@@ -4,12 +4,33 @@
package compiler
import (
+ "path/filepath"
"reflect"
+ "runtime"
"testing"
"github.com/google/syzkaller/pkg/ast"
)
+func TestCompileAll(t *testing.T) {
+ eh := func(pos ast.Pos, msg string) {
+ t.Logf("%v:%v:%v: %v", pos.File, pos.Line, pos.Col, msg)
+ }
+ desc := ast.ParseGlob(filepath.Join("..", "..", "sys", "*.txt"), eh)
+ if desc == nil {
+ t.Fatalf("parsing failed")
+ }
+ glob := filepath.Join("..", "..", "sys", "*_"+runtime.GOARCH+".const")
+ consts := DeserializeConstsGlob(glob, eh)
+ if consts == nil {
+ t.Fatalf("reading consts failed")
+ }
+ prog := Compile(desc, consts, eh)
+ if prog == nil {
+ t.Fatalf("compilation failed")
+ }
+}
+
func TestExtractConsts(t *testing.T) {
desc := ast.Parse([]byte(extractConstsInput), "test", nil)
if desc == nil {