Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
53dec91c
Commit
53dec91c
authored
Feb 06, 2020
by
Mark OLESEN
Browse files
COMP: add -help-man for Test-dummyLib (minimal packaging tests)
parent
e693f21d
Changes
3
Hide whitespace changes
Inline
Side-by-side
applications/test/00-dummy/Test-dummyLib.C
View file @
53dec91c
...
...
@@ -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>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
constexpr
char
nl
=
'\n'
;
constexpr
const
char
*
const
bold
=
"
\\
fB"
;
// nroff
constexpr
const
char
*
const
norm
=
"
\\
fR"
;
// nroff
int
main
(
int
argc
,
char
*
argv
[])
{
using
wmake
=
Foam
::
Detail
::
dummyLib
;
constexpr
const
char
*
const
website
=
"www.openfoam.com"
;
std
::
cout
<<
'\n'
<<
"OPENFOAM = "
<<
OPENFOAM
<<
'\n'
<<
"label = "
<<
wmake
::
label_size
<<
'\n'
<<
"scalar = "
<<
wmake
::
scalar_size
<<
" ("
<<
wmake
::
precision
<<
")
\n
"
<<
"arch = "
<<
wmake
::
arch
<<
'\n'
<<
"compiler = "
<<
wmake
::
compiler
<<
'\n'
;
using
std
::
cout
;
using
wmake
=
Foam
::
Detail
::
dummyLib
;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
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
;
}
std
::
cout
<<
'\n'
<<
"archComp = "
<<
wmake
::
archComp
<<
'\n'
<<
"archCompBase = "
<<
wmake
::
archCompBase
<<
'\n'
<<
"archCompFull = "
<<
wmake
::
archCompFull
<<
'\n'
;
std
::
cout
<<
'\n'
;
int
main
(
int
argc
,
char
*
argv
[])
{
// Process -help-man
if
(
argc
>
1
&&
strcmp
(
argv
[
1
],
"-help-man"
)
==
0
)
{
printMan
(
"Test-dummyLib"
);
return
0
;
}
cout
<<
nl
<<
"OPENFOAM = "
<<
OPENFOAM
<<
nl
<<
"label = "
<<
wmake
::
label_size
<<
nl
<<
"scalar = "
<<
wmake
::
scalar_size
<<
" ("
<<
wmake
::
precision
<<
')'
<<
nl
;
if
(
wmake
::
solveScalar_size
&&
wmake
::
solveScalar_size
!=
wmake
::
scalar_size
)
{
cout
<<
"solve = "
<<
wmake
::
solveScalar_size
<<
nl
;
}
cout
<<
"arch = "
<<
wmake
::
arch
<<
nl
<<
"compiler = "
<<
wmake
::
compiler
<<
nl
;
cout
<<
nl
<<
"archComp = "
<<
wmake
::
archComp
<<
nl
<<
"archCompBase = "
<<
wmake
::
archCompBase
<<
nl
<<
"archCompFull = "
<<
wmake
::
archCompFull
<<
nl
;
cout
<<
nl
;
return
0
;
}
...
...
applications/test/00-dummy/dummy/dummyLib.C
View file @
53dec91c
...
...
@@ -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
int
Foam
::
Detail
::
dummyLib
::
scalar_size
(
SCALAR_SIZE
);
const
std
::
str
in
g
Foam
::
Detail
::
dummyLib
::
label
_size
const
in
t
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
...
...
applications/test/00-dummy/dummy/dummyLib.H
View file @
53dec91c
...
...
@@ -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 t
o WM_PRECISION_OPTION
static
const
std
::
string
scalar_size
;
//- Compile-time o
f
WM_PRECISION_OPTION
static
const
std
::
string
precision
;
//- Compile-time of WM_LABEL_SIZE
static
const
std
::
str
in
g
label_size
;
static
const
in
t
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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment