add tests!

This commit is contained in:
kalmarek 2018-08-18 23:25:20 +02:00
parent b5b9917536
commit ab49755863
2 changed files with 110 additions and 1 deletions

2
.gitignore vendored
View File

@ -10,4 +10,4 @@ SL*_*
*ipynb*
*.gws
.*
*test*
tests*

109
runtests.jl Normal file
View File

@ -0,0 +1,109 @@
using Base.Test
include("main.jl")
testdir = "tests_"*string(now())
info(testdir)
mkdir(testdir)
cd(testdir)
function SL_tests(::Type{T}, args) where {T<:Union{Standard, Symmetrize}}
G = PropertyTGroups.SpecialLinearGroup(args)
args["p"] = 3
@test main(T, G) == true
println("\n"*"="^30*"\n")
begin
args["p"] = 5
G = PropertyTGroups.SpecialLinearGroup(args)
@test main(T, G) == false
args["warmstart"] = true
G = PropertyTGroups.SpecialLinearGroup(args)
@test main(T, G) == false
end
println("\n"*"="^30*"\n")
begin
args["p"] = 7
G = PropertyTGroups.SpecialLinearGroup(args)
@test main(T, G) == false
println("\n"*"="^30*"\n")
args["upper-bound"] = 0.25
G = PropertyTGroups.SpecialLinearGroup(args)
@test main(T, G) == false
end
println("\n"*"="^30*"\n")
args["N"] = 3
G = PropertyTGroups.SpecialLinearGroup(args)
@test main(T, G) == true
println("\n"*"="^30*"\n")
begin
args["p"] = 0
args["iterations"] = 50000
args["upper-bound"] = Inf
G = PropertyTGroups.SpecialLinearGroup(args)
@test main(T, G) == false
args["upper-bound"] = 0.27
args["warmstart"] = true
G = PropertyTGroups.SpecialLinearGroup(args)
@test main(T, G) == false
G = PropertyTGroups.SpecialLinearGroup(args)
@test main(T, G) == true
G = PropertyTGroups.SpecialLinearGroup(args)
@test main(T, G) == true
end
return main(T, G)
end
@testset "SLn's" begin
@testset "Non-Symmetrized" begin
args = Dict(
"N" => 2,
"p" => 3,
"X" => false,
"iterations"=>50000,
"tol"=>1e-7,
"upper-bound"=>Inf,
"cpus"=>2,
"radius"=>2,
"warmstart"=>false,
"nosymmetry"=>true,
)
@time SL_tests(Standard, args)
end
@testset "Symmetrized" begin
args = Dict(
"N" => 2,
"p" => 3,
"X" => false,
"iterations"=>50000,
"tol"=>1e-7,
"upper-bound"=>Inf,
"cpus"=>2,
"radius"=>2,
"warmstart"=>false,
"nosymmetry"=>false,
)
@time SL_tests(Symmetrize, args)
end
end