1
0
mirror of https://github.com/catchorg/Catch2.git synced 2025-01-16 07:08:01 +00:00

Compare commits

...

2 Commits

Author SHA1 Message Date
Martin Hořeňovský
2baa472bcc
Add GitHub action to check that include guards use standard pattern
Based on work by @innerout, but finished and merged by me, because
the GitHub action refused to run for him.

Closes #2075
Closes #2091
2020-11-06 21:36:31 +01:00
Martin Hořeňovský
f97436a1f7
Normalize include guard in catch_config_ucnaught_exceptions.hpp 2020-11-06 18:01:27 +01:00
2 changed files with 36 additions and 3 deletions

View File

@ -0,0 +1,33 @@
name: Check header guards
# Run this workflow every time a new commit pushed to your repository
on: [push, pull_request]
jobs:
# Set the job key. The key is displayed as the job name
# when a job name is not provided
checkguard:
# Name the Job
name: Check include guard naming convention
# Set the type of machine to run on
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Dependencies
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Install checkguard
run: pip install guardonce
- name: Run checkguard
run: |
wrong_files=$(checkguard -r src/catch2/ -p "name | append _INCLUDED | upper")
if [[ $wrong_files ]]; then
echo "Files with wrong header guard:"
echo $wrong_files
exit 1
fi

View File

@ -14,8 +14,8 @@
* in C++17, we want to use `std::uncaught_exceptions` if possible.
*/
#ifndef CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP
#define CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP
#ifndef CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED
#define CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED
#if defined(_MSC_VER)
# if _MSC_VER >= 1900 // Visual Studio 2015 or newer
@ -41,4 +41,4 @@
#endif
#endif // CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP
#endif // CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED