GetSubject returns the testing subject based on INSTALLED flag.
()
| 51 | |
| 52 | // GetSubject returns the testing subject based on INSTALLED flag. |
| 53 | func GetSubject() (string, error) { |
| 54 | wd, err := os.Getwd() |
| 55 | if err != nil { |
| 56 | return "", fmt.Errorf("failed to get the current working directory: %w", err) |
| 57 | } |
| 58 | |
| 59 | subject := filepath.Join(wd, "../../_output/bin/finch") |
| 60 | if *Installed { |
| 61 | subject = InstalledTestSubject |
| 62 | } |
| 63 | return subject, nil |
| 64 | } |
| 65 | |
| 66 | // Wrapper reports the benchmarking metrics of targetFunc to testing.B. |
| 67 | func Wrapper(b *testing.B, targetFunc func(), cleanupFunc func()) { |