Skip to content

Unit tests for any SEGUID implementations

Notifications You must be signed in to change notification settings

seguid/seguid-tests

Repository files navigation

JavaScript checks Python checks R checks Tcl checks

seguid-tests: Test Suite for SEGUID Implementations

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.

TL;DR

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

Details

Testing the command-line interface

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

Testing the application programming interface

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

Parallel option

Pass a BATS_JOBS environment variable, e.g. BATS_JOBS=16 make. You need GNU parallel for this to work.

Requirements

The checks are implemented in Bash and Bats (Bash Automated Testing System):

About

Unit tests for any SEGUID implementations

Resources

Stars

Watchers

Forks

Releases

No releases published