Revision: 75778
http://sourceforge.net/p/brlcad/code/75778
Author: starseeker
Date: 2020-05-12 20:58:30 +0000 (Tue, 12 May 2020)
Log Message:
-----------
checkpoint
Modified Paths:
--------------
brlcad/trunk/regress/repository/CMakeLists.txt
brlcad/trunk/regress/repository/regress-repository.cmake
brlcad/trunk/regress/repository/repocheck.cpp
Modified: brlcad/trunk/regress/repository/CMakeLists.txt
===================================================================
--- brlcad/trunk/regress/repository/CMakeLists.txt 2020-05-12 20:16:14 UTC
(rev 75777)
+++ brlcad/trunk/regress/repository/CMakeLists.txt 2020-05-12 20:58:30 UTC
(rev 75778)
@@ -1,9 +1,10 @@
+#set(REPOCHECK_TEST 1)
if (DEFINED REPOCHECK_TEST)
add_executable(repocheck repocheck.cpp)
if (O3_COMPILER_FLAG)
# This check benefits greatly from optimization. If we have the O3 flag,
use
# it - whether or not the standard build settings would add it.
- target_compile_options(lcheck PRIVATE "-O3")
+ target_compile_options(repocheck PRIVATE "-O3")
endif (O3_COMPILER_FLAG)
set_target_properties(repocheck PROPERTIES FOLDER "BRL-CAD Regression Tests")
@@ -19,7 +20,7 @@
-DL_FILE="${LOG_FILE}" -DS_FILE="${STAMP_FILE}"
-DF_LIST="${ALL_FILES_LIST}"
-P "${CMAKE_CURRENT_SOURCE_DIR}/regress-repository.cmake"
)
- add_custom_target(regress-repository DEPENDS ${STAMP_FILE}
${CMAKE_BINARY_DIR}/embedded_repository.txt)
+ add_custom_target(regress-repository DEPENDS ${STAMP_FILE} ${ALL_FILES_LIST})
set_target_properties(regress-repository PROPERTIES FOLDER "BRL-CAD
Regression Tests")
add_dependencies(regress regress-repository)
add_dependencies(check regress-repository)
Modified: brlcad/trunk/regress/repository/regress-repository.cmake
===================================================================
--- brlcad/trunk/regress/repository/regress-repository.cmake 2020-05-12
20:16:14 UTC (rev 75777)
+++ brlcad/trunk/regress/repository/regress-repository.cmake 2020-05-12
20:58:30 UTC (rev 75778)
@@ -8,7 +8,6 @@
execute_process(
COMMAND "${REPOSITORY_CHECK_EXEC}" "${FILES_LIST}" RESULT_VARIABLE
repository_result
OUTPUT_VARIABLE repository_log ERROR_VARIABLE repository_log
- WORKING_DIRECTORY ${WORKING_DIR}
)
message("Processing... done.")
Modified: brlcad/trunk/regress/repository/repocheck.cpp
===================================================================
--- brlcad/trunk/regress/repository/repocheck.cpp 2020-05-12 20:16:14 UTC
(rev 75777)
+++ brlcad/trunk/regress/repository/repocheck.cpp 2020-05-12 20:58:30 UTC
(rev 75778)
@@ -63,7 +63,7 @@
".*<unistd.h>.*",
".*<fcntl.h>.*",
NULL
- };
+ };
std::map<std::string, std::regex> filters;
int cnt = 0;
@@ -100,7 +100,7 @@
for (f_it = filters.begin(); f_it != filters.end(); f_it++) {
if (std::regex_match(sline, f_it->second)) {
match_line_nums[f_it->first].insert(lcnt);
- continue;
+ continue;
}
}
}
@@ -135,7 +135,7 @@
".*<netinet/tcp.h>.*",
".*<arpa/inet.h>.*",
NULL
- };
+ };
std::map<std::string, std::regex> filters;
int cnt = 0;
@@ -172,7 +172,7 @@
for (f_it = filters.begin(); f_it != filters.end(); f_it++) {
if (std::regex_match(sline, f_it->second)) {
match_line_nums[f_it->first].insert(lcnt);
- continue;
+ continue;
}
}
}
@@ -227,7 +227,7 @@
".*/ttcp.c",
".*/uce-dirent.h",
NULL
- };
+ };
std::vector<std::regex> filters;
int cnt = 0;
@@ -243,13 +243,13 @@
for (size_t j = 0; j < filters.size(); j++) {
if (std::regex_match(srcs[i], filters[j])) {
skip = true;
- break;
+ break;
}
}
if (skip) {
continue;
}
-
+
std::ifstream fs;
fs.open(srcs[i]);
if (!fs.is_open()) {
@@ -296,22 +296,23 @@
api_usage(std::string &log, std::vector<std::string> &srcs)
{
bool ret = false;
- std::map<std::string, std::vector<std::regex>> exemptions;
-
exemptions[std::string(".*[^a-zA-Z0-9_:]abort[(].*")].push_back(std::regex(".*/bomb[.]c$"));
-
exemptions[std::string(".*[^a-zA-Z0-9_:]dirname[(].*")].push_back(std::regex(".*/tests/dirname[.]c$"));
-
exemptions[std::string(".*[^a-zA-Z0-9_:]remove[(].*")].push_back(std::regex(".*/file[.]c$"));
-
exemptions[std::string(".*[^a-zA-Z0-9_:]strcasecmp[(].*")].push_back(std::regex(".*/str[.]c$"));
-
exemptions[std::string(".*[^a-zA-Z0-9_:]strcmp[(].*")].push_back(std::regex(".*/str[.]c$"));
-
exemptions[std::string(".*[^a-zA-Z0-9_:]strdup[(].*")].push_back(std::regex(".*/str[.]c$"));
-
exemptions[std::string(".*[^a-zA-Z0-9_:]strlcat[(].*")].push_back(std::regex(".*/str[.]c$"));
-
exemptions[std::string(".*[^a-zA-Z0-9_:]strncasecmp[(].*")].push_back(std::regex(".*/str[.]c$"));
-
exemptions[std::string(".*[^a-zA-Z0-9_:]strncat[(].*")].push_back(std::regex(".*/str[.]c$"));
-
exemptions[std::string(".*[^a-zA-Z0-9_:]strncmp[(]*")].push_back(std::regex(".*/str[.]c$"));
-
exemptions[std::string(".*[^a-zA-Z0-9_:]strncpy[(].*")].push_back(std::regex(".*/rt/db4[.]h$"));
-
exemptions[std::string(".*[^a-zA-Z0-9_:]strncpy[(].*")].push_back(std::regex(".*/str[.]c$"));
-
exemptions[std::string(".*[^a-zA-Z0-9_:]strncpy[(].*")].push_back(std::regex(".*/vls[.]c$"));
-
exemptions[std::string(".*[^a-zA-Z0-9_:]strncpy[(].*")].push_back(std::regex(".*/wfobj/obj_util[.]cpp$"));
-
+ std::map<std::string, std::vector<std::regex>> exemptions;
+
exemptions[std::string(".*[^a-zA-Z0-9_:]abort[(].*")].push_back(std::regex(".*/bomb[.]c$"));
+
exemptions[std::string(".*[^a-zA-Z0-9_:]dirname[(].*")].push_back(std::regex(".*/tests/dirname[.]c$"));
+
exemptions[std::string(".*[^a-zA-Z0-9_:]remove[(].*")].push_back(std::regex(".*/file[.]c$"));
+
exemptions[std::string(".*[^a-zA-Z0-9_:]strcasecmp[(].*")].push_back(std::regex(".*/str[.]c$"));
+
exemptions[std::string(".*[^a-zA-Z0-9_:]strcmp[(].*")].push_back(std::regex(".*/str[.]c$"));
+
exemptions[std::string(".*[^a-zA-Z0-9_:]strdup[(].*")].push_back(std::regex(".*/str[.]c$"));
+
exemptions[std::string(".*[^a-zA-Z0-9_:]strlcat[(].*")].push_back(std::regex(".*/str[.]c$"));
+
exemptions[std::string(".*[^a-zA-Z0-9_:]strlcpy[(].*")].push_back(std::regex(".*/str[.]c$"));
+
exemptions[std::string(".*[^a-zA-Z0-9_:]strncasecmp[(].*")].push_back(std::regex(".*/str[.]c$"));
+
exemptions[std::string(".*[^a-zA-Z0-9_:]strncat[(].*")].push_back(std::regex(".*/str[.]c$"));
+
exemptions[std::string(".*[^a-zA-Z0-9_:]strncmp[(].*")].push_back(std::regex(".*/str[.]c$"));
+
exemptions[std::string(".*[^a-zA-Z0-9_:]strncpy[(].*")].push_back(std::regex(".*/rt/db4[.]h$"));
+
exemptions[std::string(".*[^a-zA-Z0-9_:]strncpy[(].*")].push_back(std::regex(".*/str[.]c$"));
+
exemptions[std::string(".*[^a-zA-Z0-9_:]strncpy[(].*")].push_back(std::regex(".*/vls[.]c$"));
+
exemptions[std::string(".*[^a-zA-Z0-9_:]strncpy[(].*")].push_back(std::regex(".*/wfobj/obj_util[.]cpp$"));
+
const char *file_exemptions[] {
".*/CONFIG_CONTROL_DESIGN.*",
".*/bu/log[.]h$",
@@ -319,8 +320,9 @@
".*/bu/str[.]h$",
".*/cursor[.]c$",
".*/ttcp[.]c$",
+ ".*/misc/CMake/compat/.*",
NULL
- };
+ };
const char *funcs[] {
".*[^a-zA-Z0-9_:]abort[(].*",
@@ -370,7 +372,7 @@
for (size_t j = 0; j < file_filters.size(); j++) {
if (std::regex_match(srcs[i], file_filters[j])) {
skip = true;
- break;
+ break;
}
}
if (skip) {
@@ -394,7 +396,7 @@
for (ff_it = func_filters.begin(); ff_it != func_filters.end();
ff_it++) {
if (std::regex_match(sline, ff_it->second)) {
// If we have a it, make sure it's not an exemption
- std::cout << "check " << sline << "\n";
+ std::cout << "check " << sline << "\n";
bool exempt = false;
if (exemptions.find(ff_it->first) != exemptions.end()) {
std::vector<std::regex>::iterator e_it;
@@ -403,8 +405,8 @@
exempt = true;
break;
}
- }
- }
+ }
+ }
if (!exempt) {
instances[ff_it->first].insert(lcnt);
ret = true;
@@ -473,7 +475,7 @@
rf = reject_filters[cnt];
}
-
+
// Apply filters and build up the file sets we want to introspect.
std::regex codefile_regex(".*[.](c|cpp|cxx|cc|h|hpp|hxx|y|yy|l)([.]in)?$");
std::regex buildfile_regex(".*([.]cmake([.]in)?|CMakeLists.txt)$");
@@ -487,7 +489,7 @@
for (size_t i = 0; i < filters.size(); i++) {
if (std::regex_match(sfile, filters[i])) {
reject = true;
- break;
+ break;
}
}
if (reject) {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits