diff options
| author | Phil Nash | 2012-11-15 22:15:41 +0000 |
|---|---|---|
| committer | Phil Nash | 2012-11-15 22:15:41 +0000 |
| commit | 7673a308d971e4bdf38b7e7c9bd336384eb5a48e (patch) | |
| tree | 6f565c8f3e6ed57e24ba71792faa6c897a846a82 /include | |
| parent | 70c5ef9eede41e7061ff1af45b5babe0d7cde4ba (diff) | |
| download | catch3-7673a308d971e4bdf38b7e7c9bd336384eb5a48e.tar.gz | |
Added versioning
Diffstat (limited to 'include')
| -rw-r--r-- | include/catch_runner.hpp | 9 | ||||
| -rw-r--r-- | include/internal/catch_impl.hpp | 1 | ||||
| -rw-r--r-- | include/internal/catch_version.h | 24 | ||||
| -rw-r--r-- | include/internal/catch_version.hpp | 19 |
4 files changed, 52 insertions, 1 deletions
diff --git a/include/catch_runner.hpp b/include/catch_runner.hpp index 8f18267a..b1684020 100644 --- a/include/catch_runner.hpp +++ b/include/catch_runner.hpp @@ -12,6 +12,7 @@ #include "internal/catch_list.hpp" #include "internal/catch_runner_impl.hpp" #include "internal/catch_test_spec.h" +#include "internal/catch_version.h" #include <fstream> #include <stdlib.h> @@ -219,7 +220,13 @@ namespace Catch { } if( !displayedSpecificOption ) { - std::cout << exeName << " is a CATCH host application. Options are as follows:\n\n"; + std::cout << "\nCATCH v" << libraryVersion.MajorVersion << "." + << libraryVersion.MinorVersion << " build " + << libraryVersion.BuildNumber; + if( libraryVersion.BranchName != "master" ) + std::cout << " (" << libraryVersion.BranchName << " branch)"; + + std::cout << "\n\n" << exeName << " is a CATCH host application. Options are as follows:\n\n"; showUsage( std::cout ); } } diff --git a/include/internal/catch_impl.hpp b/include/internal/catch_impl.hpp index 8bbae1c1..18555e5e 100644 --- a/include/internal/catch_impl.hpp +++ b/include/internal/catch_impl.hpp @@ -26,6 +26,7 @@ #include "catch_expressionresult_builder.hpp" #include "catch_test_case_info.hpp" #include "catch_tags.hpp" +#include "catch_version.hpp" #include "../reporters/catch_reporter_basic.hpp" #include "../reporters/catch_reporter_xml.hpp" diff --git a/include/internal/catch_version.h b/include/internal/catch_version.h new file mode 100644 index 00000000..ec767996 --- /dev/null +++ b/include/internal/catch_version.h @@ -0,0 +1,24 @@ +/* + * Created by Phil on 13/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) + */ +#ifndef TWOBLUECUBES_CATCH_VERSION_H_INCLUDED +#define TWOBLUECUBES_CATCH_VERSION_H_INCLUDED + +namespace Catch { + + // Versioning information + struct Version { + const unsigned int MajorVersion; + const unsigned int MinorVersion; + const unsigned int BuildNumber; + const std::string BranchName; + }; + + extern Version libraryVersion; +} + +#endif // TWOBLUECUBES_CATCH_VERSION_H_INCLUDED diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp new file mode 100644 index 00000000..e7573191 --- /dev/null +++ b/include/internal/catch_version.hpp @@ -0,0 +1,19 @@ +/* + * 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) + */ +#ifndef TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED +#define TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED + +#include "catch_version.h" + +namespace Catch { + + // These numbers are maintained by a script + Version libraryVersion = { 0, 9, 1, "integration" }; +} + +#endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED |