Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update syntax for Julia v1 #4

Merged
merged 7 commits into from
Aug 26, 2019
Merged

Update syntax for Julia v1 #4

merged 7 commits into from
Aug 26, 2019

Conversation

nickrobinson251
Copy link
Contributor

@nickrobinson251 nickrobinson251 commented Aug 12, 2019

@iamed2
Copy link
Member

iamed2 commented Aug 12, 2019

The commit that moved it out was JuliaLang/julia@a0b7a76

@iamed2
Copy link
Member

iamed2 commented Aug 12, 2019

Try removing appveyor and using Travis Windows (just add windows as an OS)

test/runtests.jl Outdated
using Test

@testset "ReadWriteLocks" begin
include("singlethreaded.jl")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the "Two-threaded tests" testset?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you named it 😆 I will just move them into the runtests file 😄

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh lol, maybe because they were never actually run on multiple threads?

@@ -49,7 +39,7 @@ write_lock(rwlock::ReadWriteLock) = rwlock.write_lock

function lock!(read_lock::ReadLock)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This API should be changed to match the AbstractLock API, including the other API functions like trylock.

Copy link
Contributor Author

@nickrobinson251 nickrobinson251 Aug 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean also rename lock -> lock! (even though we mutate the rwlock.readers)?

#5

src/ReadWriteLocks.jl Outdated Show resolved Hide resolved
for i = 1:NUM_LOCKS
@fact lock!(rlock) --> nothing
@fact rwlock.readers --> i
@test lock!(rlock) == nothing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to do any tests of the return values of lock and unlock anymore. We can just call the functions.

FactCheck was not as good as Test at handling errors outside of tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, changing all cases of @test [un]lock!(x) == nothing -> [un]lock!(x) causes tests to fail -- we hit code we were not hitting before 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Push a commit that does that so I can see

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol okay put them back I guess? Bizarre.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted 🤷‍♂

test/runtests.jl Outdated
using ReadWriteLocks
using Test

@testset "ReadWriteLocks" begin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that Julia 1.2 and 1.3 exist, we should add tests using actual threads. We can talk about that on Slack.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in case we do this in a follow-up PR, opened #6

@codecov
Copy link

codecov bot commented Aug 12, 2019

Codecov Report

Merging #4 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master     #4   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines          41     39    -2     
=====================================
- Hits           41     39    -2
Impacted Files Coverage Δ
src/ReadWriteLocks.jl 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4dc900b...85ceec7. Read the comment docs.

@iamed2 iamed2 merged commit fe982c1 into master Aug 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants