Skip to content

Commit 7602b2f

Browse files
marcosbentoiainrussell
authored andcommitted
Pull request #23: Apply source code format
Merge in ECFLOW/ecflow from feature/ECFLOW-1868_source_code_formatting to develop * commit '26fafe1755827c9d32b414703566546f44f71b24': Apply code formatting (ECFLOW-1868) Include all headers+sources in CMakeLists.txt (ECFLOW-1868)
2 parents 38718f3 + 26fafe1 commit 7602b2f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+5084
-4790
lines changed

ANode/CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ add_subdirectory( parser )
2929
#file( GLOB test_srcs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "test/*.cpp" )
3030

3131
list( APPEND test_srcs
32+
# HEADERS
33+
test/MyDefsFixture.hpp
34+
# SOURCES
3235
test/Test_ECFLOW-195.cpp
3336
test/Test_ECFLOW-247.cpp
3437
test/Test_ECFLOW-417.cpp

ANode/parser/CMakeLists.txt

+9-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
# cd $WK/ANode/parser
88
# find test -name \*.cpp | sort
99
list( APPEND test_srcs
10+
# HEADERS
11+
test/PersistHelper.hpp
12+
# SOURCES
1013
test/PersistHelper.cpp
1114
test/TestAutoAddExterns.cpp
1215
test/TestDefsStructurePersistAndReload.cpp
@@ -28,6 +31,7 @@ ecbuild_add_test( TARGET u_aparser
2831
DEFINITIONS ${BOOST_TEST_DYN_LINK}
2932
TEST_DEPENDS u_anode
3033
)
34+
target_clangformat(u_aparser)
3135

3236
if (ENABLE_ALL_TESTS)
3337
#
@@ -47,6 +51,7 @@ if (ENABLE_ALL_TESTS)
4751
${Boost_INCLUDE_DIRS}
4852
DEFINITIONS ${BOOST_TEST_DYN_LINK}
4953
)
54+
target_clangformat(perf_aparser)
5055

5156
#
5257
# Timer for arbitary defs file,
@@ -65,7 +70,7 @@ if (ENABLE_ALL_TESTS)
6570
${Boost_INCLUDE_DIRS}
6671
DEFINITIONS ${BOOST_TEST_DYN_LINK}
6772
)
68-
73+
target_clangformat(perf_aparser_timer)
6974
#
7075
# Tests parser for a single defs file.
7176
#
@@ -82,4 +87,6 @@ if (ENABLE_ALL_TESTS)
8287
${Boost_INCLUDE_DIRS}
8388
DEFINITIONS ${BOOST_TEST_DYN_LINK}
8489
)
85-
endif()
90+
target_clangformat(perf_aparser_only)
91+
92+
endif()

ANode/parser/test/ParseOnly.cpp

+38-39
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
//
1313
// Description :
1414
//============================================================================
15-
#include <string>
16-
#include <iostream>
1715
#include <fstream>
16+
#include <iostream>
17+
#include <string>
1818

1919
#include "Defs.hpp"
2020
#include "PrintStyle.hpp"
@@ -28,46 +28,45 @@ using namespace ecf;
2828
// user 0m2.59s
2929
// sys 0m0.18s
3030

31-
int main(int argc, char* argv[])
32-
{
33-
// cout << "argc = " << argc << "\n";
34-
// for(int i = 0; i < argc; i++) {
35-
// cout << "arg " << i << ":" << argv[i] << "\n";
36-
// }
31+
int main(int argc, char* argv[]) {
32+
// cout << "argc = " << argc << "\n";
33+
// for(int i = 0; i < argc; i++) {
34+
// cout << "arg " << i << ":" << argv[i] << "\n";
35+
// }
3736

38-
if (argc != 2) {
39-
cout << "Expect single argument which is path to a defs file\n";
40-
return 1;
41-
}
37+
if (argc != 2) {
38+
cout << "Expect single argument which is path to a defs file\n";
39+
return 1;
40+
}
4241

43-
std::string path = argv[1];
42+
std::string path = argv[1];
4443

45-
Defs defs;
46-
std::string errorMsg,warningMsg;
47-
if (!defs.restore(path,errorMsg,warningMsg)) {
48-
cout << errorMsg << "\n";
49-
cout << warningMsg << "\n";
50-
return 1;
51-
}
44+
Defs defs;
45+
std::string errorMsg, warningMsg;
46+
if (!defs.restore(path, errorMsg, warningMsg)) {
47+
cout << errorMsg << "\n";
48+
cout << warningMsg << "\n";
49+
return 1;
50+
}
5251

53-
// // Determine average number of variables for nodes with variables
54-
// vector<Node*> nodes;
55-
// defs.getAllNodes(nodes);
56-
// cout << "Total number of nodes: " << nodes.size() << "\n";
57-
// size_t number_of_variables = 0;
58-
// size_t nodes_with_variables = 0;
59-
// for(const auto& n : nodes) {
60-
// // cout << n->variables().size() << "\n";
61-
// if (n->variables().size() > 0) {
62-
// number_of_variables += n->variables().size();
63-
// nodes_with_variables++;
64-
// }
65-
// }
66-
// cout << "number_of_variables " << number_of_variables << "\n";
67-
// cout << "nodes_with_variables " << nodes_with_variables << "\n";
68-
// cout <<"Average number of variables per node " << (double)number_of_variables/nodes_with_variables << "\n";
52+
// // Determine average number of variables for nodes with variables
53+
// vector<Node*> nodes;
54+
// defs.getAllNodes(nodes);
55+
// cout << "Total number of nodes: " << nodes.size() << "\n";
56+
// size_t number_of_variables = 0;
57+
// size_t nodes_with_variables = 0;
58+
// for(const auto& n : nodes) {
59+
// // cout << n->variables().size() << "\n";
60+
// if (n->variables().size() > 0) {
61+
// number_of_variables += n->variables().size();
62+
// nodes_with_variables++;
63+
// }
64+
// }
65+
// cout << "number_of_variables " << number_of_variables << "\n";
66+
// cout << "nodes_with_variables " << nodes_with_variables << "\n";
67+
// cout <<"Average number of variables per node " << (double)number_of_variables/nodes_with_variables << "\n";
6968

70-
// PrintStyle style(PrintStyle::MIGRATE);
71-
// cout << defs;
72-
return 0;
69+
// PrintStyle style(PrintStyle::MIGRATE);
70+
// cout << defs;
71+
return 0;
7372
}

0 commit comments

Comments
 (0)