Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lestrrat committed Feb 25, 2021
1 parent 05619f1 commit d95ee42
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
30 changes: 15 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ generate-%:
realclean:
rm coverage.out

_test:
go test -race $(TESTOPTS)
test-cmd:
go test -v -race $(TESTOPTS)

test:
$(MAKE) -C examples _test
$(MAKE) -C bench _test
$(MAKE) _test TESOPTS=./...
$(MAKE) test-cmd TESOPTS=./...
$(MAKE) -f $(PWD)/Makefile -C examples test-cmd
$(MAKE) -f $(PWD)/Makefile -C bench test-cmd

cover-cmd:
$(MAKE) -f $(PWD)/Makefile -C examples _test
$(MAKE) -f $(PWD)/Makefile -C bench _test
$(MAKE) -f $(PWD)/Makefile -C cmd/jwx _test
$(MAKE) _test
$(MAKE) test-cmd
$(MAKE) -f $(PWD)/Makefile -C examples test-cmd
$(MAKE) -f $(PWD)/Makefile -C bench test-cmd
$(MAKE) -f $(PWD)/Makefile -C cmd/jwx test-cmd
@# This is NOT cheating. tools to generate code don't need to be
@# included in the final result. Also, we currently don't do
@# any active development on the jwx command
Expand All @@ -45,10 +45,10 @@ cover-all:
$(MAKE) cover-cmd TESTOPTS="-tags jwx_goccy,jwx_es256k -coverpkg=./... -coverprofile=coverage.out.tmp ./..."

smoke-cmd:
$(MAKE) -f $(PWD)/Makefile -C examples _test
$(MAKE) -f $(PWD)/Makefile -C bench _test
$(MAKE) -f $(PWD)/Makefile -C cmd/jwx _test
$(MAKE) _test
$(MAKE) test-cmd
$(MAKE) -f $(PWD)/Makefile -C examples test-cmd
$(MAKE) -f $(PWD)/Makefile -C bench test-cmd
$(MAKE) -f $(PWD)/Makefile -C cmd/jwx test-cmd

smoke:
$(MAKE) smoke-stdlib
Expand All @@ -60,10 +60,10 @@ smoke-goccy:
$(MAKE) smoke-cmd TESTOPTS="-short -tags jwx_goccy ./..."

smoke-es256k:
$(MAKE) smoke-cmd TESTOPTS="-short -tags jwx_256k ./..."
$(MAKE) smoke-cmd TESTOPTS="-short -tags jwx_es256k ./..."

smoke-all:
$(MAKE) smoke-cmd TESTOPTS="-short -tags jwx_goccy,jwx_256k ./..."
$(MAKE) smoke-cmd TESTOPTS="-short -tags jwx_goccy,jwx_es256k ./..."

viewcover:
go tool cover -html=coverage.out
Expand Down
7 changes: 6 additions & 1 deletion jwx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"testing"

"github.com/lestrrat-go/jwx"
"github.com/lestrrat-go/jwx/internal/ecutil"
"github.com/lestrrat-go/jwx/internal/jose"
"github.com/lestrrat-go/jwx/internal/json"
"github.com/lestrrat-go/jwx/internal/jwxtest"
Expand All @@ -18,8 +19,12 @@ import (
"github.com/stretchr/testify/assert"
)

func TestJSONEngine(t *testing.T) {
func TestShowBuildInfo(t *testing.T) {
t.Logf("Running tests using JSON backend => %s\n", json.Engine())
t.Logf("Available elliptic curves:")
for _, alg := range ecutil.AvailableAlgorithms() {
t.Logf(" %s", alg)
}
}

type jsonUnmarshalWrapper struct {
Expand Down

0 comments on commit d95ee42

Please sign in to comment.