forked from acts-project/acts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI job to check for BOOST_TEST macro usage (acts-project#351)
- Loading branch information
1 parent
408d496
commit 049006c
Showing
57 changed files
with
1,239 additions
and
1,161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
test_string="BOOST_TEST(" | ||
grep $test_string -n -r Tests --include "*.cpp" --include "*.hpp" --include "*.ipp" | ||
|
||
status=$? | ||
|
||
if [[ $status -eq 0 ]]; then | ||
echo "Found occurrences of '$test_string'" | ||
exit 1 | ||
else | ||
echo "Did not find occurrences of '$test_string'" | ||
exit 0 | ||
fi |
24 changes: 24 additions & 0 deletions
24
Tests/CommonHelpers/Acts/Tests/CommonHelpers/Assertions.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// This file is part of the Acts project. | ||
// | ||
// Copyright (C) 2020 CERN for the benefit of the Acts project | ||
// | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
#pragma once | ||
|
||
#include <boost/test/unit_test.hpp> | ||
|
||
#include <vector> | ||
|
||
#define CHECK_NE_COLLECTIONS(col1, col2) \ | ||
do { \ | ||
BOOST_CHECK_EQUAL(col1.size(), col2.size()); \ | ||
std::vector<bool> result; \ | ||
for (size_t i = 0; i < col1.size(); i++) { \ | ||
result.push_back(col1[i] == col2[i]); \ | ||
} \ | ||
BOOST_CHECK(not std::all_of(result.begin(), result.end(), \ | ||
[](bool r) { return r; })); \ | ||
} while (0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.