(b *testing.B)
| 1791 | } |
| 1792 | |
| 1793 | func BenchmarkDecoderWithCustomFiles(b *testing.B) { |
| 1794 | const info = "To run benchmark on custom .zst files, please place your files in subdirectory 'testdata/benchmark-custom'.\nEach file is tested in a separate benchmark, thus it is possible to select files with the standard command 'go test -bench BenchmarkDecoderWithCustomFiles/<pattern>." |
| 1795 | |
| 1796 | const subdir = "testdata/benchmark-custom" |
| 1797 | |
| 1798 | if _, err := os.Stat(subdir); os.IsNotExist(err) { |
| 1799 | b.Skip(info) |
| 1800 | } |
| 1801 | |
| 1802 | files, err := filepath.Glob(filepath.Join(subdir, "*.zst")) |
| 1803 | if err != nil { |
| 1804 | b.Error(err) |
| 1805 | return |
| 1806 | } |
| 1807 | |
| 1808 | if len(files) == 0 { |
| 1809 | b.Skip(info) |
| 1810 | } |
| 1811 | |
| 1812 | for _, path := range files { |
| 1813 | name := filepath.Base(path) |
| 1814 | b.Run(name, func(b *testing.B) { benchmarkDecoderWithFile(path, b) }) |
| 1815 | } |
| 1816 | } |
| 1817 | |
| 1818 | func testDecoderDecodeAll(t *testing.T, fn string, dec *Decoder) { |
| 1819 | zr := testCreateZipReader(fn, t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…