blob: fdf3be6ebbb5d17e560263f41daf97952c79eb5b [file] [log] [blame]
Phil Nash7673a302012-11-15 22:15:41 +00001/*
2 * Created by Phil on 14/11/2012.
3 * Copyright 2012 Two Blue Cubes Ltd. All rights reserved.
4 *
5 * Distributed under the Boost Software License, Version 1.0. (See accompanying
6 * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 */
8#ifndef TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED
9#define TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED
10
11#include "catch_version.h"
12
13namespace Catch {
14
Phil Nash21f7ef62015-06-29 18:05:23 +010015 Version::Version
16 ( unsigned int _majorVersion,
17 unsigned int _minorVersion,
18 unsigned int _patchNumber,
Martin Hořeňovskýd07999d2017-03-22 17:45:36 +010019 char const * const _branchName,
Phil Nash21f7ef62015-06-29 18:05:23 +010020 unsigned int _buildNumber )
21 : majorVersion( _majorVersion ),
22 minorVersion( _minorVersion ),
23 patchNumber( _patchNumber ),
24 branchName( _branchName ),
25 buildNumber( _buildNumber )
26 {}
27
28 std::ostream& operator << ( std::ostream& os, Version const& version ) {
Martin Hořeňovskýbcaa2f92017-01-29 23:07:15 +010029 os << version.majorVersion << '.'
30 << version.minorVersion << '.'
Phil Nash21f7ef62015-06-29 18:05:23 +010031 << version.patchNumber;
Martin Hořeňovskýd07999d2017-03-22 17:45:36 +010032 // branchName is never null -> 0th char is \0 if it is empty
33 if (version.branchName[0]) {
34 os << '-' << version.branchName
35 << '.' << version.buildNumber;
Phil Nash21f7ef62015-06-29 18:05:23 +010036 }
37 return os;
38 }
39
Kevin Usheye04dc512017-03-16 11:17:45 -070040 inline Version libraryVersion() {
Martin Hořeňovskýfc7f0a02017-04-25 11:08:02 +020041 static Version version( 1, 9, 2, "", 0 );
Kevin Usheye04dc512017-03-16 11:17:45 -070042 return version;
43 }
Phil Nash21f7ef62015-06-29 18:05:23 +010044
Phil Nash7673a302012-11-15 22:15:41 +000045}
46
47#endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED