summary refs log tree commit diff stats
path: root/atlas/tests
diff options
context:
space:
mode:
Diffstat (limited to 'atlas/tests')
-rw-r--r--atlas/tests/balls.nimble32
-rw-r--r--atlas/tests/grok.nimble5
-rw-r--r--atlas/tests/nim-bytes2human.nimble7
-rw-r--r--atlas/tests/nim.cfg10
-rw-r--r--atlas/tests/npeg.nimble48
-rw-r--r--atlas/tests/packages/packages.json36
-rw-r--r--atlas/tests/sync.nimble10
-rw-r--r--atlas/tests/testes.nimble23
-rw-r--r--atlas/tests/ups.nimble13
-rw-r--r--atlas/tests/ws_conflict/atlas.workspace2
-rw-r--r--atlas/tests/ws_conflict/source/apkg/apkg.nimble4
-rw-r--r--atlas/tests/ws_conflict/source/bpkg@1.0/bpkg.nimble1
-rw-r--r--atlas/tests/ws_conflict/source/cpkg@1.0/cpkg.nimble1
-rw-r--r--atlas/tests/ws_conflict/source/cpkg@2.0/cpkg.nimble1
-rw-r--r--atlas/tests/ws_conflict/source/dpkg/dpkg.nimble0
-rw-r--r--atlas/tests/ws_conflict/url.rules1
16 files changed, 194 insertions, 0 deletions
diff --git a/atlas/tests/balls.nimble b/atlas/tests/balls.nimble
new file mode 100644
index 000000000..143e757e9
--- /dev/null
+++ b/atlas/tests/balls.nimble
@@ -0,0 +1,32 @@
+version = "3.4.1"
+author = "disruptek"
+description = "a unittest framework with balls 🔴🟡🟢"
+license = "MIT"
+
+# requires newTreeFrom
+requires "https://github.com/disruptek/grok >= 0.5.0 & < 1.0.0"
+requires "https://github.com/disruptek/ups < 1.0.0"
+requires "https://github.com/planetis-m/sync#810bd2d"
+#requires "https://github.com/c-blake/cligen < 2.0.0"
+
+bin = @["balls"]            # build the binary for basic test running
+installExt = @["nim"]       # we need to install balls.nim also
+skipDirs = @["tests"]       # so stupid...  who doesn't want tests?
+#installFiles = @["balls.nim"] # https://github.com/nim-lang/Nim/issues/16661
+
+task test, "run tests for ci":
+  when defined(windows):
+    exec "balls.cmd"
+  else:
+    exec "balls"
+
+task demo, "produce a demo":
+  exec "nim c --define:release balls.nim"
+  when (NimMajor, NimMinor) != (1, 0):
+    echo "due to nim bug #16307, use nim-1.0"
+    quit 1
+  exec """demo docs/demo.svg "nim c --out=\$1 examples/fails.nim""""
+  exec """demo docs/clean.svg "nim c --define:danger -f --out=\$1 tests/test.nim""""
+  exec "nim c --define:release --define:ballsDry balls.nim"
+  exec """demo docs/runner.svg "balls""""
+
diff --git a/atlas/tests/grok.nimble b/atlas/tests/grok.nimble
new file mode 100644
index 000000000..1b6d77c08
--- /dev/null
+++ b/atlas/tests/grok.nimble
@@ -0,0 +1,5 @@
+version = "0.0.4"
+author = "disruptek"
+description = "don't read too much into it"
+license = "MIT"
+requires "nim >= 1.0.0"
diff --git a/atlas/tests/nim-bytes2human.nimble b/atlas/tests/nim-bytes2human.nimble
new file mode 100644
index 000000000..9f3ae2479
--- /dev/null
+++ b/atlas/tests/nim-bytes2human.nimble
@@ -0,0 +1,7 @@
+version     = "0.2.2"
+author      = "Juan Carlos"
+description = "Convert bytes to kilobytes, megabytes, gigabytes, etc."
+license     = "MIT"
+srcDir      = "src"
+
+requires "nim >= 1.0.0"  # https://github.com/juancarlospaco/nim-bytes2human/issues/2#issue-714338524
diff --git a/atlas/tests/nim.cfg b/atlas/tests/nim.cfg
new file mode 100644
index 000000000..3982b12bb
--- /dev/null
+++ b/atlas/tests/nim.cfg
@@ -0,0 +1,10 @@
+############# begin Atlas config section ##########
+--noNimblePath
+--path:"../balls"
+--path:"../grok"
+--path:"../ups"
+--path:"../sync"
+--path:"../npeg/src"
+--path:"../testes"
+--path:"../nim-bytes2human/src"
+############# end Atlas config section   ##########
diff --git a/atlas/tests/npeg.nimble b/atlas/tests/npeg.nimble
new file mode 100644
index 000000000..e71fc5aa5
--- /dev/null
+++ b/atlas/tests/npeg.nimble
@@ -0,0 +1,48 @@
+# Package
+
+version       = "0.24.1"
+author        = "Ico Doornekamp"
+description   = "a PEG library"
+license       = "MIT"
+srcDir        = "src"
+installExt    = @["nim"]
+
+# Dependencies
+
+requires "nim >= 0.19.0"
+
+# Test
+
+task test, "Runs the test suite":
+  exec "nimble testc && nimble testcpp && nimble testarc && nimble testjs"
+
+task testc, "C tests":
+  exec "nim c -r tests/tests.nim"
+
+task testcpp, "CPP tests":
+  exec "nim cpp -r tests/tests.nim"
+
+task testjs, "JS tests":
+  exec "nim js -r tests/tests.nim"
+
+task testdanger, "Runs the test suite in danger mode":
+  exec "nim c -d:danger -r tests/tests.nim"
+
+task testwin, "Mingw tests":
+  exec "nim c -d:mingw tests/tests.nim && wine tests/tests.exe"
+
+task test32, "32 bit tests":
+  exec "nim c --cpu:i386 --passC:-m32 --passL:-m32 tests/tests.nim && tests/tests"
+
+task testall, "Test all":
+  exec "nimble test && nimble testcpp && nimble testdanger && nimble testjs && nimble testwin"
+
+when (NimMajor, NimMinor) >= (1, 1):
+  task testarc, "--gc:arc tests":
+    exec "nim c --gc:arc -r tests/tests.nim"
+else:
+  task testarc, "--gc:arc tests":
+    exec "true"
+
+task perf, "Test performance":
+  exec "nim cpp -r -d:danger tests/performance.nim"
diff --git a/atlas/tests/packages/packages.json b/atlas/tests/packages/packages.json
new file mode 100644
index 000000000..d054a201b
--- /dev/null
+++ b/atlas/tests/packages/packages.json
@@ -0,0 +1,36 @@
+[
+  {
+    "name": "bytes2human",
+    "url": "https://github.com/juancarlospaco/nim-bytes2human",
+    "method": "git",
+    "tags": [
+      "bytes",
+      "human",
+      "minimalism",
+      "size"
+    ],
+    "description": "Convert bytes to kilobytes, megabytes, gigabytes, etc.",
+    "license": "LGPLv3",
+    "web": "https://github.com/juancarlospaco/nim-bytes2human"
+  },
+  {
+    "name": "npeg",
+    "url": "https://github.com/zevv/npeg",
+    "method": "git",
+    "tags": [
+      "PEG",
+      "parser",
+      "parsing",
+      "regexp",
+      "regular",
+      "grammar",
+      "lexer",
+      "lexing",
+      "pattern",
+      "matching"
+    ],
+    "description": "PEG (Parsing Expression Grammars) string matching library for Nim",
+    "license": "MIT",
+    "web": "https://github.com/zevv/npeg"
+  }
+]
diff --git a/atlas/tests/sync.nimble b/atlas/tests/sync.nimble
new file mode 100644
index 000000000..a07ae8925
--- /dev/null
+++ b/atlas/tests/sync.nimble
@@ -0,0 +1,10 @@
+# Package
+
+version     = "1.4.0"
+author      = "Antonis Geralis"
+description = "Useful synchronization primitives."
+license     = "MIT"
+
+# Deps
+
+requires "nim >= 1.0.0"
diff --git a/atlas/tests/testes.nimble b/atlas/tests/testes.nimble
new file mode 100644
index 000000000..60fe1d508
--- /dev/null
+++ b/atlas/tests/testes.nimble
@@ -0,0 +1,23 @@
+version = "1.0.0"
+author = "disruptek"
+description = "a cure for salty testes"
+license = "MIT"
+
+#requires "cligen >= 0.9.41 & <= 0.9.45"
+#requires "bump >= 1.8.18 & < 2.0.0"
+requires "https://github.com/disruptek/grok >= 0.0.4 & < 1.0.0"
+requires "https://github.com/juancarlospaco/nim-bytes2human"
+
+bin = @["testes"]           # build the binary for basic test running
+installExt = @["nim"]       # we need to install testes.nim also
+skipDirs = @["tests"]       # so stupid...  who doesn't want tests?
+
+task test, "run tests for ci":
+  exec "nim c --run testes.nim"
+
+task demo, "produce a demo":
+  when (NimMajor, NimMinor) != (1, 0):
+    echo "due to nim bug #16307, use nim-1.0"
+    quit 1
+  exec """demo docs/demo.svg "nim c --out=\$1 examples/balls.nim""""
+  exec """demo docs/clean.svg "nim c --define:danger --out=\$1 tests/testicles.nim""""
diff --git a/atlas/tests/ups.nimble b/atlas/tests/ups.nimble
new file mode 100644
index 000000000..d91abbe60
--- /dev/null
+++ b/atlas/tests/ups.nimble
@@ -0,0 +1,13 @@
+version = "0.0.2"
+author = "disruptek"
+description = "a package handler"
+license = "MIT"
+
+requires "npeg >= 0.23.2 & < 1.0.0"
+requires "https://github.com/disruptek/testes >= 1.0.0 & < 2.0.0"
+
+task test, "run tests":
+  when defined(windows):
+    exec "testes.cmd"
+  else:
+    exec findExe"testes"
diff --git a/atlas/tests/ws_conflict/atlas.workspace b/atlas/tests/ws_conflict/atlas.workspace
new file mode 100644
index 000000000..21954fea1
--- /dev/null
+++ b/atlas/tests/ws_conflict/atlas.workspace
@@ -0,0 +1,2 @@
+deps=""
+overrides="url.rules"
diff --git a/atlas/tests/ws_conflict/source/apkg/apkg.nimble b/atlas/tests/ws_conflict/source/apkg/apkg.nimble
new file mode 100644
index 000000000..11065ec15
--- /dev/null
+++ b/atlas/tests/ws_conflict/source/apkg/apkg.nimble
@@ -0,0 +1,4 @@
+# require first b and then c
+
+requires "https://github.com/bpkg >= 1.0"
+requires "https://github.com/cpkg >= 1.0"
diff --git a/atlas/tests/ws_conflict/source/bpkg@1.0/bpkg.nimble b/atlas/tests/ws_conflict/source/bpkg@1.0/bpkg.nimble
new file mode 100644
index 000000000..f70ad45cb
--- /dev/null
+++ b/atlas/tests/ws_conflict/source/bpkg@1.0/bpkg.nimble
@@ -0,0 +1 @@
+requires "https://github.com/cpkg >= 2.0"
diff --git a/atlas/tests/ws_conflict/source/cpkg@1.0/cpkg.nimble b/atlas/tests/ws_conflict/source/cpkg@1.0/cpkg.nimble
new file mode 100644
index 000000000..0fbd587aa
--- /dev/null
+++ b/atlas/tests/ws_conflict/source/cpkg@1.0/cpkg.nimble
@@ -0,0 +1 @@
+# No dependency here!
diff --git a/atlas/tests/ws_conflict/source/cpkg@2.0/cpkg.nimble b/atlas/tests/ws_conflict/source/cpkg@2.0/cpkg.nimble
new file mode 100644
index 000000000..381fae111
--- /dev/null
+++ b/atlas/tests/ws_conflict/source/cpkg@2.0/cpkg.nimble
@@ -0,0 +1 @@
+requires "https://github.com/dpkg >= 1.0"
diff --git a/atlas/tests/ws_conflict/source/dpkg/dpkg.nimble b/atlas/tests/ws_conflict/source/dpkg/dpkg.nimble
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/atlas/tests/ws_conflict/source/dpkg/dpkg.nimble
diff --git a/atlas/tests/ws_conflict/url.rules b/atlas/tests/ws_conflict/url.rules
new file mode 100644
index 000000000..c641cf990
--- /dev/null
+++ b/atlas/tests/ws_conflict/url.rules
@@ -0,0 +1 @@
+https://github.com/$+ -> file://./source/$#