Skip to content

Commit

Permalink
Merge branch 'main' of github.com:seguid/seguid-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
HenrikBengtsson committed Jun 6, 2024
2 parents 916d15a + 901638a commit 84ecf90
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ SHELL=bash
BATS_SUPPORT_VERSION=0.3.0
BATS_ASSERT_VERSION=2.1.0
BATS = bats/bin/bats

ifdef BATS_JOBS
JOBS = $(BATS_JOBS)
else
JOBS = 1
endif

all: check-cli/ALL

Expand Down Expand Up @@ -32,7 +36,7 @@ assert-CLI_CALL:
@[[ -n "${CLI_CALL}" ]] || { >&2 echo "ERROR: CLI_CALL is not specified"; exit 1; }

check-cli: assert-CLI_CALL assert-bats
cd tests-cli && $(BATS) *.bats
cd tests-cli && $(BATS) --jobs $(JOBS) *.bats

check-cli/seguid-javascript: update-submodules
$(MAKE) check-cli CLI_CALL="npx seguid"
Expand All @@ -57,8 +61,7 @@ assert-SCRIPT_CALL:
@[[ -n "${SCRIPT_CALL}" ]] || { >&2 echo "ERROR: SCRIPT_CALL is not specified"; exit 1; }

check-api: assert-SCRIPT_CALL assert-bats
cd tests-api && $(BATS) *.bats

cd tests-api && $(BATS) --jobs $(JOBS) *.bats
## FIXME: How do I use node/npm so it finds the 'seguid' module?
check-api/seguid-javascript: update-submodules
$(MAKE) check-api NODE_PATH="$(shell pwd)/$(@F)" SCRIPT_CALL="node" SCRIPT_PREAMBLE="const { seguid, lsseguid, ldseguid, csseguid, cdseguid } = require('seguid'); async function print(x) { try { const result = await x; console.log(result); } catch (error) { console.error(error); } }" SCRIPT_PRINT_FMT="print(%s)" SCRIPT_ARGS_SEP=", "
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ or short:
$ make check-api/seguid-r
```

## Parallel option

Pass a `BATS_JOBS` environment variable, eg `BATS_JOBS=16 make`

You need [GNU parallel](https://www.gnu.org/software/parallel/)

## Requirements

Expand Down

0 comments on commit 84ecf90

Please sign in to comment.