diff options
| author | Grigory Bazilevich <g.bazilevich@ispras.ru> | 2025-10-28 00:24:01 +0300 |
|---|---|---|
| committer | Grigory Bazilevich <g.bazilevich@ispras.ru> | 2026-03-12 11:30:09 +0300 |
| commit | 105bd23a6d77b662b643cf15a2e75cca87b2e2fd (patch) | |
| tree | 97c60754243027ed63a610a9d593519c39dca86c /pkg | |
| parent | 7bbc9c041ae98694a0738b4141920ccfce987bd3 (diff) | |
pkg/csource: build tests without warnings
Otherwise syz-ci will fail to build the project.
Signed-off-by: Denis Efremov <efremov@ispras.ru>
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/csource/csource_test.go | 2 | ||||
| -rw-r--r-- | pkg/runtest/run.go | 8 | ||||
| -rw-r--r-- | pkg/runtest/run_test.go | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/pkg/csource/csource_test.go b/pkg/csource/csource_test.go index 9e9dadf86..39f1d71c3 100644 --- a/pkg/csource/csource_test.go +++ b/pkg/csource/csource_test.go @@ -149,7 +149,7 @@ func testOne(t *testing.T, p *prog.Prog, opts Options) { t.Fatalf("source contains leftover include guards: %v\nopts: %+v\nprogram:\n%s", matches, opts, p.Serialize()) } - bin, err := Build(p.Target, src) + bin, err := BuildNoWarn(p.Target, src) if err != nil { if atomic.AddUint32(&failedTests, 1) > maxFailures { t.Fatal() diff --git a/pkg/runtest/run.go b/pkg/runtest/run.go index 716ebbc56..5c80c2f65 100644 --- a/pkg/runtest/run.go +++ b/pkg/runtest/run.go @@ -305,7 +305,8 @@ nextSandbox: } func parseProg(target *prog.Target, dir, filename string, requires map[string]bool) ( - *prog.Prog, map[string]bool, *flatrpc.ProgInfo, error) { + *prog.Prog, map[string]bool, *flatrpc.ProgInfo, error, +) { data, err := os.ReadFile(filepath.Join(dir, filename)) if err != nil { return nil, nil, nil, fmt.Errorf("failed to read %v: %w", filename, err) @@ -369,7 +370,8 @@ func parseProg(target *prog.Target, dir, filename string, requires map[string]bo } func (rt *Context) produceTest(req *runRequest, name string, properties, - requires map[string]bool, results *flatrpc.ProgInfo) { + requires map[string]bool, results *flatrpc.ProgInfo, +) { req.name = name req.results = results if !manager.MatchRequirements(properties, requires) { @@ -398,7 +400,7 @@ func (rt *Context) createTest(req *runRequest) { req.err = fmt.Errorf("failed to create C source: %w", err) req.Request.Done(&queue.Result{}) } - bin, err := csource.Build(rt.Target, src) + bin, err := csource.BuildNoWarn(rt.Target, src) if err != nil { req.err = fmt.Errorf("failed to build C program: %w", err) req.Request.Done(&queue.Result{}) diff --git a/pkg/runtest/run_test.go b/pkg/runtest/run_test.go index 14c643bba..1a97e9e45 100644 --- a/pkg/runtest/run_test.go +++ b/pkg/runtest/run_test.go @@ -62,7 +62,7 @@ func test(t *testing.T, sysTarget *targets.Target) { if err != nil { t.Fatal(err) } - executor := csource.BuildExecutor(t, target, "../../", "-fsanitize-coverage=trace-pc") + executor := csource.BuildExecutor(t, target, "../../", "-fsanitize-coverage=trace-pc", "-fpermissive", "-w") calls := make(map[*prog.Syscall]bool) for _, call := range target.Syscalls { calls[call] = true |
