-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add ForwardDiff dependency and setup safetestsets
- Loading branch information
1 parent
41e5d3d
commit 85cb9e5
Showing
5 changed files
with
25 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
module MyExample | ||
|
||
using ForwardDiff | ||
|
||
greet() = print("Hello World!") | ||
|
||
include("extra_file.jl") | ||
|
||
export my_f | ||
export my_f, derivative_of_my_f | ||
|
||
end # module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
my_f(x,y) = 2x+3y | ||
derivative_of_my_f(x,y) = ForwardDiff.derivative(x->my_f(x,y),x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using MyExample | ||
using Test | ||
|
||
@testset "MyExample.jl" begin | ||
# 2x + 3y | ||
@test my_f(2,1) == 7 | ||
@test my_f(2,3) == 13 | ||
@test my_f(1,3) == 11 | ||
end | ||
|
||
@testset "Derivative Tests" begin | ||
@test derivative_of_my_f(2,1) == 2 | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,2 @@ | ||
using MyExample | ||
using Test | ||
|
||
@testset "MyExample.jl" begin | ||
# 2x + 3y | ||
@test my_f(2,1) == 7 | ||
@test my_f(2,3) == 13 | ||
@test my_f(1,3) == 11 | ||
end | ||
using SafeTestsets | ||
@safetestset "My f tests" begin include("my_f_tests.jl") end |