From 931173ab77218e6f86a30652453d0c2c9678e7cf Mon Sep 17 00:00:00 2001 From: vitaut Date: Mon, 19 Oct 2015 08:05:09 -0700 Subject: [PATCH 1/5] Move appveyor.yml to support --- appveyor.yml => support/appveyor.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename appveyor.yml => support/appveyor.yml (100%) diff --git a/appveyor.yml b/support/appveyor.yml similarity index 100% rename from appveyor.yml rename to support/appveyor.yml From 317ff51fd9edbcd16f950c1f75ba07d531bc8e4b Mon Sep 17 00:00:00 2001 From: vitaut Date: Mon, 19 Oct 2015 08:08:23 -0700 Subject: [PATCH 2/5] Add a script to update the coverity branch --- support/update-converity-branch.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 support/update-converity-branch.py diff --git a/support/update-converity-branch.py b/support/update-converity-branch.py new file mode 100755 index 00000000..38f189fd --- /dev/null +++ b/support/update-converity-branch.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python +# Update the coverity branch from the master branch. +# It is not done automatically because Coverity Scan limits +# the number of submissions per day. + +from __future__ import print_function +import shutil, tempfile +from subprocess import check_call + +class Git: + def __init__(self, dir): + self.dir = dir + + def __call__(self, *args): + check_call(['git'] + list(args), cwd=self.dir) + +dir = tempfile.mkdtemp() +try: + git = Git(dir) + git('clone', '-b', 'coverity', 'git@github.com:cppformat/cppformat.git', dir) + git('merge', '-X', 'theirs', '--no-commit', 'origin/master') + git('reset', 'HEAD', '.travis.yml') + git('checkout', '--', '.travis.yml') + git('commit', '-m', 'Update coverity branch') + git('push') +finally: + shutil.rmtree(dir) From 56d3b9135fa977c3381607ed9afe6a0411678165 Mon Sep 17 00:00:00 2001 From: vitaut Date: Mon, 19 Oct 2015 08:17:05 -0700 Subject: [PATCH 3/5] Try a workaround for a bogus Coverity warning --- test/printf-test.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/printf-test.cc b/test/printf-test.cc index 041fbad1..67ac052e 100644 --- a/test/printf-test.cc +++ b/test/printf-test.cc @@ -295,7 +295,8 @@ void TestLength(const char *length_spec, U value) { fmt::ULongLong unsigned_value = value; // Apply integer promotion to the argument. fmt::ULongLong max = std::numeric_limits::max(); - if (max <= static_cast(std::numeric_limits::max())) { + using fmt::internal::check; + if (check(max <= static_cast(std::numeric_limits::max()))) { signed_value = static_cast(value); unsigned_value = static_cast(value); } else if (max <= std::numeric_limits::max()) { From 85a93a8078b85830d223b2598f58e62210afb0ce Mon Sep 17 00:00:00 2001 From: vitaut Date: Mon, 19 Oct 2015 08:25:30 -0700 Subject: [PATCH 4/5] Suppress another bogus warning in Coverity --- test/posix-test.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/posix-test.cc b/test/posix-test.cc index e4f75257..ace421d4 100644 --- a/test/posix-test.cc +++ b/test/posix-test.cc @@ -166,6 +166,7 @@ TEST(BufferedFileTest, CloseError) { TEST(BufferedFileTest, Fileno) { BufferedFile f; +#ifndef __COVERITY__ // fileno on a null FILE pointer either crashes or returns an error. EXPECT_DEATH_IF_SUPPORTED({ try { @@ -174,6 +175,7 @@ TEST(BufferedFileTest, Fileno) { std::exit(1); } }, ""); +#endif f = open_buffered_file(); EXPECT_TRUE(f.fileno() != -1); File copy = File::dup(f.fileno()); From 5a648b300f8e8ca8246cc1873fa3a280e209d529 Mon Sep 17 00:00:00 2001 From: vitaut Date: Mon, 19 Oct 2015 08:39:31 -0700 Subject: [PATCH 5/5] Suppress another bogus warning in Coverity --- test/test-main.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test-main.cc b/test/test-main.cc index 350044da..ef412406 100644 --- a/test/test-main.cc +++ b/test/test-main.cc @@ -52,8 +52,8 @@ int main(int argc, char **argv) { _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); - testing::InitGoogleTest(&argc, argv); try { + testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } catch (...) { // Catch all exceptions to make Coverity happy.