Skip to content

Commit 319c02d

Browse files
committed
Remove fpm from ep 1
1 parent 554f047 commit 319c02d

File tree

3 files changed

+32
-11
lines changed

3 files changed

+32
-11
lines changed

docker/Dockerfile.ep-1

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ COPY --chown=vscode episodes/1-into-to-unit-tests /home/vscode/1-into-to-unit-te
44

55
WORKDIR /home/vscode/1-into-to-unit-tests/challenge
66

7-
# test challenge with fpm
8-
RUN fpm test
7+
# test challenge with CMake
8+
RUN cmake -B build
9+
RUN cmake --build build
10+
RUN ctest --test-dir build --output-on-failure
911

1012
# clean build
1113
RUN rm -rf build
1214

13-
# Test solution with fpm
14-
RUN mv ../solution/test_maths_solution.f90 test/test_maths.f90 && \
15-
fpm test
15+
# Test solution with CMake
16+
RUN mv ../solution/test_maths_solution.f90 test/test_maths.f90
17+
RUN cmake -B build
18+
RUN cmake --build build
19+
RUN ctest --test-dir build --output-on-failure
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
2+
3+
# Set project name
4+
project(
5+
"intro-to-unit-tests"
6+
LANGUAGES "Fortran"
7+
VERSION "0.0.1"
8+
DESCRIPTION "Exercises to teach unit testing"
9+
)
10+
11+
# Define src and test files
12+
set(PROJ_SRC_FILES "${PROJECT_SOURCE_DIR}/src/maths.f90")
13+
set(PROJ_TEST_FILES "${PROJECT_SOURCE_DIR}/test/test_maths.f90")
14+
15+
# Build test executable
16+
add_executable(test_maths_exec
17+
"${PROJ_SRC_FILES}"
18+
"${PROJ_TEST_FILES}"
19+
)
20+
21+
# Add test as ctest
22+
enable_testing()
23+
add_test(NAME test_maths COMMAND test_maths_exec)

episodes/1-into-to-unit-tests/challenge/fpm.toml

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)