Criterion testing framework in C packaged by donaldsebleung
10K+
Criterion testing framework in C packaged by donaldsebleung
This is an unofficial build not endorsed or supported by upstream in any way.
Pull the image:
$ docker pull docker.io/donaldsebleung/criterion
Place the following files in your working directory:
preloaded.h: interfacesolution.c: implementationtests.c: Criterion unit testsWith run.sh:
#!/bin/bash
set -eu
if [ -z "${CONTAINER_ENGINE:+x}" ]; then
CONTAINER_ENGINE=docker
fi
if [ -z "${IMAGE_TAG:+x}" ]; then
IMAGE_TAG=docker.io/donaldsebleung/criterion:latest
fi
W=/home/student
# Create container
C=$($CONTAINER_ENGINE container create --rm -w $W $IMAGE_TAG sh -c "gcc -O2 preloaded.h solution.c tests.c -lcriterion -o tests && ./tests")
# Copy files from the current directory
$CONTAINER_ENGINE container cp ./. $C:$W
# Run tests
$CONTAINER_ENGINE container start --attach $C
Then, to compile and execute the code:
$ ./run.sh
By default, the script assumes you have Docker installed. If you have another container engine such as Podman installed, specify it through CONTAINER_ENGINE:
$ CONTAINER_ENGINE=podman ./run.sh
Content type
-
Digest
sha256:391a7f63c…
Size
91.7 MB
Last updated
about 4 years ago
docker pull donaldsebleung/criterion