This repository provides as set of unit tests for validating current and to-be-release SEGUID implementations. It provides tests that validates the application programming interface (API) and tests that validated the command-line interface (CLI). If an implementation passes these checks, the implementation is considered compliant with the offical SEGUID v2 specifications.
To check the CLI for Python, R, etc., use:
make check-cli/seguid-python
make check-cli/seguid-r
To check the API for Python, R, etc., use:
make check-api/seguid-python
make check-api/seguid-r
To test the CLI of a specific implementation, use format:
$ make check-cli CLI_CALL="cmd <options>"
where "cmd <options>"
is the command with options use to call the
SEGUID CLI. For example, the CLI of the Python seguid package is
called using the format:
$ python -m seguid ...
Thus, to test this interface, call:
$ make check-cli CLI_CALL="python -m seguid"
A pre-defined short version of this is:
$ make check-cli/seguid-python
Similarly, for the CLI of the R seguid package, use:
$ make check-cli CLI_CALL="Rscript -e seguid::seguid --args"
or short:
$ make check-cli/seguid-r
For the Javascript seguid package, use:
$ make check-cli CLI_CALL="npx seguid"
or short:
$ make check-cli/seguid-javascript
To test the API of a specific implementation, use format:
$ make check-api SCRIPT_CALL="cmd <options>" SCRIPT_PREAMBLE="<script header>" SCRIPT_PRINT_FMT="<print call>"
For example, to test the API of the Python implementation, call:
$ make check-api SCRIPT_CALL="node" SCRIPT_PREAMBLE="const { seguid, lsseguid, ldseguid, csseguid, cdseguid } = require('seguid')" SCRIPT_PRINT_FMT="console.log(%s)"
A pre-defined short version of this is:
$ make check-api/seguid-python
Similarly, for the API of the R seguid package, use:
$ make check-api SCRIPT_CALL="Rscript --no-init-file" SCRIPT_PREAMBLE="library(seguid)" SCRIPT_PRINT_FMT="cat(%s)"
or short:
$ make check-api/seguid-r
Pass a BATS_JOBS
environment variable, e.g. BATS_JOBS=16 make
.
You need GNU parallel for
this to work.
The checks are implemented in Bash and Bats (Bash Automated Testing System):
- Bash
- bats-core