parent
4007b2a778
commit
a2ec2db8f2
5 changed files with 45 additions and 22 deletions
33
.travis.yml
33
.travis.yml
|
|
@ -1,4 +1,5 @@
|
||||||
os:
|
os:
|
||||||
|
- windows
|
||||||
- linux
|
- linux
|
||||||
- osx
|
- osx
|
||||||
|
|
||||||
|
|
@ -7,23 +8,37 @@ language: c
|
||||||
env:
|
env:
|
||||||
- BRANCH=0.19.6
|
- BRANCH=0.19.6
|
||||||
- BRANCH=0.20.2
|
- BRANCH=0.20.2
|
||||||
|
- BRANCH=1.0.0
|
||||||
# This is the latest working Nim version against which Nimble is being tested
|
# This is the latest working Nim version against which Nimble is being tested
|
||||||
- BRANCH=#2565d3d102efd21ba02ed1f3b96d892fe2637d2b
|
- BRANCH=#16c39f9b2edc963655889cfd33e165bfae91c96d
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
- "$HOME/.choosenim/toolchains/nim-0.19.6"
|
- "$HOME/.nimble/bin"
|
||||||
- "$HOME/.choosenim/toolchains/nim-0.20.2"
|
- "$HOME/.choosenim"
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- export CHOOSENIM_CHOOSE_VERSION=$BRANCH
|
|
||||||
- |
|
|
||||||
curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh
|
|
||||||
sh init.sh -y
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- export CHOOSENIM_NO_ANALYTICS=1
|
- export CHOOSENIM_NO_ANALYTICS=1
|
||||||
- export PATH=$HOME/.nimble/bin:$PATH
|
- export PATH=$HOME/.nimble/bin:$PATH
|
||||||
|
- |
|
||||||
|
if ! type -P choosenim &> /dev/null; then
|
||||||
|
if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
|
||||||
|
# Latest choosenim binary doesn't have
|
||||||
|
# https://github.com/dom96/choosenim/pull/117
|
||||||
|
# https://github.com/dom96/choosenim/pull/135
|
||||||
|
#
|
||||||
|
# Using custom build with these PRs for Windows
|
||||||
|
curl -L -s "https://bintray.com/genotrance/binaries/download_file?file_path=choosenim.exe" -o choosenim.exe
|
||||||
|
curl -L -s "https://bintray.com/genotrance/binaries/download_file?file_path=libeay32.dll" -o libeay32.dll
|
||||||
|
curl -L -s "https://bintray.com/genotrance/binaries/download_file?file_path=ssleay32.dll" -o ssleay32.dll
|
||||||
|
./choosenim.exe $BRANCH -y
|
||||||
|
cp ./choosenim.exe $HOME/.nimble/bin/.
|
||||||
|
else
|
||||||
|
export CHOOSENIM_CHOOSE_VERSION=$BRANCH
|
||||||
|
curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh
|
||||||
|
sh init.sh -y
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- cd tests
|
- cd tests
|
||||||
|
|
|
||||||
|
|
@ -1063,7 +1063,11 @@ proc test(options: Options) =
|
||||||
existsAfter = existsFile(binFileName)
|
existsAfter = existsFile(binFileName)
|
||||||
canRemove = not existsBefore and existsAfter
|
canRemove = not existsBefore and existsAfter
|
||||||
if canRemove:
|
if canRemove:
|
||||||
removeFile(binFileName)
|
try:
|
||||||
|
removeFile(binFileName)
|
||||||
|
except OSError as exc:
|
||||||
|
display("Warning:", "Failed to delete " & binFileName & ": " &
|
||||||
|
exc.msg, Warning, MediumPriority)
|
||||||
|
|
||||||
if failures == 0:
|
if failures == 0:
|
||||||
display("Success:", "All tests passed", Success, HighPriority)
|
display("Success:", "All tests passed", Success, HighPriority)
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -9,10 +9,9 @@ license = "BSD"
|
||||||
|
|
||||||
requires "nim >= 0.12.1"
|
requires "nim >= 0.12.1"
|
||||||
|
|
||||||
when defined(windows):
|
let
|
||||||
let callNimble = "..\\..\\src\\nimble.exe"
|
callNimble = getEnv("NIMBLE_TEST_BINARY_PATH")
|
||||||
else:
|
doAssert callNimble.len != 0, "NIMBLE_TEST_BINARY_PATH not set"
|
||||||
let callNimble = "../../src/nimble"
|
|
||||||
|
|
||||||
task recurse, "Level 1":
|
task recurse, "Level 1":
|
||||||
echo 1
|
echo 1
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,9 @@ var installDir = rootDir / "tests" / "nimbleDir"
|
||||||
const path = "../src/nimble"
|
const path = "../src/nimble"
|
||||||
const stringNotFound = -1
|
const stringNotFound = -1
|
||||||
|
|
||||||
|
# Set env var to propagate nimble binary path
|
||||||
|
putEnv("NIMBLE_TEST_BINARY_PATH", nimblePath)
|
||||||
|
|
||||||
# Clear nimble dir.
|
# Clear nimble dir.
|
||||||
removeDir(installDir)
|
removeDir(installDir)
|
||||||
createDir(installDir)
|
createDir(installDir)
|
||||||
|
|
@ -480,17 +483,17 @@ test "issue #349":
|
||||||
]
|
]
|
||||||
|
|
||||||
proc checkName(name: string) =
|
proc checkName(name: string) =
|
||||||
when defined(windows):
|
|
||||||
if name.toLowerAscii() in @["con", "nul"]:
|
|
||||||
return
|
|
||||||
let (outp, code) = execNimble("init", "-y", name)
|
let (outp, code) = execNimble("init", "-y", name)
|
||||||
let msg = outp.strip.processOutput()
|
let msg = outp.strip.processOutput()
|
||||||
check code == QuitFailure
|
check code == QuitFailure
|
||||||
check inLines(msg,
|
check inLines(msg,
|
||||||
"\"$1\" is an invalid package name: reserved name" % name)
|
"\"$1\" is an invalid package name: reserved name" % name)
|
||||||
removeFile(name.changeFileExt("nimble"))
|
try:
|
||||||
removeDir("src")
|
removeFile(name.changeFileExt("nimble"))
|
||||||
removeDir("tests")
|
removeDir("src")
|
||||||
|
removeDir("tests")
|
||||||
|
except OSError:
|
||||||
|
discard
|
||||||
|
|
||||||
for reserved in reservedNames:
|
for reserved in reservedNames:
|
||||||
checkName(reserved.toUpperAscii())
|
checkName(reserved.toUpperAscii())
|
||||||
|
|
@ -930,7 +933,8 @@ suite "nimble run":
|
||||||
"blahblah", # The command to run
|
"blahblah", # The command to run
|
||||||
)
|
)
|
||||||
check exitCode == QuitFailure
|
check exitCode == QuitFailure
|
||||||
check output.contains("Binary 'blahblah' is not defined in 'run' package.")
|
check output.contains("Binary '$1' is not defined in 'run' package." %
|
||||||
|
"blahblah".changeFileExt(ExeExt))
|
||||||
|
|
||||||
test "Parameters passed to executable":
|
test "Parameters passed to executable":
|
||||||
cd "run":
|
cd "run":
|
||||||
|
|
@ -942,7 +946,8 @@ suite "nimble run":
|
||||||
"check" # Second argument passed to the executed command.
|
"check" # Second argument passed to the executed command.
|
||||||
)
|
)
|
||||||
check exitCode == QuitSuccess
|
check exitCode == QuitSuccess
|
||||||
check output.contains("tests/run/run --debug check")
|
check output.contains("tests$1run$1$2 --debug check" %
|
||||||
|
[$DirSep, "run".changeFileExt(ExeExt)])
|
||||||
check output.contains("""Testing `nimble run`: @["--debug", "check"]""")
|
check output.contains("""Testing `nimble run`: @["--debug", "check"]""")
|
||||||
|
|
||||||
test "NimbleVersion is defined":
|
test "NimbleVersion is defined":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue