Skip to content

Commit

Permalink
Merge pull request #8 from rafaqz/noprecompile
Browse files Browse the repository at this point in the history
dont test in precompile, its too slow
  • Loading branch information
rafaqz authored Jul 15, 2022
2 parents 2afdf56 + 404453d commit 15cd55f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ specifically:
- Traits: All `@implements` declarations produce compile-time traits that can be
checked by other packages - for the whole interface and all of it's optional
components.
- Tests: `@implements` declarations are automatically tested againts the interfaces
and subtypes they define, during precompilation.
- Tests: `@implements` declarations should be tested in package tests.
- Docs: interface documentation can be inserted into trait documentation.

__Note: the syntax here is likely to change over 2022 as we work out the best ways to define interfaces__
Expand Down
3 changes: 1 addition & 2 deletions src/implements.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ function _implements_inner(interface, objtype, test_objects; show=false)
Interfaces.optional_keys(::Type{<:$interfacetype}, ::Type{<:$objtype}) = $optional_keys
# Define the object to be used in interface tests
Interfaces.test_objects(::Type{<:$interfacetype}, ::Type{<:$objtype}) = Interfaces.TestObjectWrapper($test_objects)
# Run tests during precompilation
Interfaces.test($interface, $objtype; show=$show)
nothing
end |> esc
end

Expand Down
2 changes: 0 additions & 2 deletions src/test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,12 @@ function test(T::Type{<:Interface}, O::Type, objs::TestObjectWrapper;
_showresults(mandatory_results, "Mandatory components")
_showresults(optional_results, "Optional components")
end
println()
return all(_bool(mandatory_results)) && all(_bool(optional_results))
else
allcomponents = merge(components(T)...)
optional = NamedTuple{_as_tuple(keys)}(allcomponents)
results = _test(optional, objs)
show && _showresults(results, "Specified components")
println()
return all(_bool(results))
end
end
Expand Down

0 comments on commit 15cd55f

Please sign in to comment.