Files
releases/ast/testdata
Stephan Renatus c23bf8d451 fuzz: add golang-native fuzzing to nightly tests (#3940)
This installs gotip (the lastest build) and uses its (beta) fuzzing feature in
the nightly tests.

We can remove the previous setup at a later date.

The "seed corpus" was converted from the previous fuzzer's using this script:

    package main

    import (
    	"bytes"
    	"fmt"
    	"io/ioutil"
    	"log"
    	"path/filepath"
    )

    const oldCorpusDir = "build/fuzzer/corpus/"
    const newCorpusDir = "ast/testdata/fuzz/FuzzParseStatementsAndCompileModules"

    func main() {
    	files, err := ioutil.ReadDir(oldCorpusDir)
    	if err != nil {
    		log.Fatal(err)
    	}
    	for _, f := range files {
    		c, err := ioutil.ReadFile(filepath.Join(oldCorpusDir, f.Name()))
    		if err != nil {
    			log.Fatal(err)
    		}
    		buf := bytes.Buffer{}
    		buf.WriteString("go test fuzz v1\n")
    		fmt.Fprintf(&buf, "string(%q)\n", string(c))
    		err = ioutil.WriteFile(filepath.Join(newCorpusDir, f.Name()), buf.Bytes(), 0644)
    		if err != nil {
    			log.Fatal(err)
    		}
    	}
    }

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
2021-10-29 13:50:47 +02:00
..