Skip to content

Commit

Permalink
Remove file interleaving - where you say we should save, that's where…
Browse files Browse the repository at this point in the history
… we'll save
  • Loading branch information
PragTob committed Jan 3, 2018
1 parent 04508db commit c641352
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ elixir_build_*
doc
docs
/test/tmp
save.benchee
3 changes: 1 addition & 2 deletions lib/benchee/configuration.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ defmodule Benchee.Configuration do
Conversion.Duration,
Conversion.Scale,
Utility.DeepConvert,
Utility.FileCreation,
Formatters.Console
}

Expand Down Expand Up @@ -319,7 +318,7 @@ defmodule Benchee.Configuration do

tagged_save_options = %{
tag: save_options.tag,
path: FileCreation.interleave(save_options.path, save_options.tag)
path: save_options.path
}

%__MODULE__{config |
Expand Down
2 changes: 1 addition & 1 deletion samples/save_and_load.exs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Benchee.run(%{
"map.flatten" => fn -> list |> Enum.map(map_fun) |> List.flatten end
},
time: 5,
load: "save_first-try.benchee",
load: "save.benchee",
console: [extended_statistics: true]
)

Expand Down
4 changes: 2 additions & 2 deletions test/benchee/configuration_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ defmodule Benchee.ConfigurationTest do
Benchee.Formatters.Console, Benchee.Formatters.TaggedSave
]
assert suite.configuration.formatter_options.tagged_save == %{
path: "save_one_master.benchee",
path: "save_one.benchee",
tag: "master"
}
end
Expand All @@ -49,7 +49,7 @@ defmodule Benchee.ConfigurationTest do
etf_options = suite.configuration.formatter_options.tagged_save

assert etf_options.tag =~ ~r/\d\d\d\d-\d\d?-\d\d?--\d\d?-\d\d?-\d\d?/
assert String.contains?(etf_options.path, etf_options.tag)
assert etf_options.path == "save_one.benchee"
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/benchee_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ defmodule BencheeTest do
describe "save & load" do
test "saving the suite to disk and restoring it" do
save = [save: [path: "save.benchee", tag: "master"]]
expected_file = "save_master.benchee"
expected_file = "save.benchee"

try do
configuration = Keyword.merge @test_times, save
Expand Down

0 comments on commit c641352

Please sign in to comment.