aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource/csource_test.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-09-14 21:27:56 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-09-15 16:02:37 +0200
commit19f9bc13d374058b83b2712f119bb42559b35c0c (patch)
tree2e2744f8f1e3036736e3535ae776ff1409bf5368 /pkg/csource/csource_test.go
parent52a33fd516102a98d3753bf69417235b655a68dc (diff)
pkg/csource: support archs other than x86_64
Diffstat (limited to 'pkg/csource/csource_test.go')
-rw-r--r--pkg/csource/csource_test.go24
1 files changed, 20 insertions, 4 deletions
diff --git a/pkg/csource/csource_test.go b/pkg/csource/csource_test.go
index c192566e3..2ac048da2 100644
--- a/pkg/csource/csource_test.go
+++ b/pkg/csource/csource_test.go
@@ -89,7 +89,7 @@ func allOptionsPermutations() []Options {
}
func TestOne(t *testing.T) {
- target, rs, _ := initTest(t)
+ t.Parallel()
opts := Options{
Threaded: true,
Collide: true,
@@ -99,8 +99,21 @@ func TestOne(t *testing.T) {
Repro: true,
UseTmpDir: true,
}
- p := target.GenerateAllSyzProg(rs)
- testOne(t, p, opts)
+ for _, target := range prog.AllTargets() {
+ target := target
+ t.Run(target.OS+"/"+target.Arch, func(t *testing.T) {
+ if target.OS == "linux" && target.Arch == "arm" {
+ // This currently fails (at least with my arm-linux-gnueabihf-gcc-4.8) with:
+ // Assembler messages:
+ // Error: alignment too large: 15 assumed
+ t.Skip("broken")
+ }
+ t.Parallel()
+ rs := rand.NewSource(0)
+ p := target.GenerateAllSyzProg(rs)
+ testOne(t, p, opts)
+ })
+ }
}
func TestOptions(t *testing.T) {
@@ -142,7 +155,10 @@ func testOne(t *testing.T, p *prog.Prog, opts Options) {
t.Fatalf("%v", err)
}
defer os.Remove(srcf)
- bin, err := Build("c", srcf)
+ bin, err := Build(p.Target, "c", srcf)
+ if err == NoCompilerErr {
+ t.Skip(err)
+ }
if err != nil {
t.Logf("program:\n%s\n", p.Serialize())
t.Fatalf("%v", err)