Added versioning

This commit is contained in:
Phil Nash
2012-11-15 22:15:41 +00:00
parent 70c5ef9eed
commit 7673a308d9
8 changed files with 188 additions and 57 deletions

View File

@@ -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 );
}
}

View File

@@ -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"

View File

@@ -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

View File

@@ -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