Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into feature/alpine
Browse files Browse the repository at this point in the history
  • Loading branch information
srz-zumix committed May 31, 2022
2 parents f22c497 + fe13803 commit f76eee6
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 10 deletions.
15 changes: 15 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Checks: "*\
,-__llvm_libc-*\
,-cert-err58-cpp\
,-clang-analyzer-*\
,-cppcoreguidelines-macro-usage\
,-cppcoreguidelines-explicit-virtual-functions\
,-hicpp-use-override\
,-llvm-namespace-comment\
,-llvm-include-order\
,-modernize-use-override\
,-modernize-use-trailing-return-type\
,-readability-isolate-declaration\
"
# WarningsAsErrors: >
# *
27 changes: 27 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,33 @@ jobs:
with:
reporter: github-pr-review

#===================================================================
clang-tidy:
runs-on: ubuntu-latest
needs: prepare
steps:
- uses: actions/checkout@v2
- uses: reviewdog/action-setup@v1
- name: install clang-tidy
run: |
sudo apt-get install -y clang-tidy
- name: clang-tidy info
run: |
clang-tidy --version
# clang-tidy -list-checks --config-file=.clang-tidy
clang-tidy -list-checks -checks=*,-llvm-namespace-comment,-cppcoreguidelines-macro-usage,-modernize-use-trailing-return-type,-llvm-include-order,-clang-analyzer-*
- name: cmake
run: |
mkdir ./cmake-build
cd ./cmake-build
cmake ../projects/cmake -Dbuild_for_clang_tidy=ON
- name: cmake build clang-tidy
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cmake --build cmake-build | reviewdog -reporter=github-pr-review -name="clang-tidy" -efm="%f:%l:%c: %m" -tee
#===================================================================
lint-editorconfig:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ Tests
|[Scrutinizer](https://scrutinizer-ci.com/)|[![Scrutinizer Build Status](https://scrutinizer-ci.com/g/srz-zumix/iutest/badges/build.png?b=master)](https://scrutinizer-ci.com/g/srz-zumix/iutest/build-status/master)|[![Scrutinizer Build Status](https://scrutinizer-ci.com/g/srz-zumix/iutest/badges/build.png?b=develop)](https://scrutinizer-ci.com/g/srz-zumix/iutest/build-status/develop)|iuwandbox tests|
|[Semaphore](https://semaphoreci.com/)|[![Semaphore Build Status](https://semaphoreci.com/api/v1/srz_zumix/iutest/branches/master/badge.svg)](https://semaphoreci.com/srz_zumix/iutest)|[![Semaphore Build Status](https://semaphoreci.com/api/v1/srz_zumix/iutest/branches/develop/badge.svg)](https://semaphoreci.com/srz_zumix/iutest)|Scan-build|
|[Semaphore 2.0](https://semaphoreci.com/)|[![Semaphore 2.0 Build Status](https://srz-zumix.semaphoreci.com/badges/iutest/branches/master.svg)](https://srz-zumix.semaphoreci.com/projects/iutest)|[![Semaphore 2.0 Build Status](https://srz-zumix.semaphoreci.com/badges/iutest/branches/develop.svg)](https://srz-zumix.semaphoreci.com/projects/iutest)|Scan-build, Basic test, sample run|
|[Sider](https://sider.review/gh/repos/3447984/pulls)||styelint, Flake8, Cppcheck, cpplint, Clang-Tidy, Misspell, Goodcheck, Secret Scan|
|[Travis CI](https://travis-ci.com/)|[![Travis-CI Build Status](https://travis-ci.com/srz-zumix/iutest.svg?branch=master)](https://travis-ci.com/srz-zumix/iutest)|[![Travis-CI Build Status](https://travis-ci.com/srz-zumix/iutest.svg?branch=develop)](https://travis-ci.com/srz-zumix/iutest)|Basic tests, Coverity-scan|
|[Wercker](https://www.wercker.com/)|[![wercker status](https://app.wercker.com/status/d385156052aa4118a7f24affe4a8f851/s/master "wercker status")](https://app.wercker.com/project/byKey/d385156052aa4118a7f24affe4a8f851)|[![wercker status](https://app.wercker.com/status/d385156052aa4118a7f24affe4a8f851/s/develop "wercker status")](https://app.wercker.com/project/byKey/d385156052aa4118a7f24affe4a8f851)|test/cmake project check, iuwandbox make build|

Expand Down
4 changes: 4 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ environment:
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PROJECT_DIR: vs2019
CMAKE_GENERATOR_NAME: Visual Studio 16 2019
- job_group: VisualStudio
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
PROJECT_DIR: vs2022
CMAKE_GENERATOR_NAME: Visual Studio 17 2022
# Cygwin
- job_group: Cygwin
job_depends_on: VisualStudio
Expand Down
4 changes: 2 additions & 2 deletions include/internal/iutest_file.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class StdioFile : public IFile
FILE* m_fp;
public:
StdioFile() IUTEST_CXX_NOEXCEPT_SPEC : m_fp(NULL) {}
virtual ~StdioFile() { Close(); }
virtual ~StdioFile() { StdioFile::Close(); }
public:
/**
* @brief 閉じる
Expand Down Expand Up @@ -460,7 +460,7 @@ IUTEST_PRAGMA_CRT_SECURE_WARN_DISABLE_END()
class StringStreamFile : public IFile
{
public:
virtual ~StringStreamFile() { Close(); }
virtual ~StringStreamFile() { StringStreamFile::Close(); }
public:
/**
* @brief 閉じる
Expand Down
6 changes: 6 additions & 0 deletions projects/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ option(build_use_gtest_configuration "use gtest build configuration." ON)
option(build_tests "tests build." ON)
option(build_namespace_tests "enable namespace test build." ON)
option(build_for_iwyu "for include-what-you-use." OFF)
option(build_for_clang_tidy, "for clang-tidy" OFF)

include(xcode_version.cmake)
# Xcode workarounds
Expand All @@ -31,6 +32,7 @@ if (CMAKE_VERSION VERSION_LESS 3.19)
-Dbuild_tests:BOOL=${build_tests}
-Dbuild_namespace_tests:BOOL=${build_namespace_tests}
-Dbuild_for_iwyu:BOOL=${build_for_iwyu}
-Dbuild_for_clang_tidy:BOOL=${build_for_clang_tidy}
${CMAKE_SOURCE_DIR})
message(STATUS "Recursive generate done")

Expand Down Expand Up @@ -105,6 +107,10 @@ if (build_for_iwyu)
add_definitions("-DIUTEST_BUILD_FOR_IWYU")
endif()

if (build_for_clang_tidy)
set(CMAKE_CXX_CLANG_TIDY "clang-tidy")
endif()

# include path
include_directories(${IUTEST_INCLUDE_DIR})
if (NOT "$ENV{GTEST_ROOT}" STREQUAL "")
Expand Down
5 changes: 5 additions & 0 deletions samples/.clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Checks: "
,-modernize-use-nullptr\
,-cppcoreguidelines-pro-type-reinterpret-cast\
"
InheritParentConfig: true
6 changes: 3 additions & 3 deletions samples/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @author t.shirayanagi
* @par copyright
* Copyright (C) 2011-2016, Takazumi Shirayanagi\n
* Copyright (C) 2011-2022, Takazumi Shirayanagi\n
* This software is released under the new BSD License,
* see LICENSE
*/
Expand Down Expand Up @@ -38,11 +38,11 @@
*//*--------------------------------------------------*/
class FooEnvironment : public ::iutest::Environment
{
virtual void SetUp()
virtual void SetUp() IUTEST_CXX_OVERRIDE
{
iuutil::Console::output("FooEnvironment::SetUp\n");
}
virtual void TearDown()
virtual void TearDown() IUTEST_CXX_OVERRIDE
{
iuutil::Console::output("FooEnvironment::TearDown\n");
}
Expand Down
14 changes: 10 additions & 4 deletions test/quiet_result_printer_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @author t.shirayanagi
* @par copyright
* Copyright (C) 2014-2021, Takazumi Shirayanagi\n
* Copyright (C) 2014-2022, Takazumi Shirayanagi\n
* This software is released under the new BSD License,
* see LICENSE
*/
Expand Down Expand Up @@ -40,7 +40,7 @@ int main(int argc, char* argv[])
#endif

#if !defined(IUTEST_USE_GTEST)
TestLogger logger;
static TestLogger logger;
::iutest::detail::iuConsole::SetLogger(&logger);
#endif

Expand All @@ -54,7 +54,10 @@ int main(int argc, char* argv[])
IUTEST_TERMINATE_ON_FAILURE(listeners.default_result_printer() == NULL);
#endif

if( IUTEST_RUN_ALL_TESTS() == 0 ) return 1;
if( IUTEST_RUN_ALL_TESTS() == 0 )
{
return 1;
}
#if !defined(IUTEST_USE_GTEST) && IUTEST_HAS_ASSERTION_RETURN
IUTEST_ASSERT_STRNOTIN("[ OK ]", logger.c_str()) << ::iutest::AssertionReturn<int>(1);
IUTEST_ASSERT_STRIN ("[ FAILED ]", logger.c_str()) << ::iutest::AssertionReturn<int>(1);
Expand All @@ -66,7 +69,10 @@ int main(int argc, char* argv[])
#if IUTEST_HAS_ASSERTION_RETURN
IUTEST_ASSERT_NULL( listener ) << ::iutest::AssertionReturn<int>(1);
#else
if( listener != NULL ) return 1;
if( listener != NULL )
{
return 1;
}
#endif

printf("*** Successful ***\n");
Expand Down
2 changes: 1 addition & 1 deletion test/scoped_trace_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ IUTEST(ScopedTraceTest, Failed)
IUTEST(ScopedTraceTest, Test)
{
#if !defined(IUTEST_USE_GTEST)
TestLogger logger1, logger2, logger3;
static TestLogger logger1, logger2, logger3;
::iutest::detail::iuConsole::SetLogger(&logger1);
#endif

Expand Down

0 comments on commit f76eee6

Please sign in to comment.