Skip to content

Commit 97e86f7

Browse files
committed
Remove fpm veggies and test-drive from ep 4
1 parent 9af80f7 commit 97e86f7

File tree

16 files changed

+11
-534
lines changed

16 files changed

+11
-534
lines changed

docker/Dockerfile.ep-4

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,9 @@ WORKDIR /home/vscode/4-debugging-a-broken-test/challenge
77
# Fix intentional bug in code
88
RUN sed -i -E 's/.*matrix\(row, col\) = temp_matrix\(row, col\)/matrix\(col, row\) = temp_matrix\(row, col\)/g' src/matrix_transforms.f90
99

10-
# build tests inc veggies with cmake
11-
RUN sed -i -E 's/.*add_subdirectory\(\"test\/test-drive\"\)/#add_subdirectory\(\"test\/test-drive\"\)/g' CMakeLists.txt && \
12-
sed -i -E 's/.*add_subdirectory\(\"test\/pfunit\"\)/#add_subdirectory\(\"test\/pfunit\"\)/g' CMakeLists.txt && \
13-
sed -i -E 's/.*add_subdirectory\(\"test\/veggies\"\)/add_subdirectory\(\"test\/veggies\"\)/g' CMakeLists.txt && \
14-
cmake -B build-cmake-veggies -DCMAKE_PREFIX_PATH=/home/vscode/pfunit/build/installed && \
15-
cmake --build build-cmake-veggies
10+
# build tests with cmake
11+
RUN cmake -B build -DCMAKE_PREFIX_PATH=/home/vscode/pfunit/build/installed && \
12+
cmake --build build
1613

17-
# build tests without veggies with cmake
18-
RUN sed -i -E 's/.*add_subdirectory\(\"test\/test-drive\"\)/add_subdirectory\(\"test\/test-drive\"\)/g' CMakeLists.txt && \
19-
sed -i -E 's/.*add_subdirectory\(\"test\/pfunit\"\)/add_subdirectory\(\"test\/pfunit\"\)/g' CMakeLists.txt && \
20-
sed -i -E 's/.*add_subdirectory\(\"test\/veggies\"\)/#add_subdirectory\(\"test\/veggies\"\)/g' CMakeLists.txt && \
21-
cmake -B build-cmake -DCMAKE_PREFIX_PATH=/home/vscode/pfunit/build/installed && \
22-
cmake --build build-cmake
23-
24-
# test veggies with ctest
25-
RUN ctest --test-dir build-cmake-veggies --output-on-failure
26-
27-
# test testdrive and pfunit with ctest
28-
RUN ctest --test-dir build-cmake --output-on-failure
29-
30-
# test with fpm
31-
RUN fpm test
14+
# test pfunit with ctest
15+
RUN ctest --test-dir build --output-on-failure

episodes/3-fortran-unit-test-syntax/challenge/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,4 @@ file(GLOB PROJ_SRC_FILES "${PROJECT_SOURCE_DIR}/src/*.f90")
1414
# Build src executables
1515
add_executable("${PROJECT_NAME}" "${PROJ_SRC_FILES}")
1616

17-
enable_testing()
18-
19-
#--------------------------------------#
20-
# pFUnit #
21-
#--------------------------------------#
2217
add_subdirectory("test/pfunit")

episodes/3-fortran-unit-test-syntax/solution/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,4 @@ file(GLOB PROJ_SRC_FILES "${PROJECT_SOURCE_DIR}/src/*.f90")
1414
# Build src executables
1515
add_executable("${PROJECT_NAME}" "${PROJ_SRC_FILES}")
1616

17-
enable_testing()
18-
19-
#--------------------------------------#
20-
# pFUnit #
21-
#--------------------------------------#
2217
add_subdirectory("test/pfunit")

episodes/4-debugging-a-broken-test/challenge/CMakeLists.txt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,4 @@ project(
1111
# Define src files
1212
file(GLOB PROJ_SRC_FILES "${PROJECT_SOURCE_DIR}/src/*.f90")
1313

14-
enable_testing()
15-
16-
#--------------------------------------#
17-
# veggies #
18-
#--------------------------------------#
19-
# add_subdirectory("test/veggies")
20-
21-
#--------------------------------------#
22-
# test-drive #
23-
#--------------------------------------#
24-
add_subdirectory("test/test-drive")
25-
26-
#--------------------------------------#
27-
# pFUnit #
28-
#--------------------------------------#
2914
add_subdirectory("test/pfunit")

episodes/4-debugging-a-broken-test/challenge/README.md

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,14 @@ This exercise aims to teach how to identify a failing unit test and translate th
55
## The code
66

77
In [src](./src/) there is a module containing a subroutine to transpose a matrix. In [test](./test/) there are tests for this
8-
subroutine written with [Veggies](./test/veggies/), [test-drive](./test/test-drive/) and [pFUnit](./test/pfunit/).
8+
subroutine written with [pFUnit](https://github.com/Goddard-Fortran-Ecosystem/pFUnit).
99

10-
Try running the tests with either FPM or CMake. You should find that some are failing.
11-
12-
## Building
13-
14-
> Remember, pFUnit can only be built via CMake and you can only build one of test-drive or Veggies at a time, via CMake.
15-
16-
### CMake
17-
18-
```sh
19-
cmake -B build-cmake -DCMAKE_PREFIX_PATH=<path/to/pFUnit/build/installed>
20-
cmake --build build-cmake
21-
cd build-cmake
22-
ctest --output-on-failure
23-
```
24-
25-
### FPM
10+
Try running the tests with CMake. You should find that some are failing.
2611

2712
```sh
28-
fpm test
13+
cmake -B build -DCMAKE_PREFIX_PATH=<path/to/pFUnit/build/installed>
14+
cmake --build build
15+
ctest --test-dir build --output-on-failure
2916
```
3017

3118
## Tasks

episodes/4-debugging-a-broken-test/challenge/fpm.toml

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

episodes/4-debugging-a-broken-test/challenge/test/pfunit/.gitignore renamed to episodes/4-debugging-a-broken-test/challenge/test/.gitignore

File renamed without changes.

episodes/4-debugging-a-broken-test/challenge/test/pfunit/CMakeLists.txt renamed to episodes/4-debugging-a-broken-test/challenge/test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ add_library (sut STATIC ${PROJ_SRC_FILES_EXEC_MAIN})
1111
# List all test files
1212
file(GLOB
1313
test_srcs
14-
"${PROJECT_SOURCE_DIR}/test/pfunit/*.pf"
14+
"${PROJECT_SOURCE_DIR}/test/*.pf"
1515
)
1616

1717
# evolve_board tests

episodes/4-debugging-a-broken-test/challenge/test/test-drive/CMakeLists.txt

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

episodes/4-debugging-a-broken-test/challenge/test/test-drive/main.f90

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

0 commit comments

Comments
 (0)