Assignment 3: Test of Life
A modularized version of the 1d game of life code, modified to use std::vector instead of unique_ptr, has been put on the Teach cluster. Your assignment is to create tests for the modules in this code nase. Log into the teach cluster and get this code with the command:
cp -r /scinet/course/phy1610/gameof1dvector .
For this assignment, you will have to load the gcc and catch2 modules
module load gcc/13 catch2/3
While proceeding with the rest of this assignment, we expect you to make regular git commits to track your code. Therefore, you must first put the code into version control with git, locally, in the same directory as the code, as shown in class. Use one single git repository for the whole assignment.
You will already find an integrated test in the Makefile in this directory, which you can run by typing 'make integratedtest'. This command causes the necessary executables to be built, then runs those, and compares their outputs.
For this assignment, you are to implement unit tests using the Catch2 library for three of the modules: the "fillcells" module, the "outputcells" module, and the "updatecells" module. In particular:
- For the fillcells module, this should test, for a few small number of cells (come up with about 5 cases), that cells uniformly filled by the initial_cells function.
- For the outputcells module, create 5 tests that create a few known configuration of cells, writes that out, and checks that the output is as expected.
- For the updatecells module, write a test to see that a state with all cells alive remains the same, as does a state with all dead cells. Come up with one more interesting case.
Write separate rules in the Makefile to compile and run the unit tests of each module and a 'super' rule called "test" to run all three unit test programs and the integrated test.
Note that we expect to see several commits, and meaningful comments, and that all source files in that directory are added to the repo.
Submit by Friday February 9, 2019 at midnight. The way to submit your repo is to use a utility on the teach cluster called "git2zip", as explained here: https://education.scinet.utoronto.ca/mod/page/view.php?id=3075
The late policy can be found in the syllabus. Note: If you want to use this code on your own machine, you wil need to install the Catch2 Libraries either using an installation application like yum or apt-get from linux or from the catch2 website: https://github.com/catchorg/Catch2