Sign inSign up

donaldsebleung/criterion

By donaldsebleung

•Updated about 4 years ago

Criterion testing framework in C packaged by donaldsebleung

0

10K+

donaldsebleung/criterion repository overview

⁠docker.io/donaldsebleung/criterion

Criterion⁠ testing framework in C packaged by donaldsebleung

This is an unofficial build not endorsed or supported by upstream in any way.

⁠Usage

Pull the image:

$ docker pull docker.io/donaldsebleung/criterion

Place the following files in your working directory:

  • preloaded.h: interface
  • solution.c: implementation
  • tests.c: Criterion unit tests

With 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

Tag summary

Content type

-

Digest

sha256:391a7f63c…

Size

91.7 MB

Last updated

about 4 years ago

docker pull donaldsebleung/criterion