diff options
| author | Baruch Burstein | 2017-07-09 12:48:29 +0300 |
|---|---|---|
| committer | Baruch Burstein | 2017-07-09 12:48:29 +0300 |
| commit | af05ccfe5d9096e203f63e5cde07e6767f532334 (patch) | |
| tree | de302ee0ef9b1cb671ad81e4a19716e37f6e6f2b /include/internal/catch_version.cpp | |
| parent | 058b21e604dd3486fe4f7957e4a4485104943905 (diff) | |
| parent | fc32165d48f0a46a60ac02e0e52f8c89adafd8be (diff) | |
| download | catch3-af05ccfe5d9096e203f63e5cde07e6767f532334.tar.gz | |
Merge remote-tracking branch 'upstream/dev-modernize' into dev-better-verbosity
Diffstat (limited to 'include/internal/catch_version.cpp')
| -rw-r--r-- | include/internal/catch_version.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/include/internal/catch_version.cpp b/include/internal/catch_version.cpp new file mode 100644 index 00000000..d2f234ea --- /dev/null +++ b/include/internal/catch_version.cpp @@ -0,0 +1,44 @@ +/* + * Created by Phil on 14/11/2012. + * Copyright 2012 Two Blue Cubes Ltd. All rights reserved. + * + * Distributed under the Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + */ + +#include "catch_version.h" +#include <ostream> + +namespace Catch { + + Version::Version + ( unsigned int _majorVersion, + unsigned int _minorVersion, + unsigned int _patchNumber, + char const * const _branchName, + unsigned int _buildNumber ) + : majorVersion( _majorVersion ), + minorVersion( _minorVersion ), + patchNumber( _patchNumber ), + branchName( _branchName ), + buildNumber( _buildNumber ) + {} + + std::ostream& operator << ( std::ostream& os, Version const& version ) { + os << version.majorVersion << '.' + << version.minorVersion << '.' + << version.patchNumber; + // branchName is never null -> 0th char is \0 if it is empty + if (version.branchName[0]) { + os << '-' << version.branchName + << '.' << version.buildNumber; + } + return os; + } + + Version libraryVersion() { + static Version version( 2, 0, 0, "develop", 1 ); + return version; + } + +} |