aboutsummaryrefslogtreecommitdiff
path: root/Module.Taskfile.yaml
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2024-10-18 22:10:17 -0400
committerLibravatar vnugent <public@vaughnnugent.com>2024-10-18 22:10:17 -0400
commit44044eb0fb28b774773e3284fd147c91d59d64e3 (patch)
tree429860e6ced91b02b7062f86c74120be5d5f0c11 /Module.Taskfile.yaml
parent6a4a464d9fdc7821cd5c5695656a3fe385497cc5 (diff)
refactor: Wire up unit testing and refactor c# api
Diffstat (limited to 'Module.Taskfile.yaml')
-rw-r--r--Module.Taskfile.yaml33
1 files changed, 26 insertions, 7 deletions
diff --git a/Module.Taskfile.yaml b/Module.Taskfile.yaml
index b7b991c..db5f6dd 100644
--- a/Module.Taskfile.yaml
+++ b/Module.Taskfile.yaml
@@ -18,21 +18,40 @@ tasks:
- git reset --hard
- git remote update
- git pull origin {{ .BRANCH_NAME }} --verify-signatures
-
- #updates the project versions for all inlcuded .NET projects
- - dotnet-gitversion.exe /updateprojectfiles
test:
desc: 'Builds and runs noscrypt unit tests for vnbuild CI systems'
cmds:
- - cmd: task test -- -DNC_ENABLE_UTILS=ON
+ #ensure the debug library has been built for the current system before project tests are executed
+ - cmd: task build-debug -- -DNC_ENABLE_UTILS=ON
+ - task: test-dotnet
+
+ #runs the test suite inside wsl linux environment
+ - cmd: echo 'Running WSL tests {{ if eq OS "windows" }}TRUE{{ else }}FALSE{{ end }}'
+ silent: true
- cmd: wsl task test -- -DNC_ENABLE_UTILS=ON
+ platforms: [ windows ]
-#called by build pipeline to build module
- build:
+ test-dotnet:
+ vars:
+ LIB_NAME: '{{ if eq OS "windows" }}noscrypt.dll{{ else }}libnoscrypt{{ end }}'
+ LIB_PATH: '{{ .USER_WORKING_DIR }}/build/{{ OS }}/{{ if eq OS "windows" }}debug/{{ end }}{{ .LIB_NAME }}'
+
cmds:
- - echo "building module {{.MODULE_NAME}}"
+ - cmd: echo "running tests for {{ .PROJECT_NAME }}"
+ silent: true
+ - cmd: dotnet test
+ {{ .CLI_ARGS }}
+ --logger "console;verbosity=detailed"
+ --framework {{ .FRAMEWORK | default "net8.0" }}
+ --configuration {{ .CONFIGURATION | default "Debug" }}
+ --environment VNLIB_SHARED_HEAP_DIAGNOSTICS="1"
+ --environment 'NOSCRYPT_DLL_PATH="{{ osClean .LIB_PATH }}"'
+#called by build pipeline to build module
+ build:
+ cmds: []
+
publish:
cmds:
#git archive in the module directory