Explorar o código

Run TPM simulator tests

Herman Slatman %!s(int64=3) %!d(string=hai) anos
pai
achega
1cc3ad27a5
Modificáronse 2 ficheiros con 12 adicións e 3 borrados
  1. 1 0
      .github/workflows/ci.yml
  2. 11 3
      Makefile

+ 1 - 0
.github/workflows/ci.yml

@@ -23,4 +23,5 @@ jobs:
       os-dependencies: "libpcsclite-dev"
       run-gitleaks: true
       run-codeql: true
+      make-test: true # run `make test` instead of the default test workflow
     secrets: inherit

+ 11 - 3
Makefile

@@ -90,13 +90,21 @@ generate:
 #########################################
 # Test
 #########################################
-test:
-	$Q $(GOFLAGS) gotestsum -- -coverprofile=coverage.out -short -covermode=atomic ./...
+test: testdefault testtpmsimulator combinecoverage
+
+testdefault:
+	$Q $(GOFLAGS) gotestsum -- -coverprofile=defaultcoverage.out -short -covermode=atomic ./...
+
+testtpmsimulator:
+	$Q CGO_ENALBED=1 gotestsum -- -coverprofile=tpmsimulatorcoverage.out -short -covermode=atomic -tags tpmsimulator ./acme 
 
 testcgo:
 	$Q gotestsum -- -coverprofile=coverage.out -short -covermode=atomic ./...
 
-.PHONY: test testcgo
+combinecoverage:
+	cat defaultcoverage.out tpmsimulatorcoverage.out > coverage.out
+
+.PHONY: test testdefault testtpmsimulator testcgo combinecoverage
 
 integrate: integration