Skip to content

Commit 21c69be

Browse files
authored
Add basic tests. (#1)
* Add basic tests.
1 parent b55c403 commit 21c69be

File tree

3 files changed

+25
-17
lines changed

3 files changed

+25
-17
lines changed

.travis.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
## Documentation: http://docs.travis-ci.com/user/languages/julia/
22
language: julia
33
os:
4-
- linux
5-
- osx
4+
- linux
5+
- osx
66
julia:
7-
- 0.6
8-
- nightly
7+
- 0.6
8+
- nightly
9+
matrix:
10+
allow_failures:
11+
- julia: nightly
912
notifications:
1013
email: false
1114
git:

appveyor.yml

+6-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
environment:
22
matrix:
3-
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe"
4-
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
5-
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
6-
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
7-
8-
## uncomment the following lines to allow failures on nightly julia
9-
## (tests will run but not make your overall status red)
10-
#matrix:
11-
# allow_failures:
12-
# - JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
13-
# - JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
14-
3+
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe"
4+
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
5+
matrix:
6+
allow_failures:
7+
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
8+
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
159
branches:
1610
only:
1711
- master

test/runtests.jl

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
using OptimTestProblems
22
using Base.Test
33

4-
@test true
4+
uvp = OptimTestProblems.UnivariateProblems.examples
5+
for (name, p) in uvp
6+
for (miz, mia) in zip(p.minimizers, p.minima)
7+
@test p.f(miz) mia
8+
end
9+
end
10+
mvp = OptimTestProblems.UnconstrainedProblems.examples
11+
for (name, p) in mvp
12+
gs = similar(p.initial_x)
13+
p.g!(gs, p.solutions)
14+
@test sum(gs) - zero(eltype(gs)) < 1e-32
15+
end

0 commit comments

Comments
 (0)