Skip to content

Commit

Permalink
Fix missing binaries' extensions in "nimble dump"
Browse files Browse the repository at this point in the history
Fixes #941
  • Loading branch information
bobeff committed Sep 20, 2021
1 parent 820e609 commit 00d088e
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/nimble.nim
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ proc dump(options: Options) =
fn "installFiles", p.installFiles
fn "installExt", p.installExt
fn "requires", p.requires
fn "bin", toSeq(p.bin.values)
fn "bin", p.bin.keys.toSeq
fn "binDir", p.binDir
fn "srcDir", p.srcDir
fn "backend", p.backend
Expand Down
1 change: 1 addition & 0 deletions tests/issue941/config.nims
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
switch("app", "lib")
16 changes: 16 additions & 0 deletions tests/issue941/issue941.nimble
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Package

version = "0.1.0"
author = "Ivan Bobev"
description = "A new awesome nimble package"
license = "MIT"
srcDir = "src"

bin = @[projectName()]

import std/os
for name in bin:
namedBin[name] = name.toDll()

# Dependencies
requires "nim >= 1.5.1"
7 changes: 7 additions & 0 deletions tests/issue941/src/issue941.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This is just an example to get you started. A typical library package
# exports the main API in this file. Note that you cannot rename this file
# but you can remove it if you wish.

proc add*(x, y: int): int =
## Adds two files together.
return x + y
24 changes: 24 additions & 0 deletions tests/tissues.nim
Original file line number Diff line number Diff line change
Expand Up @@ -390,3 +390,27 @@ suite "issues":
let lines = output.strip.processOutput()
check exitCode != QuitSuccess
check inLines(lines, "Nothing to build")

test "issue #941 (add binaries' extensions in nimble dump command)":
cd "issue941":
let (output, exitCode) = execNimble("dump")
check exitCode == QuitSuccess
const expectedOutput = """
name: "issue941"
version: "0.1.0"
author: "Ivan Bobev"
desc: "A new awesome nimble package"
license: "MIT"
skipDirs: ""
skipFiles: ""
skipExt: "nim"
installDirs: ""
installFiles: ""
installExt: ""
requires: "nim >= 1.5.1"
bin: "libissue941.so"
binDir: ""
srcDir: "src"
backend: "c"
"""
check output == expectedOutput

0 comments on commit 00d088e

Please sign in to comment.