aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/fuzzer/fuzzer_test.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2024-05-02 19:35:10 +0200
committerDmitry Vyukov <dvyukov@google.com>2024-05-03 14:25:58 +0000
commit3e60354bf2a2ad7e7fa81fe8107f3ce24e098287 (patch)
tree385a30b0529d6412b546937d85791d823567bebf /pkg/fuzzer/fuzzer_test.go
parenta3ce1723b2f8f690652d181a96344ab9b1c438a4 (diff)
executor: make flatrpc build for C++
Diffstat (limited to 'pkg/fuzzer/fuzzer_test.go')
-rw-r--r--pkg/fuzzer/fuzzer_test.go16
1 files changed, 1 insertions, 15 deletions
diff --git a/pkg/fuzzer/fuzzer_test.go b/pkg/fuzzer/fuzzer_test.go
index 5e275851a..13eb5609b 100644
--- a/pkg/fuzzer/fuzzer_test.go
+++ b/pkg/fuzzer/fuzzer_test.go
@@ -9,8 +9,6 @@ import (
"fmt"
"hash/crc32"
"math/rand"
- "os"
- "path/filepath"
"regexp"
"runtime"
"strings"
@@ -41,7 +39,7 @@ func TestFuzz(t *testing.T) {
if sysTarget.BrokenCompiler != "" {
t.Skipf("skipping, broken cross-compiler: %v", sysTarget.BrokenCompiler)
}
- executor := buildExecutor(t, target)
+ executor := csource.BuildExecutor(t, target, "../..", "-fsanitize-coverage=trace-pc", "-g")
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
@@ -318,18 +316,6 @@ func (proc *executorProc) execute(req *Request) (*Result, string, error) {
return &Result{Info: info}, "", nil
}
-func buildExecutor(t *testing.T, target *prog.Target) string {
- executor, err := csource.BuildFile(target,
- filepath.FromSlash("../../executor/executor.cc"),
- "-fsanitize-coverage=trace-pc", "-g",
- )
- if err != nil {
- t.Fatal(err)
- }
- t.Cleanup(func() { os.Remove(executor) })
- return executor
-}
-
func checkGoroutineLeaks() {
// Inspired by src/net/http/main_test.go.
buf := make([]byte, 2<<20)