Skip to content

Commit

Permalink
move linker options testing into a separate test
Browse files Browse the repository at this point in the history
only tests on linux, but that should provide at least some coverage
  • Loading branch information
saem committed Feb 10, 2024
1 parent d9487b7 commit 08b99fe
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
4 changes: 1 addition & 3 deletions tests/vm/tcompilesetting.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
discard """
matrix: "--nimcache:build/myNimCache --nimblePath:myNimblePath --passc:'-fmax-errors=4' --passl:'-Xlinker --defsym -Xlinker dummysymboldoesnotexist=0x0'"
matrix: "--nimcache:build/myNimCache --nimblePath:myNimblePath --passc:'-fmax-errors=4'"
joinable: false
"""

Expand All @@ -13,8 +13,6 @@ template main =
doAssert querySetting(backend) == "c"
doAssert fileExists(libPath.querySetting / "system.nim")
doAssert "-fmax-errors=4" in querySetting(compileOptions)
doAssert "-Xlinker --defsym -Xlinker dummysymboldoesnotexist=0x0" in
querySetting(linkOptions)

static: main()
main()
20 changes: 20 additions & 0 deletions tests/vm/tcompilesettings_passl.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
discard """
description: "Test for `std/compilesettings` querying of linker options"
matrix: "--passl:'-Xlinker --defsym -Xlinker dummysymboldoesnotexist=0x0'"
joinable: false
disabled: windows
disabled: osx
"""

# finding a "no-op" like cross-platform linker option turned out to be a pain,
# so doing some basic testing on linux at least.

import std/[strutils, compilesettings]
from std/os import fileExists, `/`

template main =
doAssert "-Xlinker --defsym -Xlinker dummysymboldoesnotexist=0x0" in
querySetting(linkOptions)

static: main()
main()

0 comments on commit 08b99fe

Please sign in to comment.