mirror of
https://github.com/status-im/nimbus-launch.git
synced 2025-02-22 10:08:23 +00:00
Generate the source and test skeleton
This commit is contained in:
parent
456057a8d6
commit
5ef613d5af
@ -6,7 +6,7 @@
|
||||
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
||||
|
||||
import cligen,
|
||||
os, strutils, tables,
|
||||
os, strutils, tables, strformat,
|
||||
./private/[datatypes, error_checking, cligen_extensions, format],
|
||||
./licensing/license,
|
||||
./skeleton/[projectNimble, readme]
|
||||
@ -111,6 +111,32 @@ proc nimbus_launch(projectName: string,
|
||||
genReadme(projectName, githubName, nimbleName, licenses)
|
||||
)
|
||||
|
||||
# 8. Add the source and test skeleton
|
||||
writeFile(
|
||||
prjDir & "/src/" & nimbleName & ".nim",
|
||||
licenseHeader
|
||||
)
|
||||
|
||||
var testString = licenseHeader
|
||||
testString &= &"""
|
||||
|
||||
|
||||
import unittest,
|
||||
../src/{nimbleName}
|
||||
|
||||
suite "Your first test suite":
|
||||
test "Your first test":
|
||||
block: # independant block of subtest
|
||||
discard
|
||||
block:
|
||||
discard
|
||||
"""
|
||||
|
||||
writeFile(
|
||||
prjDir & "/tests/all_tests.nim",
|
||||
testString
|
||||
)
|
||||
|
||||
when isMainModule:
|
||||
dispatch nimbus_launch
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user