github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/pkg/cover/backend/modules_test.go (about)

     1  // Copyright 2021 syzkaller project authors. All rights reserved.
     2  // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
     3  
     4  package backend
     5  
     6  import (
     7  	"flag"
     8  	"testing"
     9  )
    10  
    11  var flagModuleDir = flag.String("module_dir", "", "directory to discover modules")
    12  
    13  func TestLocateModules(t *testing.T) {
    14  	// Dump modules discovered in a dir, not really an automated test, use as:
    15  	// go test -run TestLocateModules -v ./pkg/cover/backend -module_dir=/linux/build/dir
    16  	if *flagModuleDir == "" {
    17  		t.Skip("no module dir specified")
    18  	}
    19  	paths, err := locateModules([]string{*flagModuleDir})
    20  	if err != nil {
    21  		t.Fatal(err)
    22  	}
    23  	for name, path := range paths {
    24  		t.Logf("%32v -> %v", name, path)
    25  	}
    26  }