diff --git a/atlas.lock b/atlas.lock index 7729075..04169bc 100644 --- a/atlas.lock +++ b/atlas.lock @@ -126,9 +126,9 @@ "commit": "28214b3e40c755a9886d2ec8f261ec48fbb6bec6" } }, - "nimcfg": "############# begin Atlas config section ##########\n--noNimblePath\n--path:\"vendor/nimcrypto\"\n--path:\"vendor/nim-bearssl\"\n--path:\"vendor/nim-chronicles\"\n--path:\"vendor/nim-chronos\"\n--path:\"vendor/nim-libp2p\"\n--path:\"vendor/nim-metrics\"\n--path:\"vendor/nim-protobuf-serialization\"\n--path:\"vendor/nim-secp256k1\"\n--path:\"vendor/nim-stew\"\n--path:\"vendor/nim-stint\"\n--path:\"vendor/asynctest\"\n--path:\"vendor/nim-datastore\"\n--path:\"vendor/questionable\"\n--path:\"vendor/nim-unittest2\"\n--path:\"vendor/nim-testutils\"\n--path:\"vendor/nim-json-serialization\"\n--path:\"vendor/nim-http-utils\"\n--path:\"vendor/dnsclient.nim/src\"\n--path:\"vendor/nim-websock\"\n--path:\"vendor/nim-faststreams\"\n--path:\"vendor/nim-serialization\"\n--path:\"vendor/npeg/src\"\n--path:\"vendor/nim-sqlite3-abi\"\n--path:\"vendor/upraises\"\n--path:\"vendor/nim-zlib\"\n############# end Atlas config section ##########\n", + "nimcfg": "############# begin Atlas config section ##########\n--noNimblePath\n--path:\"vendor/nim-secp256k1\"\n--path:\"vendor/nim-protobuf-serialization\"\n--path:\"vendor/nimcrypto\"\n--path:\"vendor/nim-bearssl\"\n--path:\"vendor/nim-chronicles\"\n--path:\"vendor/nim-chronos\"\n--path:\"vendor/nim-libp2p\"\n--path:\"vendor/nim-metrics\"\n--path:\"vendor/nim-stew\"\n--path:\"vendor/nim-stint\"\n--path:\"vendor/asynctest\"\n--path:\"vendor/nim-datastore\"\n--path:\"vendor/questionable\"\n--path:\"vendor/nim-faststreams\"\n--path:\"vendor/nim-serialization\"\n--path:\"vendor/npeg/src\"\n--path:\"vendor/nim-unittest2\"\n--path:\"vendor/nim-testutils\"\n--path:\"vendor/nim-json-serialization\"\n--path:\"vendor/nim-http-utils\"\n--path:\"vendor/dnsclient.nim/src\"\n--path:\"vendor/nim-websock\"\n--path:\"vendor/nim-sqlite3-abi\"\n--path:\"vendor/upraises\"\n--path:\"vendor/nim-zlib\"\n############# end Atlas config section ##########\n", "nimbleFile": { - "filename": "nim-codex-dht-2.nimble", + "filename": "nim-codex-dht.nimble", "content": "# Package\n\nversion = \"0.0.1\"\nauthor = \"Status Research & Development GmbH\"\ndescription = \"DHT based on the libp2p Kademlia spec\"\nlicense = \"MIT\"\nskipDirs = @[\"tests\"]\n\n\n# Dependencies\nrequires \"nim >= 1.2.0\"\nrequires \"secp256k1#b3f38e2795e805743b299dc5d96d332db375b520\" # >= 0.5.2 & < 0.6.0\nrequires \"protobuf_serialization#27b400fdf3bd8ce7120ca66fc1de39d3f1a5804a\" # >= 0.2.0 & < 0.3.0\nrequires \"nimcrypto == 0.5.4\"\nrequires \"bearssl#head\"\nrequires \"chronicles >= 0.10.2 & < 0.11.0\"\nrequires \"chronos#1394c9e04957928afc1db33d2e0965cfb677a1e0\" # >= 3.0.11 & < 3.1.0\nrequires \"libp2p#unstable\"\nrequires \"metrics\"\nrequires \"stew#head\"\nrequires \"stint\"\nrequires \"asynctest >= 0.3.1 & < 0.4.0\"\nrequires \"https://github.com/status-im/nim-datastore#head\"\nrequires \"questionable\"\n\ntask testAll, \"Run DHT tests\":\n exec \"nim c -r tests/testAll.nim\"\n\n# task coverage, \"generates code coverage report\":\n# var (output, exitCode) = gorgeEx(\"which lcov\")\n# if exitCode != 0:\n# echo \"\"\n# echo \" ************************** ⛔️ ERROR ⛔️ **************************\"\n# echo \" ** **\"\n# echo \" ** ERROR: lcov not found, it must be installed to run code **\"\n# echo \" ** coverage locally **\"\n# echo \" ** **\"\n# echo \" *****************************************************************\"\n# echo \"\"\n# quit 1\n\n# (output, exitCode) = gorgeEx(\"gcov --version\")\n# if output.contains(\"Apple LLVM\"):\n# echo \"\"\n# echo \" ************************* ⚠️ WARNING ⚠️ *************************\"\n# echo \" ** **\"\n# echo \" ** WARNING: Using Apple's llvm-cov in place of gcov, which **\"\n# echo \" ** emulates an old version of gcov (4.2.0) and therefore **\"\n# echo \" ** coverage results will differ than those on CI (which **\"\n# echo \" ** uses a much newer version of gcov). **\"\n# echo \" ** **\"\n# echo \" *****************************************************************\"\n# echo \"\"\n\n# exec(\"nimble --verbose test --opt:speed -d:debug --verbosity:0 --hints:off --lineDir:on -d:chronicles_log_level=INFO --nimcache:nimcache --passC:-fprofile-arcs --passC:-ftest-coverage --passL:-fprofile-arcs --passL:-ftest-coverage\")\n# exec(\"cd nimcache; rm *.c; cd ..\")\n# mkDir(\"coverage\")\n# exec(\"lcov --capture --directory nimcache --output-file coverage/coverage.info\")\n# exec(\"$(which bash) -c 'shopt -s globstar; ls $(pwd)/libp2pdht/{*,**/*}.nim'\")\n# exec(\"$(which bash) -c 'shopt -s globstar; lcov --extract coverage/coverage.info $(pwd)/libp2pdht/{*,**/*}.nim --output-file coverage/coverage.f.info'\")\n# echo \"Generating HTML coverage report\"\n# exec(\"genhtml coverage/coverage.f.info --output-directory coverage/report\")\n# echo \"Opening HTML coverage report in browser...\"\n# exec(\"open coverage/report/index.html\")\n\n" }, "hostOS": "macosx", diff --git a/config.nims b/config.nims index 370671f..4af6464 100644 --- a/config.nims +++ b/config.nims @@ -2,16 +2,27 @@ import std/os const currentDir = currentSourcePath()[0 .. ^(len("config.nims") + 1)] -if getEnv("NIMBUS_BUILD_SYSTEM") == "yes" and - # BEWARE - # In Nim 1.6, config files are evaluated with a working directory - # matching where the Nim command was invocated. This means that we - # must do all file existance checks with full absolute paths: - system.fileExists(currentDir & "nimbus-build-system.paths"): - include "nimbus-build-system.paths" - switch("define", "libp2p_pki_schemes=secp256k1") -# begin Nimble config (version 1) -when fileExists("nimble.paths"): + +task testAll, "Run DHT tests": + exec "nim c -r tests/testAll.nim" + +task test, "Run DHT tests": + testAllTask() + +when getEnv("NIMBUS_BUILD_SYSTEM") == "yes" and + # BEWARE + # In Nim 1.6, config files are evaluated with a working directory + # matching where the Nim command was invocated. This means that we + # must do all file existance checks with full absolute paths: + system.fileExists(currentDir & "nimbus-build-system.paths"): + echo "Using Nimbus Build" + include "nimbus-build-system.paths" +elif fileExists("nimble.paths"): + echo "Using Nimble Build" + # begin Nimble config (version 1) include "nimble.paths" -# end Nimble config + # end Nimble config +elif fileExists("atlas.paths"): + echo "Using Atlas Build" + include "atlas.paths"