Skip to content

Commit

Permalink
nimble install nimble works again in posix adds test
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgomez committed Dec 5, 2024
1 parent e12f715 commit 6a7179c
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,4 @@ src/nimblepkg/version
nimble-guide/site/
!nimble-guide/config.nims
githubcom_*
nimbledeps
3 changes: 3 additions & 0 deletions nimble.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ when defined(nimdistros):
else:
foreignDep "openssl"

before install:
exec "git submodule update --init"

task test, "Run the Nimble tester!":
withDir "tests":
exec "nim c -r tester"
14 changes: 14 additions & 0 deletions tests/sattests/mgtest/mgtest.nimble
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Package

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


# Dependencies

requires "nim >= 2.0.4 & < 2.2.0", "prologue >= 0.6.2", "results",
"fusion", "nodejs", "nimcrypto >= 0.6.0", "anonimongo",
"redis", "websocketx", "https://github.com/mashingan/multisock"
7 changes: 7 additions & 0 deletions tests/sattests/mgtest/src/mgtest.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 numbers together.
return x + y
12 changes: 12 additions & 0 deletions tests/sattests/mgtest/src/mgtest/submodule.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This is just an example to get you started. Users of your library will
# import this file by writing ``import mgtest/submodule``. Feel free to rename or
# remove this file altogether. You may create additional modules alongside
# this file as required.

type
Submodule* = object
name*: string

proc initSubmodule*(): Submodule =
## Initialises a new ``Submodule`` object.
Submodule(name: "Anonymous")
12 changes: 12 additions & 0 deletions tests/sattests/mgtest/tests/test1.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This is just an example to get you started. You may wish to put all of your
# tests into a single file, or separate them into multiple `test1`, `test2`
# etc. files (better names are recommended, just make sure the name starts with
# the letter 't').
#
# To run these tests, simply execute `nimble test`.

import unittest

import mgtest
test "can add":
check add(5, 5) == 10
6 changes: 6 additions & 0 deletions tests/tsat.nim
Original file line number Diff line number Diff line change
Expand Up @@ -410,3 +410,9 @@ suite "SAT solver":
removeDir("nimbledeps")
let (_, exitCode) = execNimbleYes("install", "-l")
check exitCode == QuitSuccess

test "should be able to solve complex dep graphs":
cd "sattests" / "mgtest":
removeDir("nimbledeps")
let (_, exitCode) = execNimbleYes("install", "-l")
check exitCode == QuitSuccess

0 comments on commit 6a7179c

Please sign in to comment.