Skip to content

Commit

Permalink
Merge branch 'CarloLucibello-update'
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebolewski committed Oct 8, 2016
2 parents 262eea6 + 3fa8a99 commit 4d94659
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 26 deletions.
25 changes: 16 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
# Documentation: http://docs.travis-ci.com/user/languages/julia/
language: julia
os:
- linux
- linux
- osx

julia:
- 0.3
- 0.4
- 0.5
- nightly
- 0.5
- nightly

notifications:
email: false
before_install:
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
#script: # use the default script setting which is equivalent to the following
# - julia -e 'Pkg.init(); Pkg.clone(pwd()); Pkg.build("PicoSAT"); Pkg.test("PicoSAT", coverage=true)'

# uncomment the following lines to override the default test script
script:
# - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
# - julia -e 'Pkg.clone(pwd()); Pkg.build("PicoSAT"); Pkg.test("PicoSAT"; coverage=true)'

after_success:
# push coverage results to Coveralls
- julia -e 'cd(Pkg.dir("PicoSAT")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
# push coverage results to Codecov
- julia -e 'cd(Pkg.dir("PicoSAT")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
julia 0.3
julia 0.5
32 changes: 32 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
environment:
matrix:
- JULIAVERSION: "julialang/bin/winnt/x64/0.5/julia-0.5-latest-win64.exe"
- JULIAVERSION: "julianightlies/bin/winnt/x64/julia-latest-win64.exe"

branches:
only:
- master
- /release-.*/

notifications:
- provider: Email
on_build_success: false
on_build_failure: false
on_build_status_changed: false

install:
# Download most recent Julia Windows binary
- ps: (new-object net.webclient).DownloadFile(
$("http://s3.amazonaws.com/"+$env:JULIAVERSION),
"C:\projects\julia-binary.exe")
# Run installer silently, output to C:\projects\julia
- C:\projects\julia-binary.exe /S /D=C:\projects\julia

build_script:
# Need to convert from shallow to complete for Pkg.clone to work
- IF EXIST .git\shallow (git fetch --unshallow)
- C:\projects\julia\bin\julia -e "versioninfo();
Pkg.clone(pwd(), \"PicoSAT\"); Pkg.build(\"PicoSAT\")"

test_script:
- C:\projects\julia\bin\julia -e "Pkg.test(\"PicoSAT\")"
4 changes: 2 additions & 2 deletions deps/build.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@unix_only begin
@static if is_unix()
run(`make libpicosat.so`)
end
@windows_only begin
@static if is_windows()
error("PicoSAT.jl does not currently work on Windows")
end
20 changes: 10 additions & 10 deletions examples/pkg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@

import PicoSAT

index = {
"a" => {:depends => ["b", "c", "z"]},
"b" => {:depends => ["d"]},
"c" => {:depends => ["d|e", "f|g"]},
"d" => {:conflicts => ["e"]},
"e" => {:conflicts => ["d"]},
"f" => {:conflicts => ["g"]},
"g" => {:conflicts => ["f"]},
"y" => {:depends => ["z"]},
index = Dict(
"a" => Dict(:depends => ["b", "c", "z"]),
"b" => Dict(:depends => ["d"]),
"c" => Dict(:depends => ["d|e", "f|g"]),
"d" => Dict(:conflicts => ["e"]),
"e" => Dict(:conflicts => ["d"]),
"f" => Dict(:conflicts => ["g"]),
"g" => Dict(:conflicts => ["f"]),
"y" => Dict(:depends => ["z"]),
"z" => Dict{Any,Any}()
}
)

name2var = Dict{Any,Any}()
var2name = Dict{Any,Any}()
Expand Down
7 changes: 4 additions & 3 deletions src/PicoSAT.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ module PicoSAT

export solve, itersolve

@unix_only begin
@static if is_unix()
const libpicosat = joinpath(dirname(@__FILE__), "..", "deps", "libpicosat.so")
end
@windows_only begin
@static if is_windows()
error("PicoSAT.jl does not currently work on Windows")
end

Expand Down Expand Up @@ -40,7 +40,7 @@ picosat_measure_all_calls(p::PicoPtr) =
# Set the prefix used for printing verbose messages and statistics.
# (Default is "c ")

picosat_set_prefix(p::PicoPtr, str::ByteString) =
picosat_set_prefix(p::PicoPtr, str::String) =
ccall((:picosat_set_prefix, libpicosat), Void, (PicoPtr,Ptr{Cchar}), p, str)

# Set verbosity level
Expand Down Expand Up @@ -247,4 +247,5 @@ Base.next(it::PicoSolIterator, state) = begin
(state[1], (sol, satisfiable(sol)))
end

Base.iteratorsize(it::PicoSolIterator) = Base.SizeUnknown()
end # module
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function testsolution(clauses, sol)
for clause in clauses
nonetrue = true
for i in clause
if bool(vars[abs(i)] $ (i < 0))
if Bool(vars[abs(i)] $ (i < 0))
nonetrue = false
end
end
Expand Down

0 comments on commit 4d94659

Please sign in to comment.