mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
COMP: add -help-man for Test-dummyLib (minimal packaging tests)
This commit is contained in:
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -32,33 +32,121 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "dummyLib.H"
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
|
||||
constexpr char nl = '\n';
|
||||
constexpr const char* const bold = "\\fB"; // nroff
|
||||
constexpr const char* const norm = "\\fR"; // nroff
|
||||
|
||||
constexpr const char* const website = "www.openfoam.com";
|
||||
|
||||
using std::cout;
|
||||
using wmake = Foam::Detail::dummyLib;
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// Main program:
|
||||
|
||||
static void printMan(const char* exeName)
|
||||
{
|
||||
cout
|
||||
<< ".TH \"" << exeName << "\" 1 "
|
||||
<< "\"OpenFOAM-v" << OPENFOAM
|
||||
<< "\" \"" << website << "\" \"OpenFOAM Commands Manual\""
|
||||
<< nl;
|
||||
|
||||
cout
|
||||
<< ".SH NAME" << nl
|
||||
<< exeName
|
||||
<< " \\- part of " << bold << "OpenFOAM" << norm
|
||||
<< " (The Open Source CFD Toolbox)." << nl
|
||||
<< ".SH SYNOPSIS" << nl
|
||||
<< bold << exeName << norm << " [OPTIONS]" << nl;
|
||||
|
||||
cout
|
||||
<< ".SH DESCRIPTION" << nl
|
||||
<< ".nf" << nl
|
||||
<< "Minimal compilation test with wmake, without OpenFOAM libraries."
|
||||
<< nl
|
||||
<< ".fi" << nl;
|
||||
|
||||
cout
|
||||
<< ".SH OPTIONS" << nl
|
||||
<< ".TP" << nl
|
||||
<< "-help-man" << nl
|
||||
<< "Display manpage" << nl;
|
||||
|
||||
cout
|
||||
<< ".SH INFORMATION" << nl
|
||||
<< ".nf" << nl
|
||||
<< "label = " << wmake::label_size << nl
|
||||
<< "scalar = " << wmake::scalar_size;
|
||||
|
||||
if
|
||||
(
|
||||
wmake::solveScalar_size
|
||||
&& wmake::solveScalar_size != wmake::scalar_size
|
||||
)
|
||||
{
|
||||
cout
|
||||
<< " [solve=" << wmake::solveScalar_size << "]";
|
||||
}
|
||||
cout
|
||||
<< " (" << wmake::precision << ')' << nl
|
||||
<< "arch = " << wmake::arch << nl
|
||||
<< "compiler = " << wmake::compiler << nl;
|
||||
|
||||
cout
|
||||
<< nl
|
||||
<< "archComp = " << wmake::archComp << nl
|
||||
<< "archCompBase = " << wmake::archCompBase << nl
|
||||
<< "archCompFull = " << wmake::archCompFull << nl;
|
||||
cout
|
||||
<< ".fi" << nl;
|
||||
|
||||
cout
|
||||
<< ".SH \"SEE ALSO\"" << nl
|
||||
<< "Online documentation https://" << website << "/documentation/"
|
||||
<< nl;
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
using wmake = Foam::Detail::dummyLib;
|
||||
// Process -help-man
|
||||
if (argc > 1 && strcmp(argv[1], "-help-man") == 0)
|
||||
{
|
||||
printMan("Test-dummyLib");
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::cout
|
||||
<< '\n'
|
||||
<< "OPENFOAM = " << OPENFOAM << '\n'
|
||||
<< "label = " << wmake::label_size << '\n'
|
||||
cout
|
||||
<< nl
|
||||
<< "OPENFOAM = " << OPENFOAM << nl
|
||||
<< "label = " << wmake::label_size << nl
|
||||
<< "scalar = " << wmake::scalar_size
|
||||
<< " (" << wmake::precision << ")\n"
|
||||
<< "arch = " << wmake::arch << '\n'
|
||||
<< "compiler = " << wmake::compiler << '\n';
|
||||
<< " (" << wmake::precision << ')' << nl;
|
||||
|
||||
if
|
||||
(
|
||||
wmake::solveScalar_size
|
||||
&& wmake::solveScalar_size != wmake::scalar_size
|
||||
)
|
||||
{
|
||||
cout
|
||||
<< "solve = " << wmake::solveScalar_size << nl;
|
||||
}
|
||||
|
||||
std::cout
|
||||
<< '\n'
|
||||
<< "archComp = " << wmake::archComp << '\n'
|
||||
<< "archCompBase = " << wmake::archCompBase << '\n'
|
||||
<< "archCompFull = " << wmake::archCompFull << '\n';
|
||||
cout
|
||||
<< "arch = " << wmake::arch << nl
|
||||
<< "compiler = " << wmake::compiler << nl;
|
||||
|
||||
std::cout
|
||||
<< '\n';
|
||||
cout
|
||||
<< nl
|
||||
<< "archComp = " << wmake::archComp << nl
|
||||
<< "archCompBase = " << wmake::archCompBase << nl
|
||||
<< "archCompFull = " << wmake::archCompFull << nl;
|
||||
|
||||
cout<< nl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -29,12 +29,15 @@ License
|
||||
|
||||
// We know that our options file has properly defined types here
|
||||
|
||||
#undef SOLVE_SIZE
|
||||
|
||||
#if defined WM_SP
|
||||
# define PRECISION "SP"
|
||||
# define SCALAR_SIZE (8*sizeof(float))
|
||||
#elif defined(WM_SPDP)
|
||||
# define PRECISION "SPDP"
|
||||
# define SCALAR_SIZE (8*sizeof(float))
|
||||
# define SOLVE_SIZE (8*sizeof(double))
|
||||
#elif defined WM_DP
|
||||
# define PRECISION "DP"
|
||||
# define SCALAR_SIZE (8*sizeof(double))
|
||||
@ -66,14 +69,17 @@ const std::string Foam::Detail::dummyLib::compiler(WM_COMPILER);
|
||||
|
||||
const std::string Foam::Detail::dummyLib::precision(PRECISION);
|
||||
|
||||
const std::string Foam::Detail::dummyLib::scalar_size
|
||||
(
|
||||
std::to_string(SCALAR_SIZE)
|
||||
);
|
||||
const int Foam::Detail::dummyLib::label_size(WM_LABEL_SIZE);
|
||||
|
||||
const std::string Foam::Detail::dummyLib::label_size
|
||||
const int Foam::Detail::dummyLib::scalar_size(SCALAR_SIZE);
|
||||
|
||||
const int Foam::Detail::dummyLib::solveScalar_size
|
||||
(
|
||||
std::to_string(WM_LABEL_SIZE)
|
||||
#ifdef SOLVE_SIZE
|
||||
SOLVE_SIZE
|
||||
#else
|
||||
SCALAR_SIZE
|
||||
#endif
|
||||
);
|
||||
|
||||
const std::string Foam::Detail::dummyLib::archComp
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -60,14 +60,17 @@ struct dummyLib
|
||||
//- Compile-time value of WM_COMPILER
|
||||
static const std::string compiler;
|
||||
|
||||
//- Compile-time equivalent to WM_PRECISION_OPTION
|
||||
static const std::string scalar_size;
|
||||
//- Compile-time of WM_PRECISION_OPTION
|
||||
static const std::string precision;
|
||||
|
||||
//- Compile-time of WM_LABEL_SIZE
|
||||
static const std::string label_size;
|
||||
static const int label_size;
|
||||
|
||||
//- Compile-time value of WM_PRECISION_OPTION
|
||||
static const std::string precision;
|
||||
//- Compile-time equivalent to WM_PRECISION_OPTION
|
||||
static const int scalar_size;
|
||||
|
||||
//- Compile-time equivalent to WM_PRECISION_OPTION
|
||||
static const int solveScalar_size;
|
||||
|
||||
//- Compile-time value of WM_ARCH + WM_COMPILER
|
||||
static const std::string archComp;
|
||||
|
||||
Reference in New Issue
Block a user