From 19f9bc13d374058b83b2712f119bb42559b35c0c Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 14 Sep 2017 21:27:56 +0200 Subject: pkg/csource: support archs other than x86_64 --- pkg/csource/csource_test.go | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'pkg/csource/csource_test.go') 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) -- cgit mrf-deployment