mirror of
https://github.com/JuliaFEM/JuliaFEM.jl.git
synced 2026-09-11 22:21:52 +00:00
removed old and obsolete files
This commit is contained in:
@@ -1,67 +0,0 @@
|
||||
# This file is a part of Julia. License is MIT: http://julialang.org/license
|
||||
|
||||
@doc """
|
||||
|
||||
`tests, net_on = choosetests(choices)` selects a set of tests to be
|
||||
run. `choices` should be a vector of test names; if empty or set to
|
||||
`["all"]`, all tests are selected.
|
||||
|
||||
This function also supports "test collections": specifically, "linalg"
|
||||
refers to collections of tests in the correspondingly-named
|
||||
directories.
|
||||
|
||||
Upon return, `tests` is a vector of fully-expanded test names, and
|
||||
`net_on` is true if networking is available (required for some tests).
|
||||
""" ->
|
||||
function choosetests(choices = [])
|
||||
testnames = [
|
||||
"testing_testing"
|
||||
]
|
||||
|
||||
if Base.USE_GPL_LIBS && 1 == 0
|
||||
testnames = [testnames, "fft", "dsp"; ]
|
||||
end
|
||||
|
||||
if isdir(joinpath(JULIA_HOME, Base.DOCDIR, "examples")) && 1 == 0
|
||||
push!(testnames, "examples")
|
||||
end
|
||||
|
||||
# parallel tests depend on other workers - do them last
|
||||
#push!(testnames, "parallel")
|
||||
|
||||
tests = (ARGS==["all"] || isempty(ARGS)) ? testnames : ARGS
|
||||
|
||||
if "linalg" in tests
|
||||
# specifically selected case
|
||||
filter!(x -> x != "linalg", tests)
|
||||
linalgtests = ["linalg1", "linalg2", "linalg3", "linalg4",
|
||||
"linalg/lapack", "linalg/triangular", "linalg/tridiag",
|
||||
"linalg/bidiag", "linalg/diagonal",
|
||||
"linalg/pinv", "linalg/givens", "linalg/cholesky", "linalg/lu",
|
||||
"linalg/symmetric"]
|
||||
if Base.USE_GPL_LIBS
|
||||
push!(linalgtests, "linalg/arnoldi")
|
||||
end
|
||||
prepend!(tests, linalgtests)
|
||||
end
|
||||
|
||||
net_required_for = []
|
||||
net_on = true
|
||||
try
|
||||
getipaddr()
|
||||
catch
|
||||
warn("Networking unavailable: Skipping tests [" * join(net_required_for, ", ") * "]")
|
||||
net_on = false
|
||||
end
|
||||
|
||||
if ccall(:jl_running_on_valgrind,Cint,()) != 0 && "rounding" in tests
|
||||
warn("Running under valgrind: Skipping rounding tests")
|
||||
filter!(x -> x != "rounding", tests)
|
||||
end
|
||||
|
||||
if !net_on
|
||||
filter!(x -> !(x in net_required_for), tests)
|
||||
end
|
||||
|
||||
tests, net_on
|
||||
end
|
||||
@@ -1,19 +0,0 @@
|
||||
# This file is a part of Julia. License is MIT: http://julialang.org/license
|
||||
|
||||
include("choosetests.jl")
|
||||
tests, net_on = choosetests(ARGS)
|
||||
cd(dirname(@__FILE__)) do
|
||||
n = 1
|
||||
if net_on
|
||||
n = min(8, CPU_CORES, length(tests))
|
||||
n > 1 && addprocs(n; exeflags=`--check-bounds=yes`)
|
||||
blas_set_num_threads(1)
|
||||
end
|
||||
|
||||
@everywhere include("testdefs.jl")
|
||||
|
||||
reduce(propagate_errors, nothing, pmap(runtests, tests; err_retry=false, err_stop=true))
|
||||
|
||||
@unix_only n > 1 && rmprocs(workers(), waitfor=5.0)
|
||||
println(" \033[32;1mSUCCESS\033[0m")
|
||||
end
|
||||
@@ -1,141 +0,0 @@
|
||||
using JuliaFEM
|
||||
using Base.Test
|
||||
using Logging
|
||||
@Logging.configure(level=DEBUG)
|
||||
|
||||
function test_create_model()
|
||||
m = new_model()
|
||||
fn = fieldnames(m)
|
||||
@test :model in fn
|
||||
@test :nodes in fn
|
||||
@test :elements in fn
|
||||
@test :element_nodes in fn
|
||||
@test :element_gauss_points in fn
|
||||
end
|
||||
test_create_model()
|
||||
|
||||
|
||||
function test_add_field()
|
||||
m = new_model()
|
||||
field = new_field(m.elements, "color")
|
||||
@test "color" in keys(m.elements)
|
||||
end
|
||||
test_add_field()
|
||||
|
||||
|
||||
function test_get_field()
|
||||
m = new_model()
|
||||
field = new_field(m.elements, "color")
|
||||
field[1] = "red" # set element 1 field value to "red"
|
||||
field2 = get_field(m.elements, "color") # get color field
|
||||
@test field2[1] == "red"
|
||||
end
|
||||
test_get_field()
|
||||
|
||||
|
||||
function test_get_field_if_it_doesnt_exist()
|
||||
m = new_model()
|
||||
# FIXME: how to test exception?
|
||||
# @assert "throw error when" field = get_field(m.elements, "temperature")
|
||||
field = get_field(m.elements, "temperature"; create_if_doesnt_exist=true)
|
||||
field[1] = 173
|
||||
field2 = get_field(m.elements, "temperature")
|
||||
@test field2[1] == 173
|
||||
end
|
||||
test_get_field_if_it_doesnt_exist()
|
||||
|
||||
function test_get_field_throw_exception()
|
||||
m = new_model()
|
||||
@test_throws ASCIIString get_field(m.elements, "temperature")
|
||||
end
|
||||
test_get_field_throw_exception()
|
||||
|
||||
function test_add_and_get_nodes()
|
||||
m = new_model()
|
||||
nodes = Dict(1 => [0.0, 0.0, 0.0],
|
||||
2 => [1.0, 0.0, 0.0],
|
||||
3 => [0.0, 1.0, 0.0],
|
||||
4 => [0.0, 0.0, 1.0])
|
||||
add_nodes(m, nodes)
|
||||
subset = get_nodes(m, [2, 3])
|
||||
@test length(subset) == 2
|
||||
@test subset[2] == [1.0, 0.0, 0.0]
|
||||
@test subset[3] == [0.0, 1.0, 0.0]
|
||||
end
|
||||
test_add_and_get_nodes()
|
||||
|
||||
|
||||
|
||||
function test_print()
|
||||
lines_with_print = Dict()
|
||||
#src = readdir("/src")
|
||||
#src_dir = "/home/travis/build/ovainola/JuliaFEM/src"
|
||||
src_dir = "../src"
|
||||
src = readdir(src_dir)
|
||||
for file_name in src
|
||||
fil = open(joinpath(src_dir,file_name),"r")
|
||||
for line in readlines(fil)
|
||||
if ismatch(r"print",line)
|
||||
lines_with_print[file_name] = "print"
|
||||
end
|
||||
end
|
||||
close(fil)
|
||||
end
|
||||
#@test lines_with_print == Dict()
|
||||
@debug("number of lines with print = ", length(lines_with_print))
|
||||
@debug(lines_with_print)
|
||||
@test length(lines_with_print) == 0
|
||||
end
|
||||
test_print()
|
||||
|
||||
|
||||
|
||||
function test_add_element()
|
||||
m = new_model()
|
||||
nodes = Dict(1 => [0.0, 0.0, 0.0],
|
||||
2 => [1.0, 0.0, 0.0],
|
||||
3 => [0.0, 1.0, 0.0],
|
||||
4 => [0.0, 0.0, 1.0])
|
||||
add_nodes(m, nodes)
|
||||
el1 = Dict("element_type" => 0x6, "node_ids" => [1, 2, 3, 4])
|
||||
el2 = Dict("element_type" => 0x6, "node_ids" => [4, 3, 2, 1])
|
||||
elements = Dict(1 => el1, 2 => el2)
|
||||
add_elements(m, elements)
|
||||
@debug(m)
|
||||
@test m.elements["element_type"][1] == 0x6
|
||||
@test m.elements["connectivity"][1] == [1, 2, 3, 4]
|
||||
end
|
||||
test_add_element()
|
||||
|
||||
|
||||
function test_get_element()
|
||||
m = new_model()
|
||||
nodes = Dict(1 => [0.0, 0.0, 0.0],
|
||||
2 => [1.0, 0.0, 0.0],
|
||||
3 => [0.0, 1.0, 0.0],
|
||||
4 => [0.0, 0.0, 1.0])
|
||||
add_nodes(m, nodes)
|
||||
el1 = Dict("element_type" => 0x6, "node_ids" => [1, 2, 3, 4])
|
||||
el2 = Dict("element_type" => 0x6, "node_ids" => [4, 3, 2, 1])
|
||||
elements = Dict(1 => el1, 2 => el2)
|
||||
#println(elements)
|
||||
add_elements(m, elements)
|
||||
#println(m)
|
||||
# get elements by element id
|
||||
els = get_elements(m, [1])
|
||||
#println(els)
|
||||
@test length(els) == 1
|
||||
@test 1 in keys(els)
|
||||
@test els[1]["element_type"] == 0x6
|
||||
@test els[1]["node_ids"] == [1, 2, 3, 4]
|
||||
end
|
||||
test_get_element()
|
||||
|
||||
|
||||
|
||||
include("test_xdmf.jl")
|
||||
include("solver_tests/test_elasticity_solver.jl")
|
||||
|
||||
# write your own tests here
|
||||
# @test 1 == JuliaFEM.test()
|
||||
# @test_approx_eq 1.0 1.0
|
||||
@@ -1,23 +0,0 @@
|
||||
# This file is a part of Julia. License is MIT: http://julialang.org/license
|
||||
|
||||
using Base.Test
|
||||
|
||||
function runtests(name)
|
||||
@printf(" \033[1m*\033[0m \033[31m%-20s\033[0m", name)
|
||||
tt = @elapsed Core.include(abspath("$name.jl"))
|
||||
@printf(" in %6.2f seconds\n", tt)
|
||||
nothing
|
||||
end
|
||||
|
||||
function propagate_errors(a,b)
|
||||
if isa(a,Exception)
|
||||
rethrow(a)
|
||||
end
|
||||
if isa(b,Exception)
|
||||
rethrow(b)
|
||||
end
|
||||
nothing
|
||||
end
|
||||
|
||||
# looking in . messes things up badly
|
||||
filter!(x->x!=".", LOAD_PATH)
|
||||
@@ -1,8 +0,0 @@
|
||||
# This file is a part of JuliaFEM. License is MIT: https://github.com/ovainola/JuliaFEM/blob/master/README.md
|
||||
|
||||
using JuliaFEM
|
||||
using Base.Test
|
||||
|
||||
@test 1 == 1
|
||||
|
||||
@test_approx_eq 1.0 1.0
|
||||
Reference in New Issue
Block a user