Skip to content

Commit

Permalink
docker file for running tests
Browse files Browse the repository at this point in the history
  • Loading branch information
indecisivedragon committed Jul 3, 2024
1 parent b4fdc8e commit e315f0a
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Dockerfile.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM ubuntu

ARG LIBCON4M_REPO=/libcon4m

WORKDIR $LIBCON4M_REPO
COPY ./ $LIBCON4M_REPO

# llvm.sh needs tools to install clang-18
RUN apt-get update && apt upgrade
RUN apt-get install -y \
lsb-release \
wget \
software-properties-common \
gnupg

RUN wget https://apt.llvm.org/llvm.sh
RUN chmod u+x llvm.sh
RUN ./llvm.sh 18

# meson install + crypto
RUN apt-get install -y \
meson \
libssl-dev

ENTRYPOINT [ "./scripts/run_tests.sh" ]
39 changes: 39 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# libcon4m

This is the C library for con4m. The language reference guide is [here](./doc/reference.md).

# tests

## running via dockerfile

To build the dockerfile, run the following command from the repository root:

```
docker build -t libcon4m-tests -f Dockerfile.test .
```

To run the tests, run:

```
docker run libcon4m-tests
```

## running directly

To run the tests directly, the following are required:

- minimum versions clang 17.0.6 or gcc 14.1 or greater
- meson
- ninja

From the repository root, build with:

```
./dev build
```

and run with:

```
./dev run
```
15 changes: 15 additions & 0 deletions scripts/run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -e

rm -rf ./debug ./build ./release

comp='clang-18'
# comp='gcc'

${comp} -v

# kind='debug'
kind='build'

CC="${comp}" ./dev "${kind}"
./"${kind}"/c4test ./tests

0 comments on commit e315f0a

Please sign in to comment.