From 79c331a27b0171731a16ed4411f12fabbf27c779 Mon Sep 17 00:00:00 2001 From: Azzaare Date: Tue, 28 May 2024 15:08:12 +0000 Subject: [PATCH] Fix tests --- .gitignore | 4 ++-- Project.toml | 3 ++- test/pattern_folds.jl | 51 +++++++++++++++++++++++++++++++++++++++---- test/runtests.jl | 5 ++++- 4 files changed, 55 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 9f8d11d..6ce44df 100644 --- a/.gitignore +++ b/.gitignore @@ -5,8 +5,8 @@ /docs/build/ -/test/benchmarks/ -/test/mallocs/ +/test/output/ +/test/metadata/ *~ *.swp diff --git a/Project.toml b/Project.toml index 6378696..97298c8 100644 --- a/Project.toml +++ b/Project.toml @@ -40,8 +40,9 @@ julia = "1.9" [extras] Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" +Chairmarks = "0ca39b1e-fe0b-4e98-acfc-b1656634c4de" PatternFolds = "c18a7f1d-76ad-4ce4-950d-5419b888513b" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Aqua", "BenchmarkTools", "PatternFolds", "Test"] +test = ["Aqua", "BenchmarkTools", "Chairmarks", "PatternFolds", "Test"] diff --git a/test/pattern_folds.jl b/test/pattern_folds.jl index 45e67b7..614d079 100644 --- a/test/pattern_folds.jl +++ b/test/pattern_folds.jl @@ -1,5 +1,9 @@ @testset "PatternFolds.jl" begin - x = @check :alloc Dict(:targets => ["PatternFolds"], :path => @__DIR__) begin + d = Dict( + :targets => ["PatternFolds"], :path => @__DIR__, :tags => [:patterns, :intervals], + :pkgs => ("PatternFolds", :custom, [v"0.2.1", v"0.2.4"], true)) + + x = @check :alloc d begin using PatternFolds end begin itv = Interval{Open, Closed}(0.0, 1.0) @@ -24,8 +28,47 @@ @info x - t = @check :benchmark Dict( - :path => @__DIR__, :evals => 1, :samples => 100, :seconds => 100) begin + d2 = Dict(:path => @__DIR__, :evals => 1, :samples => 100, + :seconds => 100, :tags => [:patterns, :intervals], + :pkgs => ( + "PatternFolds", :custom, [v"0.2.1", v"0.2.4"], true), + :devops => "PatternFolds") + + x2 = @check :benchmark d2 begin + using PatternFolds + end begin + # Intervals + itv = Interval{Open, Closed}(0.0, 1.0) + i = IntervalsFold(itv, 2.0, 1000) + + unfold(i) + collect(i) + reverse(collect(i)) + + # rand(i, 1000) + + # Vectors + vf = make_vector_fold([0, 1], 2, 1000) + # @info "Checking VectorFold" vf pattern(vf) gap(vf) folds(vf) length(vf) + + unfold(vf) + collect(vf) + reverse(collect(vf)) + + rand(vf, 1000) + + return nothing + end + + @info x2 + + d3 = Dict(:path => @__DIR__, :evals => 1, :samples => 100, + :seconds => 100, :tags => [:patterns, :intervals], + :pkgs => ( + "PatternFolds", :custom, [v"0.2.1", v"0.2.4"], true), + :devops => "PatternFolds") + + x3 = @check :chairmark d3 begin using PatternFolds end begin # Intervals @@ -51,5 +94,5 @@ return nothing end - @info t + @info x3 end diff --git a/test/runtests.jl b/test/runtests.jl index d2c33cb..55b7521 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -5,9 +5,12 @@ using Test @testset "Other Packages" begin using BenchmarkTools + using Chairmarks using PerfChecker - # include("compositional_networks.jl") include("pattern_folds.jl") end + + rm("metadata"; recursive = true) + rm("output"; recursive = true) end