Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/arraymerge_gtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ on:
paths:
- 'array_merge/**'
- 'mergesort/mergesort.[ch]'
- '.github/workflows/**'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Cache gtest library
uses: actions/cache@v2
uses: actions/cache@v4
env:
cache-name: cache-gtest-lib
with:
Expand All @@ -33,7 +34,7 @@ jobs:
- name: Check out the code
uses: actions/checkout@v2
- name: Compile test code
run: g++ -Wall -g -o array_merge_test ../mergesort/mergesort.c array_merge.c array_merge_test.cpp -lgtest -pthread -std=c++0x
run: g++ -Wall -g -o array_merge_test ../mergesort/mergesort.c array_merge.c array_merge_test.cpp -lgtest -pthread -std=c++14
working-directory: array_merge
- name: Run test
run: ./array_merge_test
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/arraymerge_test_valgrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ on:
paths:
- 'array_merge/**'
- 'mergesort/mergesort.[ch]'
- '.github/workflows/**'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Cache gtest library
uses: actions/cache@v2
uses: actions/cache@v4
env:
cache-name: cache-gtest-lib
with:
Expand All @@ -35,7 +36,7 @@ jobs:
- name: Check out the code
uses: actions/checkout@v2
- name: Compile code
run: g++ -Wall -g -o array_merge_test ../mergesort/mergesort.c array_merge.c array_merge_test.cpp -lgtest -pthread -std=c++0x
run: g++ -Wall -g -o array_merge_test ../mergesort/mergesort.c array_merge.c array_merge_test.cpp -lgtest -pthread -std=c++14
working-directory: array_merge
- name: Run test
run: valgrind -v --leak-check=full --show-leak-kinds=all --error-exitcode=1 ./array_merge_test
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/mergesort_gtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ on:
push:
paths:
- 'mergesort/**'
- '.github/workflows/mergesort_gtest.yml'
- '.github/workflows/mergesort_test_valgrind.yml'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Cache gtest library
uses: actions/cache@v2
uses: actions/cache@v4
env:
cache-name: cache-gtest-lib
with:
Expand All @@ -30,7 +32,7 @@ jobs:
- name: Check out the code
uses: actions/checkout@v2
- name: Compile test code
run: g++ -Wall -g -o mergesort_test mergesort.c mergesort_test.cpp -lgtest -pthread -std=c++0x
run: g++ -Wall -g -o mergesort_test mergesort.c mergesort_test.cpp -lgtest -pthread -std=c++14
working-directory: mergesort
- name: Run test
run: ./mergesort_test
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/mergesort_test_valgrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ on:
push:
paths:
- 'mergesort/**'
- '.github/workflows/mergesort_gtest.yml'
- '.github/workflows/mergesort_test_valgrind.yml'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Cache gtest library
uses: actions/cache@v2
uses: actions/cache@v4
env:
cache-name: cache-gtest-lib
with:
Expand All @@ -32,7 +34,7 @@ jobs:
- name: Check out the code
uses: actions/checkout@v2
- name: Compile code
run: g++ -Wall -g -o mergesort_test mergesort.c mergesort_test.cpp -lgtest -pthread -std=c++0x
run: g++ -Wall -g -o mergesort_test mergesort.c mergesort_test.cpp -lgtest -pthread -std=c++14
working-directory: mergesort
- name: Run test
run: valgrind -v --leak-check=full --show-leak-kinds=all --error-exitcode=1 ./mergesort_test
Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ the implementation of the function listed in `foo.h`.
To compile the test code use the following:

```bash
g++ -Wall -g -o foo_test foo.c foo_test.cpp -lgtest -pthread -std=c++0x
g++ -Wall -g -o foo_test foo.c foo_test.cpp -lgtest -pthread -std=c++14
```

*Notice that this uses `g++` instead of `gcc`.* This because the `gtest`
Expand All @@ -110,7 +110,8 @@ the executable, however, which can be *extremely* helpful when using
tools like `valgrind` or the `gdb` debugger. If you don't include it,
for example, then those tools won't be able to report accurate or useful
line numbers or function names. The `-lgtest` tells the compiler to include
the `gtest` library (that's the `-l` part) when generating the executable.
the `gtest` library (that's the `-l` part) when generating the executable
`foo_test`, which you can run using `./foo_test`.

---

Expand Down Expand Up @@ -238,10 +239,10 @@ You can use references like `../mergesort/mergesort.h` or
`../mergesort/mergesort.c` to access appropriate files in that part of
the project, either in things like `#include` statements or
in `gcc/g++` calls. The command in the GitHub Actions to compile
the Array Merge tess, for example, is:
the Array Merge tests, for example, is:

```text
g++ -Wall -g -o array_merge_test ../mergesort/mergesort.c array_merge.c array_merge_test.cpp -lgtest -pthread -std=c++0x
g++ -Wall -g -o array_merge_test ../mergesort/mergesort.c array_merge.c array_merge_test.cpp -lgtest -pthread -std=c++14
```

Note that the `../mergesort/mergesort.c` in this command includes
Expand All @@ -258,6 +259,6 @@ That has two major implications:

Be sure that:

- [ ] You follow our instructions
- [ ] You follow our instructions (especially about how we want you to be using `malloc` or `calloc` instead of leveraging the dynamically allocated memory option)
- [ ] Your canvas group matches your github classroom group
- [ ] You submit your repository URL to canvas (if your canvas groups are set up correctly this will only need to be done once)
- [ ] You submit your repository URL to canvas (if your canvas groups are set up correctly this will only need to be done by one team member)