Revision: 75987
http://sourceforge.net/p/brlcad/code/75987
Author: starseeker
Date: 2020-05-31 14:20:30 +0000 (Sun, 31 May 2020)
Log Message:
-----------
Merge regression test system changes from bioh branch (through r75986)
Modified Paths:
--------------
brlcad/trunk/CMakeLists.txt
brlcad/trunk/misc/CMake/BRLCAD_Targets.cmake
brlcad/trunk/regress/CMakeLists.txt
brlcad/trunk/regress/burst/CMakeLists.txt
brlcad/trunk/regress/gchecker/CMakeLists.txt
brlcad/trunk/regress/gchecker/regress-gchecker.cmake.in
brlcad/trunk/regress/gcv/CMakeLists.txt
brlcad/trunk/regress/gcv/dem/CMakeLists.txt
brlcad/trunk/regress/gcv/dem/regress-dem.cmake.in
brlcad/trunk/regress/ged/CMakeLists.txt
brlcad/trunk/regress/icv/CMakeLists.txt
brlcad/trunk/regress/icv/regress-icv_export.cmake.in
brlcad/trunk/regress/icv/regress-icv_import.cmake.in
brlcad/trunk/regress/licenses/CMakeLists.txt
brlcad/trunk/regress/mged/CMakeLists.txt
brlcad/trunk/regress/nurbs/CMakeLists.txt
brlcad/trunk/regress/pkg/CMakeLists.txt
brlcad/trunk/regress/repository/CMakeLists.txt
brlcad/trunk/regress/rtwizard/CMakeLists.txt
brlcad/trunk/regress/rtwizard/regress-rtwiz.cmake.in
brlcad/trunk/src/libged/tests/CMakeLists.txt
Added Paths:
-----------
brlcad/trunk/regress/burst/regress-burst.cmake.in
brlcad/trunk/regress/gcv/fastgen/
brlcad/trunk/regress/ged/mater.c
brlcad/trunk/regress/ged/regress-ged_mater.cmake.in
brlcad/trunk/regress/licenses/regress-licenses.cmake.in
brlcad/trunk/regress/mged/regress-mged.cmake.in
brlcad/trunk/regress/nurbs/regress-nurbs-test.cmake.in
brlcad/trunk/regress/pkg/regress-pkg.cmake.in
brlcad/trunk/regress/repository/regress-repository.cmake.in
Removed Paths:
-------------
brlcad/trunk/regress/burst/regress-burst-ktank.cmake.in
brlcad/trunk/regress/gcv/fastgen_box.fast4
brlcad/trunk/regress/gcv/fastgen_dos.fast4
brlcad/trunk/regress/gcv/regress-fastgen.cmake.in
brlcad/trunk/regress/ged/regress-mater.cmake.in
brlcad/trunk/regress/licenses/regress-licenses.cmake
brlcad/trunk/regress/mged/run_test
brlcad/trunk/regress/nurbs/regress-nurbs-nirt.cmake.in
brlcad/trunk/regress/repository/regress-repository.cmake
brlcad/trunk/src/libged/tests/mater.c
Property Changed:
----------------
brlcad/trunk/
brlcad/trunk/NEWS
brlcad/trunk/doc/
brlcad/trunk/include/
brlcad/trunk/regress/
brlcad/trunk/src/libbu/
brlcad/trunk/src/other/
brlcad/trunk/src/other/libgdiam/
brlcad/trunk/src/other/libnetpbm/
brlcad/trunk/src/other/libspsr/
brlcad/trunk/src/other/libvds/
brlcad/trunk/src/other/poly2tri/
brlcad/trunk/src/other/stepcode/
Index: brlcad/trunk
===================================================================
--- brlcad/trunk 2020-05-31 14:04:45 UTC (rev 75986)
+++ brlcad/trunk 2020-05-31 14:20:30 UTC (rev 75987)
Property changes on: brlcad/trunk
___________________________________________________________________
Modified: svn:mergeinfo
## -1,5 +1,5 ##
/brlcad/branches/RELEASE:57439,57447-57860,69901-69913,70323-70333,71915-72242,72525-72534,72826-72858,74376-74454,74964-75140,75682-75685
-/brlcad/branches/bioh:75720-75736,75740-75742,75860-75891
+/brlcad/branches/bioh:75720-75736,75740-75742,75860-75891,75894-75986
/brlcad/branches/brep-debug:61373,61375,61404,61427,61429,61470,61544,61567,61576,61999,62018,62094,62098,62107,62117,62406,62416-62519,62521-62584,62593-62614,62623,62658,62660-62674,62681-62771,62876,62901,62907,62910,62925,62928,62931-63025,63027,63051,63054-63056,63069,63071-63073,63122,63160-63161,63165,63171,63184,63187,63189-63190,63193-63196,63200,63202,63205-63210,63213,63219-63225,63232-63233,63236,63238,63338,63350-63353,63481,63618,63669,64173-64174,64176-64177,64229-64233,64242,64244,64360-64362,65165,65245,65249,65334,65833-65834,66370-66375,66931-66932,66934,67012-67015,67018-67019,67021-67022,67406,67740,67746-67748,67950,67952,68144-68145,68636,68640-68643,68820,69081,69109,69168,69206,69289,69346,69460-69461,69582-69583,69719-69721,69857-69859,69927,69995-69996,70148-70149,70347-70349,70377,70526-70527,71006-71007,71009-71022,71046-71047,71049,71096-71100
/brlcad/branches/bullet:62518
/brlcad/branches/cmake:43219
Modified: brlcad/trunk/CMakeLists.txt
===================================================================
--- brlcad/trunk/CMakeLists.txt 2020-05-31 14:04:45 UTC (rev 75986)
+++ brlcad/trunk/CMakeLists.txt 2020-05-31 14:20:30 UTC (rev 75987)
@@ -492,7 +492,7 @@
COMMAND ${CMAKE_COMMAND} -E echo " regression tests. To consider a
build viable for production use,"
COMMAND ${CMAKE_COMMAND} -E echo " these tests must pass.
Dependencies are compiled automatically."
COMMAND ${CMAKE_COMMAND} -E echo
"\"**********************************************************************\""
- COMMAND ${CMAKE_CTEST_COMMAND} -C ${CONFIG} -LE \"Regression|NOT_WORKING\"
-E \"^regress-|NOTE|benchmark|slow-\" --output-on-failure ${JFLAG}
+ COMMAND ${CMAKE_CTEST_COMMAND} -C ${CONFIG} -LE \"Regression|STAND_ALONE\"
-E \"^regress-|NOTE|benchmark|slow-\" --output-on-failure ${JFLAG}
COMMAND ${CMAKE_CTEST_COMMAND} -C ${CONFIG} -R \"benchmark\"
--output-on-failure ${JFLAG}
COMMAND ${CMAKE_CTEST_COMMAND} -C ${CONFIG} -L \"Regression\"
--output-on-failure ${JFLAG}
)
Index: brlcad/trunk/NEWS
===================================================================
--- brlcad/trunk/NEWS 2020-05-31 14:04:45 UTC (rev 75986)
+++ brlcad/trunk/NEWS 2020-05-31 14:20:30 UTC (rev 75987)
Property changes on: brlcad/trunk/NEWS
___________________________________________________________________
Modified: svn:mergeinfo
## -1,4 +1,5 ##
/brlcad/branches/RELEASE/NEWS:57439,57447-57860,68609-68613,69901-69913,70323-70333,71915-72242,72525-72534,72826-72858,74376-74454,74964-75140
+/brlcad/branches/bioh/NEWS:75894-75986
/brlcad/branches/brep-debug/NEWS:61373,61375,61404,61427,61429,61470,61544,61567,61576,61999,62018,62094,62098,62107,62117,62406,62416-62519,62521-62584,62593-62614,62623,62658,62660-62674,62681-62771,62876,62901,62907,62910,62925,62928,62931-63025,63027,63051,63054-63056,63069,63071-63073,63122,63160-63161,63165,63171,63184,63187,63189-63190,63193-63196,63200,63202,63205-63210,63213,63219-63225,63232-63233,63236,63238,63338,63350-63353,63481,63618,63669,64173-64174,64176-64177,64229-64233,64242,64244,64360-64362,65165,65245,65249,65334,65833-65834,66370-66375,66931-66932,66934,67012-67015,67018-67019,67021-67022,67406,67740,67746-67748,67950,67952,68144-68145,68636,68640-68643,68820,69081,69109,69168,69206,69289,69346,69460-69461,69582-69583,69719-69721,69857-69859,69927,69995-69996,70148-70149,70347-70349,70377,70526-70527,71006-71007,71009-71022,71046-71047,71049,71096-71100
/brlcad/branches/bullet/NEWS:62518
/brlcad/branches/cmake/NEWS:43219
Index: brlcad/trunk/doc
===================================================================
--- brlcad/trunk/doc 2020-05-31 14:04:45 UTC (rev 75986)
+++ brlcad/trunk/doc 2020-05-31 14:20:30 UTC (rev 75987)
Property changes on: brlcad/trunk/doc
___________________________________________________________________
Modified: svn:mergeinfo
## -1,4 +1,5 ##
/brlcad/branches/RELEASE/doc:57439,57447-57860,69901-69913,71917-72242,72525-72534,72826-72858,74376-74454,74964-75140
+/brlcad/branches/bioh/doc:75894-75986
/brlcad/branches/brep-debug/doc:61373,61375,61404,61427,61429,61470,61544,61567,61576,61999,62018,62094,62098,62107,62117,62406,62416-62519,62521-62584,62593-62614,62623,62658,62660-62674,62681-62771,62876,62901,62907,62910,62925,62928,62931-63025,63027,63051,63054-63056,63069,63071-63073,63122,63160-63161,63165,63171,63184,63187,63189-63190,63193-63196,63200,63202,63205-63210,63213,63219-63225,63232-63233,63236,63238,63338,63350-63353,63481,63618,63669,64173-64174,64176-64177,64229-64233,64242,64244,64360-64362,65165,65245,65249,65334,65833-65834,66370-66375,66931-66932,66934,67012-67015,67018-67019,67021-67022,67406,67740,67746-67748,67950,67952,68144-68145,68636,68640-68643,68820,69081,69109,69206,69289,69346,69460-69461,69582-69583,69719-69721,69857-69859,69927
/brlcad/branches/bullet/doc:62518
/brlcad/branches/cmake/doc:43219
Index: brlcad/trunk/include
===================================================================
--- brlcad/trunk/include 2020-05-31 14:04:45 UTC (rev 75986)
+++ brlcad/trunk/include 2020-05-31 14:20:30 UTC (rev 75987)
Property changes on: brlcad/trunk/include
___________________________________________________________________
Modified: svn:mergeinfo
## -1,5 +1,5 ##
/brlcad/branches/RELEASE/include:57439,57447-57860,69901-69913,71915-72242,72525-72534,72826-72858,74376-74454,74964-75140
-/brlcad/branches/bioh/include:75720-75736,75740-75742,75860-75891
+/brlcad/branches/bioh/include:75720-75736,75740-75742,75860-75891,75894-75986
/brlcad/branches/brep-debug/include:61373,61375,61404,61427,61429,61470,61544,61567,61576,61999,62018,62094,62098,62107,62117,62406,62416-62519,62521-62584,62593-62614,62623,62658,62660-62674,62681-62771,62876,62901,62907,62910,62925,62928,62931-63025,63027,63051,63054-63056,63069,63071-63073,63122,63160-63161,63165,63171,63184,63187,63189-63190,63193-63196,63200,63202,63205-63210,63213,63219-63225,63232-63233,63236,63238,63338,63350-63353,63481,63618,63669,64173-64174,64176-64177,64229-64233,64242,64244,64360-64362,65165,65245,65249,65334,65833-65834,66370-66375,66931-66932,66934,67012-67015,67018-67019,67021-67022,67406,67740,67746-67748,67950,67952,68144-68145,68636,68640-68643,68820,69081,69109,69206,69289,69346,69460-69461,69582-69583,69719-69721,69857-69859,69927
/brlcad/branches/bullet/include:62518
/brlcad/branches/cmake/include:43219
Modified: brlcad/trunk/misc/CMake/BRLCAD_Targets.cmake
===================================================================
--- brlcad/trunk/misc/CMake/BRLCAD_Targets.cmake 2020-05-31 14:04:45 UTC
(rev 75986)
+++ brlcad/trunk/misc/CMake/BRLCAD_Targets.cmake 2020-05-31 14:20:30 UTC
(rev 75987)
@@ -895,6 +895,123 @@
BRLCAD_MANAGE_FILES(${inmanlist} ${man_target_dir})
endfunction(ADD_MAN_PAGES)
+
+
+#-----------------------------------------------------------------------------
+# The default operational mode of Regression tests is to be executed by a
+# parent CMake script, which captures the I/O from the test and stores it in an
+# individual log file named after the test. By default, a custom command and
+# CTest add_test command are set up to run a configured script. If TEST_SCRIPT
+# is provided specifying a particular script file that is used, otherwise the
+# convention of ${testname}.cmake.in in the current source directory is assumed
+# to specify the input test script.
+#
+# Particularly when configuration dependent builds are in play, a test
+# executable's location needs special handling to ensure the scripts run the
+# correct version of a program. The standard mechanism is to specify the CMake
+# target name of the executable by supplying it via the EXEC option and then
+# pass the output of $<TARGET_FILE:${${testname}_EXEC}> to the running CMake
+# script. (Note that the script must in turn post-process this value to unquote
+# it in case of special characters in pathnames.)
+#
+# To allow for more customized test execution, the option TEST_DEFINED may be
+# passed to the function to instruct it to skip all setup for add_test and
+# custom command definitions. It is the callers responsibility to define an
+# appropriately named test with add_test - BRLCAD_REGRESSION_TEST in this mode
+# will then perform only the specific build target definition and subsequent
+# steps for wiring the test into the higher level commands.
+#
+# Standard actions for all regression targets:
+#
+# 1. A custom build target with the pattern regress-${testname} is defined
+# to allow for individual execution of the regression test with
+# "make ${testname}"
+#
+# 2. A label is added identifying the test as a regression test so the top
+# level commands "make check" and "make regress" know this particular
+# tests is one of the tests they are supposed to execute.
+#
+# 3. Any dependencies in ${depends_list} are added as build requirements to
+# the regress and check targets. This ensures that (unlike "make test"
+# and CTest itself) when those targets are built the dependencies of the
+# tests are built first. (A default CTest run prior to building will
+# result in all tests failing.)
+#
+# 4. If the keyword "STAND_ALONE" is passed in, a ${testname} target
+# is defined but no other connections are made between that target and the
+# agglomeration targets.
+#
+# 5. If a TIMEOUT argument is passed, a specific timeout tiem is set on the
+# test. Otherwise, a default is assigned to ensure no test runs
+# indefinitely.
+
+function(BRLCAD_REGRESSION_TEST testname depends_list)
+
+ cmake_parse_arguments(${testname} "TEST_DEFINED;STAND_ALONE"
"TEST_SCRIPT;TIMEOUT;EXEC" "" ${ARGN})
+
+ if (NOT ${testname}_TEST_DEFINED)
+
+ # Test isn't yet defined - do the add_test setup
+ if (${testname}_TEST_SCRIPT)
+ configure_file("${${testname}_TEST_SCRIPT}"
"${CMAKE_CURRENT_BINARY_DIR}/${testname}.cmake" @ONLY)
+ else (${testname}_TEST_SCRIPT)
+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${testname}.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/${testname}.cmake" @ONLY)
+ endif (${testname}_TEST_SCRIPT)
+
+ if (TARGET ${${testname}_EXEC})
+ add_test(NAME ${testname} COMMAND "${CMAKE_COMMAND}"
-DEXEC=$<TARGET_FILE:${${testname}_EXEC}> -P
"${CMAKE_CURRENT_BINARY_DIR}/${testname}.cmake")
+ else (TARGET ${${testname}_EXEC})
+ add_test(NAME ${testname} COMMAND "${CMAKE_COMMAND}" -P
"${CMAKE_CURRENT_BINARY_DIR}/${testname}.cmake")
+ endif (TARGET ${${testname}_EXEC})
+
+ endif (NOT ${testname}_TEST_DEFINED)
+
+
+ # Every regression test gets a build target
+ if (CMAKE_CONFIGURATION_TYPES)
+ add_custom_target(${testname} COMMAND ${CMAKE_CTEST_COMMAND} -C
${CMAKE_CFG_INTDIR} -R ^${testname} --output-on-failure)
+ else (CMAKE_CONFIGURATION_TYPES)
+ add_custom_target(${testname} COMMAND ${CMAKE_CTEST_COMMAND} -R
^${testname} --output-on-failure)
+ endif (CMAKE_CONFIGURATION_TYPES)
+ if (depends_list)
+ add_dependencies(${testname} ${depends_list})
+ endif (depends_list)
+
+ # Make sure we at least get this into the regression test folder - local
+ # subdirectories may override this if they have more specific locations
+ # they want to use.
+ if (${testname}_STAND_ALONE)
+ set_target_properties(${testname} PROPERTIES FOLDER "BRL-CAD Regression
Tests")
+ else (${testname}_STAND_ALONE)
+ set_target_properties(${testname} PROPERTIES FOLDER "BRL-CAD Regression
Tests/regress")
+ endif (${testname}_STAND_ALONE)
+
+ # In Visual Studio, none of the regress build targets are added to the
default build.
+ set_target_properties(${testname} PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD 1)
+
+ # Group any test not excluded by the STAND_ALONE flag with the other
regression tests by
+ # assigning a standard label
+ if (NOT ${testname}_STAND_ALONE)
+ set_tests_properties(${testname} PROPERTIES LABELS "Regression")
+ else (NOT ${testname}_STAND_ALONE)
+ set_tests_properties(${testname} PROPERTIES LABELS "STAND_ALONE")
+ endif (NOT ${testname}_STAND_ALONE)
+
+ # Set up dependencies for both regress and check
+ if (NOT "${depends_list}" STREQUAL "")
+ add_dependencies(regress ${depends_list})
+ add_dependencies(check ${depends_list})
+ endif (NOT "${depends_list}" STREQUAL "")
+
+ # Set either the standard timeout or a specified custom timeout
+ if (${testname}_TIMEOUT)
+ set_tests_properties(${testname} PROPERTIES TIMEOUT ${${testname}_TIMEOUT})
+ else (${testname}_TIMEOUT)
+ set_tests_properties(${testname} PROPERTIES TIMEOUT 300) # FIXME: want <60
+ endif (${testname}_TIMEOUT)
+
+endfunction(BRLCAD_REGRESSION_TEST)
+
# Local Variables:
# tab-width: 8
# mode: cmake
Index: brlcad/trunk/regress
===================================================================
--- brlcad/trunk/regress 2020-05-31 14:04:45 UTC (rev 75986)
+++ brlcad/trunk/regress 2020-05-31 14:20:30 UTC (rev 75987)
Property changes on: brlcad/trunk/regress
___________________________________________________________________
Modified: svn:mergeinfo
## -1,5 +1,5 ##
/brlcad/branches/RELEASE/regress:57439,57447-57860,69901-69913,71917-72242,72525-72534,72826-72858,74376-74454
-/brlcad/branches/bioh/regress:75860-75891
+/brlcad/branches/bioh/regress:75860-75891,75894-75986
/brlcad/branches/brep-debug/regress:61373,61375,61404,61427,61429,61470,61544,61567,61576,61999,62018,62094,62098,62107,62117,62406,62416-62519,62521-62584,62593-62614,62623,62658,62660-62674,62681-62771,62876,62901,62907,62910,62925,62928,62931-63025,63027,63051,63054-63056,63069,63071-63073,63122,63160-63161,63165,63171,63184,63187,63189-63190,63193-63196,63200,63202,63205-63210,63213,63219-63225,63232-63233,63236,63238,63338,63350-63353,63481,63618,63669,64173-64174,64176-64177,64229-64233,64242,64244,64360-64362,65165,65245,65249,65334,65833-65834,66370-66375,66931-66932,66934,67012-67015,67018-67019,67021-67022,67406,67740,67746-67748,67950,67952,68144-68145,68636,68640-68643,68820,69081,69109,69206,69289,69346,69460-69461,69582-69583,69719-69721,69857-69859,69927
/brlcad/branches/bullet/regress:62518
/brlcad/branches/cmake/regress:43219
Modified: brlcad/trunk/regress/CMakeLists.txt
===================================================================
--- brlcad/trunk/regress/CMakeLists.txt 2020-05-31 14:04:45 UTC (rev 75986)
+++ brlcad/trunk/regress/CMakeLists.txt 2020-05-31 14:20:30 UTC (rev 75987)
@@ -1,40 +1,3 @@
-function(Add_Regression_Test testname depends_list)
-
- cmake_parse_arguments(${testname} "EXCLUDE_FROM_REGRESS" "" "" ${ARGN})
-
- set_target_properties(regress-${testname} PROPERTIES
EXCLUDE_FROM_DEFAULT_BUILD 1)
-
- if (NOT ${testname}_EXCLUDE_FROM_REGRESS)
-
- # Make sure we at least get this into the regression test folder - local
- # subdirectories may override this if they have more specific locations
- # they want to use.
- set_target_properties(regress-${testname} PROPERTIES FOLDER "BRL-CAD
Regression Tests/regress")
-
- set_tests_properties(regress-${testname} PROPERTIES LABELS "Regression")
-
- else (NOT ${testname}_EXCLUDE_FROM_REGRESS)
-
- set_target_properties(regress-${testname} PROPERTIES FOLDER "BRL-CAD
Regression Tests")
-
- set_tests_properties(regress-${testname} PROPERTIES LABELS "NOT_WORKING")
-
- endif (NOT ${testname}_EXCLUDE_FROM_REGRESS)
-
- # Set up dependencies for both regress and check
- if (NOT "${depends_list}" STREQUAL "")
- add_dependencies(regress ${depends_list})
- if (TARGET check)
- add_dependencies(check ${depends_list})
- endif (TARGET check)
- endif (NOT "${depends_list}" STREQUAL "")
-
- if (NOT BRLCAD_DISABLE_REGRESS_TIMEOUT)
- set_tests_properties(regress-${testname} PROPERTIES TIMEOUT 300) # FIXME:
want <60
- endif (NOT BRLCAD_DISABLE_REGRESS_TIMEOUT)
-
-endfunction(Add_Regression_Test)
-
# Define the toplevel regression target - unless specifically excluded
# via a macro argument, this should collect all regression targets.
include(ProcessorCount)
@@ -44,7 +7,11 @@
else()
set(JFLAG)
endif()
-add_custom_target(regress COMMAND ${CMAKE_CTEST_COMMAND} -L Regression
--output-on-failure --output-log "${CMAKE_BINARY_DIR}/regress_output.log"
${JFLAG})
+if (CMAKE_CONFIGURATION_TYPES)
+ add_custom_target(regress COMMAND ${CMAKE_CTEST_COMMAND} -C
${CMAKE_CFG_INTDIR} -L Regression --output-on-failure --output-log
"${CMAKE_BINARY_DIR}/regress_output.log" ${JFLAG})
+else (CMAKE_CONFIGURATION_TYPES)
+ add_custom_target(regress COMMAND ${CMAKE_CTEST_COMMAND} -L Regression
--output-on-failure --output-log "${CMAKE_BINARY_DIR}/regress_output.log"
${JFLAG})
+endif (CMAKE_CONFIGURATION_TYPES)
set_target_properties(regress PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD 1)
set_target_properties(regress PROPERTIES FOLDER "BRL-CAD Regression Tests")
@@ -89,47 +56,62 @@
add_subdirectory(repository)
if(SH_EXEC)
- macro(Sh_Regression_Test testname depends_list)
- CMAKE_PARSE_ARGUMENTS(${testname} "EXCLUDE_FROM_REGRESS" "" "" ${ARGN})
- add_test(NAME regress-${testname} COMMAND ${SH_EXEC}
"${CMAKE_SOURCE_DIR}/regress/${testname}.sh" ${CMAKE_SOURCE_DIR})
- add_custom_target(regress-${testname} COMMAND ${CMAKE_CTEST_COMMAND} -R
^regress-${testname} --output-on-failure)
- set_target_properties(regress-${testname} PROPERTIES FOLDER "BRL-CAD
Regression Tests")
- if(NOT ${testname}_EXCLUDE_FROM_REGRESS)
- set_tests_properties(regress-${testname} PROPERTIES LABELS "Regression")
- else(NOT ${testname}_EXCLUDE_FROM_REGRESS)
- set_tests_properties(regress-${testname} PROPERTIES LABELS "NOT_WORKING")
- endif(NOT ${testname}_EXCLUDE_FROM_REGRESS)
- if(NOT "${depends_list}" STREQUAL "")
- add_dependencies(regress-${testname} ${depends_list})
- add_dependencies(regress ${depends_list})
- if(TARGET check)
- add_dependencies(check ${depends_list})
- endif(TARGET check)
- endif(NOT "${depends_list}" STREQUAL "")
- if(NOT BRLCAD_DISABLE_REGRESS_TIMEOUT)
- set_tests_properties(regress-${testname} PROPERTIES TIMEOUT 300) #
FIXME: want <60
- endif(NOT BRLCAD_DISABLE_REGRESS_TIMEOUT)
- endmacro(Sh_Regression_Test)
- Sh_Regression_Test(moss "rt;asc2g;pixdiff;pix-png;png-pix")
- Sh_Regression_Test(lights "rt;asc2g;pixdiff")
- Sh_Regression_Test(solids "rt;mged;pixdiff;asc2pix;gencolor")
- Sh_Regression_Test(shaders "rt;mged;pixdiff;gencolor")
- Sh_Regression_Test(spdi "rt;mged;pixdiff")
- Sh_Regression_Test(rtedge "rt;rtedge;pixdiff;asc2g")
- Sh_Regression_Test(iges "iges-g;g-iges;mged;asc2g")
- Sh_Regression_Test(weight "rtweight;mged")
- Sh_Regression_Test(gqa "gqa;mged")
- Sh_Regression_Test(bots "mged;pixdiff;rt")
- Sh_Regression_Test(usage "rt" EXCLUDE_FROM_REGRESS)
- Sh_Regression_Test(flawfinder "" EXCLUDE_FROM_REGRESS)
- Sh_Regression_Test(mged mged)
- Sh_Regression_Test(red mged)
- Sh_Regression_Test(nirt "mged;nirt")
- Sh_Regression_Test(comgeom "mged;asc2g;vdeck;comgeom-g")
- Sh_Regression_Test(dsp "mged;cv;asc2pix;rt;pix-bw")
- Sh_Regression_Test(asc2dsp "cv;asc2pix;pix-bw;asc2dsp")
+ add_test(NAME regress-moss COMMAND ${SH_EXEC}
"${CMAKE_SOURCE_DIR}/regress/moss.sh" ${CMAKE_SOURCE_DIR})
+ BRLCAD_REGRESSION_TEST(regress-moss "rt;asc2g;pixdiff;pix-png;png-pix"
TEST_DEFINED)
+ add_test(NAME regress-lights COMMAND ${SH_EXEC}
"${CMAKE_SOURCE_DIR}/regress/lights.sh" ${CMAKE_SOURCE_DIR})
+ BRLCAD_REGRESSION_TEST(regress-lights "rt;asc2g;pixdiff" TEST_DEFINED)
+
+ add_test(NAME regress-solids COMMAND ${SH_EXEC}
"${CMAKE_SOURCE_DIR}/regress/solids.sh" ${CMAKE_SOURCE_DIR})
+ BRLCAD_REGRESSION_TEST(regress-solids "rt;mged;pixdiff;asc2pix;gencolor"
TEST_DEFINED)
+
+ add_test(NAME regress-shaders COMMAND ${SH_EXEC}
"${CMAKE_SOURCE_DIR}/regress/shaders.sh" ${CMAKE_SOURCE_DIR})
+ BRLCAD_REGRESSION_TEST(regress-shaders "rt;mged;pixdiff;gencolor"
TEST_DEFINED)
+
+ add_test(NAME regress-spdi COMMAND ${SH_EXEC}
"${CMAKE_SOURCE_DIR}/regress/spdi.sh" ${CMAKE_SOURCE_DIR})
+ BRLCAD_REGRESSION_TEST(regress-spdi "rt;mged;pixdiff" TEST_DEFINED)
+
+ add_test(NAME regress-rtedge COMMAND ${SH_EXEC}
"${CMAKE_SOURCE_DIR}/regress/rtedge.sh" ${CMAKE_SOURCE_DIR})
+ BRLCAD_REGRESSION_TEST(regress-rtedge "rt;rtedge;pixdiff;asc2g" TEST_DEFINED)
+
+ add_test(NAME regress-iges COMMAND ${SH_EXEC}
"${CMAKE_SOURCE_DIR}/regress/iges.sh" ${CMAKE_SOURCE_DIR})
+ BRLCAD_REGRESSION_TEST(regress-iges "iges-g;g-iges;mged;asc2g" TEST_DEFINED)
+
+ add_test(NAME regress-weight COMMAND ${SH_EXEC}
"${CMAKE_SOURCE_DIR}/regress/weight.sh" ${CMAKE_SOURCE_DIR})
+ BRLCAD_REGRESSION_TEST(regress-weight "rtweight;mged" TEST_DEFINED)
+
+ add_test(NAME regress-gqa COMMAND ${SH_EXEC}
"${CMAKE_SOURCE_DIR}/regress/gqa.sh" ${CMAKE_SOURCE_DIR})
+ BRLCAD_REGRESSION_TEST(regress-gqa "gqa;mged" TEST_DEFINED)
+
+ add_test(NAME regress-bots COMMAND ${SH_EXEC}
"${CMAKE_SOURCE_DIR}/regress/bots.sh" ${CMAKE_SOURCE_DIR})
+ BRLCAD_REGRESSION_TEST(regress-bots "mged;pixdiff;rt" TEST_DEFINED)
+
+ add_test(NAME regress-mged COMMAND ${SH_EXEC}
"${CMAKE_SOURCE_DIR}/regress/mged.sh" ${CMAKE_SOURCE_DIR})
+ BRLCAD_REGRESSION_TEST(regress-mged mged TEST_DEFINED)
+
+ add_test(NAME regress-red COMMAND ${SH_EXEC}
"${CMAKE_SOURCE_DIR}/regress/red.sh" ${CMAKE_SOURCE_DIR})
+ BRLCAD_REGRESSION_TEST(regress-red mged TEST_DEFINED)
+
+ add_test(NAME regress-nirt COMMAND ${SH_EXEC}
"${CMAKE_SOURCE_DIR}/regress/nirt.sh" ${CMAKE_SOURCE_DIR})
+ BRLCAD_REGRESSION_TEST(regress-nirt "mged;nirt" TEST_DEFINED)
+
+ add_test(NAME regress-comgeom COMMAND ${SH_EXEC}
"${CMAKE_SOURCE_DIR}/regress/comgeom.sh" ${CMAKE_SOURCE_DIR})
+ BRLCAD_REGRESSION_TEST(regress-comgeom "mged;asc2g;vdeck;comgeom-g"
TEST_DEFINED)
+
+ add_test(NAME regress-dsp COMMAND ${SH_EXEC}
"${CMAKE_SOURCE_DIR}/regress/dsp.sh" ${CMAKE_SOURCE_DIR})
+ BRLCAD_REGRESSION_TEST(regress-dsp "mged;cv;asc2pix;rt;pix-bw" TEST_DEFINED)
+
+ add_test(NAME regress-asc2dsp COMMAND ${SH_EXEC}
"${CMAKE_SOURCE_DIR}/regress/asc2dsp.sh" ${CMAKE_SOURCE_DIR})
+ BRLCAD_REGRESSION_TEST(regress-asc2dsp "cv;asc2pix;pix-bw;asc2dsp"
TEST_DEFINED)
+
+ add_test(NAME regress-usage COMMAND ${SH_EXEC}
"${CMAKE_SOURCE_DIR}/regress/usage.sh" ${CMAKE_SOURCE_DIR})
+ BRLCAD_REGRESSION_TEST(regress-usage "rt" STAND_ALONE TEST_DEFINED)
+
+ # TODO - test for Python before adding this one
+ add_test(NAME regress-flawfinder COMMAND ${SH_EXEC}
"${CMAKE_SOURCE_DIR}/regress/flawfinder.sh" ${CMAKE_SOURCE_DIR})
+ BRLCAD_REGRESSION_TEST(regress-flawfinder "" STAND_ALONE TEST_DEFINED)
+
endif(SH_EXEC)
CMAKEFILES(
Modified: brlcad/trunk/regress/burst/CMakeLists.txt
===================================================================
--- brlcad/trunk/regress/burst/CMakeLists.txt 2020-05-31 14:04:45 UTC (rev
75986)
+++ brlcad/trunk/regress/burst/CMakeLists.txt 2020-05-31 14:20:30 UTC (rev
75987)
@@ -1,9 +1,3 @@
-if(CMAKE_CONFIGURATION_TYPES)
- set(cfg_testname "-${CMAKE_CFG_INTDIR}")
-else(CMAKE_CONFIGURATION_TYPES)
- set(cfg_testname "")
-endif(CMAKE_CONFIGURATION_TYPES)
-
set(BURST_INPUT_FILES
ktank.b
ktank_air.ids
@@ -11,6 +5,8 @@
ktank_crit.ids
)
+BRLCAD_REGRESSION_TEST(regress-burst "burst;ktank.g" EXEC burst)
+
set(BURST_CLEAN_FILES
ktank_burst.plot
ktank_burst.pix
@@ -19,33 +15,12 @@
ktank_burst.shotlines
burst_ktank.log
)
-
-set(LOG_FILE
"${CMAKE_CURRENT_BINARY_DIR}/regress${cfg_testname}-burst-ktank.log")
-set(STAMP_FILE "${CMAKE_CURRENT_BINARY_DIR}/burst-ktank${cfg_testname}.done")
-configure_file("${CMAKE_CURRENT_SOURCE_DIR}/regress-burst-ktank.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/regress-burst-ktank.cmake" @ONLY)
-add_custom_command(
- OUTPUT "${STAMP_FILE}"
- COMMAND "${CMAKE_COMMAND}" -P
"${CMAKE_CURRENT_BINARY_DIR}/regress-burst-ktank.cmake"
- DEPENDS ${depends_list}
- )
-add_test(NAME regress-burst-ktank COMMAND "${CMAKE_COMMAND}" -P
"${CMAKE_CURRENT_BINARY_DIR}/regress-burst-ktank.cmake")
-add_custom_target(regress-burst-ktank DEPENDS ktank.g burst "${STAMP_FILE}")
-set_target_properties(regress-burst-ktank PROPERTIES FOLDER "BRL-CAD
Regression Tests")
-Add_Regression_Test(burst-ktank "ktank.g;burst")
-
-CMAKEFILES(
- CMakeLists.txt
- ${BURST_INPUT_FILES}
- )
-
-DISTCLEAN(
- ${STAMP_FILE}
- ${LOG_FILE}
- ${TARGET_IMAGE}
- )
foreach(BCF ${BURST_CLEAN_FILES})
DISTCLEAN("${CMAKE_CURRENT_BINARY_DIR}/${BCF}")
endforeach(BCF ${BURST_CLEAN_FILES})
+DISTCLEAN("${CMAKE_CURRENT_BINARY_DIR}/regress-burst.log")
+
+# If we copied the input files, clear them out as well
if(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
foreach(BIF ${BURST_INPUT_FILES})
DISTCLEAN("${CMAKE_CURRENT_BINARY_DIR}/${BCF}")
@@ -52,6 +27,11 @@
endforeach(BIF ${BURST_INPUT_FILES})
endif(NOT "${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
+CMAKEFILES(
+ CMakeLists.txt
+ ${BURST_INPUT_FILES}
+ )
+
# Local Variables:
# tab-width: 8
# mode: cmake
Deleted: brlcad/trunk/regress/burst/regress-burst-ktank.cmake.in
===================================================================
--- brlcad/trunk/regress/burst/regress-burst-ktank.cmake.in 2020-05-31
14:04:45 UTC (rev 75986)
+++ brlcad/trunk/regress/burst/regress-burst-ktank.cmake.in 2020-05-31
14:20:30 UTC (rev 75987)
@@ -1,66 +0,0 @@
-set(CBDIR "@CMAKE_CURRENT_BINARY_DIR@")
-set(CSDIR "@CMAKE_CURRENT_SOURCE_DIR@")
-set(DDIR "@DATA_DIR@")
-set(BURST_CF "@BURST_CLEAN_FILES@")
-set(BURST_IF "@BURST_INPUT_FILES@")
-
-set(SBDIR "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@")
-set(DBDIR "@CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG@")
-set(RBDIR "@CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE@")
-# Use the mechanism created to allow multiconfig builds to
-# know what the current build type is.
-if(EXISTS "@CMAKE_BINARY_DIR@/CMakeTmp/CURRENT_PATH/Release")
- set(BDIR "${RBDIR}")
- set(test_suffix "-Release")
-elseif(EXISTS "@CMAKE_BINARY_DIR@/CMakeTmp/CURRENT_PATH/Debug")
- set(BDIR "${DBDIR}")
- set(test_suffix "-Debug")
-else(EXISTS "@CMAKE_BINARY_DIR@/CMakeTmp/CURRENT_PATH/Release")
- set(BDIR "${SBDIR}")
- set(test_suffix)
-endif(EXISTS "@CMAKE_BINARY_DIR@/CMakeTmp/CURRENT_PATH/Release")
-
-get_filename_component(EXE "@CMAKE_COMMAND@" EXT)
-set(BURST "${BDIR}/burst${EXE}")
-
-# Clean up in case we've run before
-foreach(BCF ${BURST_CF})
- execute_process(COMMAND "@CMAKE_COMMAND@" -E remove "${CBDIR}/${BCF}")
-endforeach(BCF ${BURST_CF})
-
-# Stage the input files
-if (NOT "${CSDIR}" STREQUAL "${CBDIR}")
- foreach(BIF ${BURST_IF})
- execute_process(COMMAND "@CMAKE_COMMAND@" -E copy "${CSDIR}/${BIF}"
"${CBDIR}/${BIF}")
- endforeach(BIF ${BURST_IF})
-endif (NOT "${CSDIR}" STREQUAL "${CBDIR}")
-
-execute_process(COMMAND "@CMAKE_COMMAND@" -E copy
"${BDIR}/../${DDIR}/db/ktank.g" "${CBDIR}/ktank.g")
-
-file(WRITE "${CBDIR}/burst_ktank.log" "Running burst on ktank.g:\n${BURST} -b
${CBDIR}/ktank.b\n")
-
-execute_process(
- COMMAND "${BURST}" -b "${CBDIR}/ktank.b" RESULT_VARIABLE burst_result
- OUTPUT_VARIABLE burst_log ERROR_VARIABLE burst_log
- WORKING_DIRECTORY ${CBDIR}
- )
-file(APPEND "${CBDIR}/burst_ktank.log" "${burst_log}")
-set(burst_log)
-if(NOT EXISTS "${CBDIR}/ktank.burst")
- message(FATAL_ERROR "${BURST} failed to process ktank.b, aborting.\nSee
${CBDIR}/burst_ktank.log for more details.")
-endif(NOT EXISTS "${CBDIR}/ktank.burst")
-
-if(burst_result)
- file(APPEND "${CBDIR}/burst_ktank.log" "\n\nError: return code
${burst_result}")
- message(FATAL_ERROR "[burst] Failure, see ${CBDIR}/burst_ktank.log for more
info.\n")
-else(burst_result)
- execute_process(COMMAND "@CMAKE_COMMAND@" -E touch
"@CMAKE_CURRENT_BINARY_DIR@/burst-ktank${test_suffix}.done")
-endif(burst_result)
-
-# Local Variables:
-# tab-width: 8
-# mode: cmake
-# indent-tabs-mode: t
-# End:
-# ex: shiftwidth=2 tabstop=8
-
Copied: brlcad/trunk/regress/burst/regress-burst.cmake.in (from rev 75986,
brlcad/branches/bioh/regress/burst/regress-burst.cmake.in)
===================================================================
--- brlcad/trunk/regress/burst/regress-burst.cmake.in
(rev 0)
+++ brlcad/trunk/regress/burst/regress-burst.cmake.in 2020-05-31 14:20:30 UTC
(rev 75987)
@@ -0,0 +1,63 @@
+set(CBDIR "@CMAKE_CURRENT_BINARY_DIR@")
+set(CSDIR "@CMAKE_CURRENT_SOURCE_DIR@")
+set(BURST_CF "@BURST_CLEAN_FILES@")
+set(BURST_IF "@BURST_INPUT_FILES@")
+set(DDIR "@DATA_DIR@")
+set(LOGFILE "${CBDIR}/regress-burst.log")
+
+file(WRITE "${LOGFILE}" "Starting burst run\n")
+
+# The executable locations aren't know at CMake configure time, so one of them
+# is passed in via the EXEC variable at runtime. De-quote it and assign it to
+# the appropriate variable.
+string(REPLACE "\\" "" BURST "${EXEC}")
+if (NOT EXISTS "${BURST}")
+ file(APPEND "${LOGFILE}" "burst not found at location \"${BURST}\" -
aborting\n")
+ message(FATAL_ERROR "Unable to find burst, aborting.\nSee ${LOGFILE} for
more details.")
+endif (NOT EXISTS "${BURST}")
+
+# Clean up in case we've run before
+foreach(BCF ${BURST_CF})
+ execute_process(COMMAND "@CMAKE_COMMAND@" -E remove -f "${CBDIR}/${BCF}")
+endforeach(BCF ${BURST_CF})
+
+# Stage the input files, if we're not in the source directory
+if (NOT "${CSDIR}" STREQUAL "${CBDIR}")
+ foreach(BIF ${BURST_IF})
+ execute_process(COMMAND "@CMAKE_COMMAND@" -E copy "${CSDIR}/${BIF}"
"${CBDIR}/${BIF}")
+ endforeach(BIF ${BURST_IF})
+endif (NOT "${CSDIR}" STREQUAL "${CBDIR}")
+
+# TODO - this breaks if BIN_DIR is not one deep
+get_filename_component(BDIR "${BURST}" DIRECTORY)
+execute_process(COMMAND "@CMAKE_COMMAND@" -E copy
"${BDIR}/../${DDIR}/db/ktank.g" "${CBDIR}/ktank.g")
+
+file(APPEND "${LOGFILE}" "Running burst on ktank.g:\n${BURST} -b
${CBDIR}/ktank.b\n")
+
+execute_process(
+ COMMAND "${BURST}" -b "${CBDIR}/ktank.b"
+ RESULT_VARIABLE burst_result OUTPUT_VARIABLE burst_log ERROR_VARIABLE
burst_log
+ WORKING_DIRECTORY ${CBDIR}
+ )
+file(APPEND "${LOGFILE}" "${burst_log}")
+set(burst_log)
+if(NOT EXISTS "${CBDIR}/ktank.burst" OR burst_result)
+ file(APPEND "${LOGFILE}" "Failure: ${burst_result}\n")
+ message(FATAL_ERROR "${BURST} failed to process ktank.b, aborting.\nSee
${LOGFILE} for more details.")
+endif(NOT EXISTS "${CBDIR}/ktank.burst" OR burst_result)
+
+# If we copied the input files, clear them out as well
+if(NOT "${CSDIR}" STREQUAL "${CBDIR}")
+ foreach(BIF ${BURST_INPUT_FILES})
+ execute_process(COMMAND "@CMAKE_COMMAND@" -E remove -f "${CBDIR}/${BCF}")
+ endforeach(BIF ${BURST_INPUT_FILES})
+endif(NOT "${CSDIR}" STREQUAL "${CBDIR}")
+
+
+# Local Variables:
+# tab-width: 8
+# mode: cmake
+# indent-tabs-mode: t
+# End:
+# ex: shiftwidth=2 tabstop=8
+
Modified: brlcad/trunk/regress/gchecker/CMakeLists.txt
===================================================================
--- brlcad/trunk/regress/gchecker/CMakeLists.txt 2020-05-31 14:04:45 UTC
(rev 75986)
+++ brlcad/trunk/regress/gchecker/CMakeLists.txt 2020-05-31 14:20:30 UTC
(rev 75987)
@@ -1,26 +1,10 @@
-if(CMAKE_CONFIGURATION_TYPES)
- set(cfg_testname "-${CMAKE_CFG_INTDIR}")
-else(CMAKE_CONFIGURATION_TYPES)
- set(cfg_testname "")
-endif(CMAKE_CONFIGURATION_TYPES)
+set(LOG_FILE "${CMAKE_CURRENT_BINARY_DIR}/regress-gchecker.log")
+set(GCHECKER_CLEAN_FILE
${CMAKE_CURRENT_BINARY_DIR}/gchecker_test.g.ck/ck.gchecker_test.g.overlaps)
-set(GCHECKER_CLEAN_FILES
- gchecker_test.g.ck/ck.gchecker_test.g.overlaps
- gchecker.log
- )
+BRLCAD_REGRESSION_TEST(regress-gchecker "gchecker;mged;gqa;rtcheck" EXEC
gchecker)
-set(LOG_FILE "${CMAKE_CURRENT_BINARY_DIR}/regress${cfg_testname}-gchecker.log")
-set(STAMP_FILE "${CMAKE_CURRENT_BINARY_DIR}/gchecker${cfg_testname}.done")
-configure_file("${CMAKE_CURRENT_SOURCE_DIR}/regress-gchecker.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/regress-gchecker.cmake" @ONLY)
-add_custom_command(
- OUTPUT "${STAMP_FILE}"
- COMMAND "${CMAKE_COMMAND}" -P
"${CMAKE_CURRENT_BINARY_DIR}/regress-gchecker.cmake"
- DEPENDS ${depends_list}
- )
-add_test(NAME regress-gchecker COMMAND "${CMAKE_COMMAND}" -P
"${CMAKE_CURRENT_BINARY_DIR}/regress-gchecker.cmake")
-add_custom_target(regress-gchecker DEPENDS gchecker mged gqa rtcheck
"${STAMP_FILE}")
-set_target_properties(regress-gchecker PROPERTIES FOLDER "BRL-CAD Regression
Tests")
-Add_Regression_Test(gchecker "gchecker;mged;gqa;rtcheck")
+DISTCLEAN(${LOG_FILE})
+DISTCLEAN(${GCHECKER_CLEAN_FILE})
CMAKEFILES(
CMakeLists.txt
@@ -27,15 +11,6 @@
gchecker_test.g
)
-DISTCLEAN(
- ${STAMP_FILE}
- ${LOG_FILE}
- ${TARGET_IMAGE}
- )
-foreach(GCF ${GCHECKER_CLEAN_FILES})
- DISTCLEAN("${CMAKE_CURRENT_BINARY_DIR}/${GCF}")
-endforeach(GCF ${GCHECKER_CLEAN_FILES})
-
# Local Variables:
# tab-width: 8
# mode: cmake
Modified: brlcad/trunk/regress/gchecker/regress-gchecker.cmake.in
===================================================================
--- brlcad/trunk/regress/gchecker/regress-gchecker.cmake.in 2020-05-31
14:04:45 UTC (rev 75986)
+++ brlcad/trunk/regress/gchecker/regress-gchecker.cmake.in 2020-05-31
14:20:30 UTC (rev 75987)
@@ -1,51 +1,41 @@
+# Values set at CMake configure time
set(CBDIR "@CMAKE_CURRENT_BINARY_DIR@")
set(CSDIR "@CMAKE_CURRENT_SOURCE_DIR@")
-set(DDIR "@DATA_DIR@")
-set(GCHECKER_CF "@GCHECKER_CLEAN_FILES@")
+set(GCHECKER_CF "@GCHECKER_CLEAN_FILE@")
+set(LOGFILE "@LOG_FILE@")
-set(SBDIR "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@")
-set(DBDIR "@CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG@")
-set(RBDIR "@CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE@")
-# Use the mechanism created to allow multiconfig builds to
-# know what the current build type is.
-if(EXISTS "@CMAKE_BINARY_DIR@/CMakeTmp/CURRENT_PATH/Release")
- set(BDIR "${RBDIR}")
- set(test_suffix "-Release")
-elseif(EXISTS "@CMAKE_BINARY_DIR@/CMakeTmp/CURRENT_PATH/Debug")
- set(BDIR "${DBDIR}")
- set(test_suffix "-Debug")
-else(EXISTS "@CMAKE_BINARY_DIR@/CMakeTmp/CURRENT_PATH/Release")
- set(BDIR "${SBDIR}")
- set(test_suffix)
-endif(EXISTS "@CMAKE_BINARY_DIR@/CMakeTmp/CURRENT_PATH/Release")
+file(WRITE "${LOGFILE}" "Starting gchecker test run\n")
-get_filename_component(EXE "@CMAKE_COMMAND@" EXT)
-set(GCHECKER "${BDIR}/gchecker${EXE}")
+# The executable locations aren't know at CMake configure time, so one of them
+# is passed in via the EXEC variable at runtime. De-quote it and assign it to
+# the appropriate variable.
+string(REPLACE "\\" "" GCHECKER "${EXEC}")
+if (NOT EXISTS "${GCHECKER}")
+ file(WRITE "${LOGFILE}" "regress_gchecker not found at location
\"${GCHECKER}\" - aborting\n")
+ message(FATAL_ERROR "Unable to find regress_gchecker, aborting.\nSee
${LOGFILE} for more details.")
+endif (NOT EXISTS "${GCHECKER}")
# Clean up in case we've run before
-foreach(GCF ${GCHECKER_CF})
- execute_process(COMMAND "@CMAKE_COMMAND@" -E remove -f "${CBDIR}/${GCF}")
-endforeach(GCF ${GCHECKER_CF})
+execute_process(COMMAND "@CMAKE_COMMAND@" -E remove -f "${GCHECKER_CF}")
execute_process(COMMAND "@CMAKE_COMMAND@" -E remove_directory
"${CBDIR}/gchecker_test.g.ck")
-file(WRITE "${CBDIR}/gchecker.log" "Running gchecker:\n${GCHECKER}
${CSDIR}/gchecker_test.g\n")
+file(APPEND "${LOGFILE}" "Running gchecker:\n${GCHECKER}
${CSDIR}/gchecker_test.g\n")
execute_process(
- COMMAND "${GCHECKER}" "${CSDIR}/gchecker_test.g" RESULT_VARIABLE
gchecker_result
- OUTPUT_VARIABLE gchecker_log ERROR_VARIABLE gchecker_log
+ COMMAND "${GCHECKER}" "${CSDIR}/gchecker_test.g"
+ RESULT_VARIABLE gchecker_result OUTPUT_VARIABLE gchecker_log ERROR_VARIABLE
gchecker_log
WORKING_DIRECTORY ${CBDIR}
)
-file(APPEND "${CBDIR}/gchecker.log" "${gchecker_log}")
+file(APPEND "${LOGFILE}" "${gchecker_log}")
set(gchecker_log)
if(NOT EXISTS "${CBDIR}/gchecker_test.g.ck/ck.gchecker_test.g.overlaps")
+ file(APPEND "${LOGFILE}" "\n\nError: return code ${gchecker_result}")
message(FATAL_ERROR "${GCHECKER} failed to process gchecker_test.g,
aborting.\nSee ${CBDIR}/gchecker.log for more details.")
endif(NOT EXISTS "${CBDIR}/gchecker_test.g.ck/ck.gchecker_test.g.overlaps")
if(gchecker_result)
- file(APPEND "${CBDIR}/gchecker.log" "\n\nError: return code
${gchecker_result}")
+ file(APPEND "${LOGFILE}" "\n\nError: return code ${gchecker_result}")
message(FATAL_ERROR "[gchecker] Failure, see ${CBDIR}/gchecker.log for more
info.\n")
-else(gchecker_result)
- execute_process(COMMAND "@CMAKE_COMMAND@" -E touch
"@CMAKE_CURRENT_BINARY_DIR@/gchecker${test_suffix}.done")
endif(gchecker_result)
# Local Variables:
Modified: brlcad/trunk/regress/gcv/CMakeLists.txt
===================================================================
--- brlcad/trunk/regress/gcv/CMakeLists.txt 2020-05-31 14:04:45 UTC (rev
75986)
+++ brlcad/trunk/regress/gcv/CMakeLists.txt 2020-05-31 14:20:30 UTC (rev
75987)
@@ -1,63 +1,11 @@
-# Tests for the various geometry format conversions supported
-# by BRL-CAD
-
-if(CMAKE_CONFIGURATION_TYPES)
- set(cfg_testname "-${CMAKE_CFG_INTDIR}")
-else(CMAKE_CONFIGURATION_TYPES)
- set(cfg_testname "")
-endif(CMAKE_CONFIGURATION_TYPES)
-
-macro(ADD_GCV_Test testname depends_list)
- set(LOG_FILE
"${CMAKE_CURRENT_BINARY_DIR}/regress${cfg_testname}-${testname}.log")
- set(STAMP_FILE "${CMAKE_CURRENT_BINARY_DIR}/${testname}${cfg_testname}.done")
- configure_file("${CMAKE_CURRENT_SOURCE_DIR}/regress-${testname}.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/regress-${testname}.cmake" @ONLY)
- add_custom_command(
- OUTPUT "${STAMP_FILE}"
- COMMAND "${CMAKE_COMMAND}" -P
"${CMAKE_CURRENT_BINARY_DIR}/regress-${testname}.cmake"
- DEPENDS ${depends_list}
- )
- add_test(NAME regress-gcv-${testname} COMMAND "${CMAKE_COMMAND}" -P
"${CMAKE_CURRENT_BINARY_DIR}/regress-${testname}.cmake")
- add_custom_target(regress-gcv-${testname} DEPENDS ${depends_list}
${STAMP_FILE})
- set_target_properties(regress-gcv-${testname} PROPERTIES FOLDER "BRL-CAD
Regression Tests")
- Add_Regression_Test(gcv-${testname} "${depends_list}")
-
- add_dependencies(regress-gcv regress-gcv-${testname})
-
- DISTCLEAN(
- ${STAMP_FILE}
- ${LOG_FILE}
- ${TARGET_IMAGE}
- )
-endmacro()
-
-add_custom_target(regress-gcv)
-set_target_properties(regress-gcv PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD 1)
-set_target_properties(regress-gcv PROPERTIES FOLDER "BRL-CAD Regression Tests")
-
-Add_GCV_Test(fastgen "fast4-g;gdiff")
-
-# The dem test is a bit more one-off for now...
add_subdirectory(dem)
+add_subdirectory(fastgen)
CMAKEFILES(
CMakeLists.txt
README
- dem/CMakeLists.txt
- dem/README
- dem/hawaii-c.tar.bz2
- dem/regress-dem.cmake.in
- fastgen_box.fast4
- fastgen_dos.fast4
- regress-fastgen.cmake.in
)
-DISTCLEAN(
- "${CMAKE_CURRENT_BINARY_DIR}/fastgen.done"
- "${CMAKE_CURRENT_BINARY_DIR}/fastgen.log"
- "${CMAKE_CURRENT_BINARY_DIR}/fastgen_unix.g"
- "${CMAKE_CURRENT_BINARY_DIR}/fastgen_dos.g"
- )
-
# Local Variables:
# tab-width: 8
# mode: cmake
Modified: brlcad/trunk/regress/gcv/dem/CMakeLists.txt
===================================================================
--- brlcad/trunk/regress/gcv/dem/CMakeLists.txt 2020-05-31 14:04:45 UTC (rev
75986)
+++ brlcad/trunk/regress/gcv/dem/CMakeLists.txt 2020-05-31 14:20:30 UTC (rev
75987)
@@ -1,20 +1,6 @@
+BRLCAD_REGRESSION_TEST(regress-dem "gcv;libgcv_gdal" EXEC gcv)
-configure_file("${CMAKE_CURRENT_SOURCE_DIR}/regress-dem.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/regress-dem.cmake" @ONLY)
-add_custom_command(
- OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/dem.done"
- COMMAND "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/regress-dem.cmake"
- DEPENDS gcv "${CMAKE_CURRENT_SOURCE_DIR}/hawaii-c.tar.bz2"
- )
-
-add_test(NAME regress-gcv-dem COMMAND "${CMAKE_COMMAND}" -P
"${CMAKE_CURRENT_BINARY_DIR}/regress-dem.cmake")
-add_custom_target(regress-gcv-dem DEPENDS gcv
"${CMAKE_CURRENT_BINARY_DIR}/dem.done")
-set_target_properties(regress-gcv-dem PROPERTIES FOLDER "BRL-CAD Regression
Tests")
-set_target_properties(regress-gcv-dem PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD 1)
-#Add_Regression_Test(gcv-dem "gcv;libgcv_gdal")
-#add_dependencies(regress-gcv regress-gcv-dem)
-
DISTCLEAN(
- "${CMAKE_CURRENT_BINARY_DIR}/dem.done"
"${CMAKE_CURRENT_BINARY_DIR}/regress-dem.log"
"${CMAKE_CURRENT_BINARY_DIR}/hawaii-c"
"${CMAKE_CURRENT_BINARY_DIR}/hawaii-c.g"
@@ -21,8 +7,10 @@
)
CMAKEFILES(
+ CMakeLists.txt
+ README
hawaii-c.tar.bz2
- README
+ regress-dem.cmake.in
)
# Local Variables:
Modified: brlcad/trunk/regress/gcv/dem/regress-dem.cmake.in
===================================================================
--- brlcad/trunk/regress/gcv/dem/regress-dem.cmake.in 2020-05-31 14:04:45 UTC
(rev 75986)
+++ brlcad/trunk/regress/gcv/dem/regress-dem.cmake.in 2020-05-31 14:20:30 UTC
(rev 75987)
@@ -1,45 +1,78 @@
+# Values set at CMake configure time
set(CBDIR "@CMAKE_CURRENT_BINARY_DIR@")
set(CSDIR "@CMAKE_CURRENT_SOURCE_DIR@")
+set(LOGFILE "${CBDIR}/regress-dem.log")
-set(SBDIR "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@")
-set(DBDIR "@CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG@")
-set(RBDIR "@CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE@")
-# Use the mechanism created to allow multiconfig builds to
-# know what the current build type is.
-if(EXISTS "@CMAKE_BINARY_DIR@/CMakeTmp/CURRENT_PATH/Release")
- set(BDIR "${RBDIR}")
-elseif(EXISTS "@CMAKE_BINARY_DIR@/CMakeTmp/CURRENT_PATH/Debug")
- set(BDIR "${DBDIR}")
-else(EXISTS "@CMAKE_BINARY_DIR@/CMakeTmp/CURRENT_PATH/Release")
- set(BDIR "${SBDIR}")
-endif(EXISTS "@CMAKE_BINARY_DIR@/CMakeTmp/CURRENT_PATH/Release")
+file(WRITE "${LOGFILE}" "Starting DEM conversion run\n")
-get_filename_component(EXE "@CMAKE_COMMAND@" EXT)
-set(DEMG "${BDIR}/gcv${EXE}")
+# The executable locations aren't know at CMake configure time, so one of them
+# is passed in via the EXEC variable at runtime. De-quote it and assign it to
+# the appropriate variable.
+string(REPLACE "\\" "" GCV_EXEC "${EXEC}")
+if (NOT EXISTS "${GCV_EXEC}")
+ file(WRITE "${LOGFILE}" "gcv not found at location \"${GCV_EXEC}\" -
aborting\n")
+ message(FATAL_ERROR "Unable to find gcv, aborting.\nSee ${LOGFILE} for more
details.")
+endif (NOT EXISTS "${GCV_EXEC}")
+# Clean up in case we've run before
+set(OUTPUT_FILES
+ "${CBDIR}/hawaii-c"
+ "${CBDIR}/hawaii-c.g"
+ )
+foreach(of ${OUTPUT_FILES})
+ execute_process(COMMAND "@CMAKE_COMMAND@" -E remove -f "${of}")
+endforeach(of ${OUTPUT_FILES})
+
# Unpack
execute_process(COMMAND "@CMAKE_COMMAND@" -E tar xjf
"${CSDIR}/hawaii-c.tar.bz2" WORKING_DIRECTORY "${CBDIR}")
# Run the converter
-execute_process(COMMAND "${DEMG}" "${CBDIR}/hawaii-c" "${CBDIR}/hawaii-c.g"
OUTPUT_VARIABLE dem_g_log ERROR_VARIABLE dem_g_log)
-file(WRITE "${CBDIR}/regress-dem.log" "${dem_g_log}")
+execute_process(
+ COMMAND "${GCV_EXEC}" "${CBDIR}/hawaii-c" "${CBDIR}/hawaii-c.g"
+ RESULT_VARIABLE dem_g_result OUTPUT_VARIABLE dem_g_log ERROR_VARIABLE
dem_g_log
+ )
+file(APPEND "${CBDIR}/regress-dem.log" "${dem_g_log}")
+set(dem_g_log)
+if(NOT EXISTS "${CBDIR}/hawaii-c.g")
+ file(APPEND "${LOGFILE}" "Failure: ${dem_g_result}")
+ message(FATAL_ERROR "Unable to convert ${CBDIR}/hawaii-c to
${CBDIR}/hawaii-c.g with ${GCV_EXEC}, aborting.\nSee ${LOGFILE} for more
details.")
+endif(NOT EXISTS "${CBDIR}/hawaii-c.g")
-# Known "good" md5sum of output for comparison
-set(EXPECTED_MD5 "0ef24b4e9569d038055dcabad3157776")
+# The MD5 sum is too senstivie - check the file size to make sure
+# we got a reasonable output. This doesn't check the correctness
+# of the data - haven't yet come up with a good answer for that
+set(EXPECTED_SIZE 2965640)
-# get and clean up md5sum from generated output
-execute_process(COMMAND "@CMAKE_COMMAND@" -E md5sum "${CBDIR}/hawaii-c.g"
OUTPUT_VARIABLE genmd5)
-string(REPLACE " ${CBDIR}/hawaii-c.g" "" genmd5 "${genmd5}")
-string(STRIP "${genmd5}" genmd5)
+# get output file size. NOTE: - once we can require a new enough
+# CMake (3.14+) use file(SIZE) for this... in the meantime use
+# the trick from https://stackoverflow.com/a/30010569
+file(READ "${CBDIR}/hawaii-c.g" gdata HEX)
+string(LENGTH "${gdata}" gsize)
+math(EXPR gsize "${gsize} / 2")
+file(APPEND "${LOGFILE}" "hawaii-c.g size: ${gsize}")
+# See how big the size difference is
+if ("${gsize}" GREATER "${EXPECTED_SIZE}")
+ math(EXPR size_delta "${gsize} - ${EXPECTED_SIZE}")
+else ("${gsize}" GREATER "${EXPECTED_SIZE}")
+ math(EXPR size_delta "${EXPECTED_SIZE} - ${gsize}")
+endif ("${gsize}" GREATER "${EXPECTED_SIZE}")
+
+# Define a size delta beyond which we deem the conversion
+# to be a failure
+set(MAX_DELTA 100000)
+
# Check md5sum for a match
-if("${EXPECTED_MD5}" STREQUAL "${genmd5}")
- execute_process(COMMAND "@CMAKE_COMMAND@" -E touch "${CBDIR}/dem.done")
-else("${EXPECTED_MD5}" STREQUAL "${genmd5}")
- file(APPEND "${CBDIR}/regress-dem.log" "\n\ndem results differ for
${CBDIR}/hawaii-c.dsp: expected ${EXPECTED_MD5}, got ${genmd5}")
- message(FATAL_ERROR "[dem-g] Failure while converting ${CBDIR}/hawaii-c, see
${CBDIR}/regress-dem.log for more info.\n")
-endif("${EXPECTED_MD5}" STREQUAL "${genmd5}")
+if("${size_delta}" GREATER "${MAX_DELTA}")
+ file(APPEND "${LOGFILE}" "\nFailure: ${dem_g_result}\ndem size delta is
greater than ${MAX_DELTA} for ${CBDIR}/hawaii-c.g: ${size_delta}")
+ message(FATAL_ERROR "[gcv] Failure while converting ${CBDIR}/hawaii-c, see
${LOGFILE} for more info.\n")
+endif("${size_delta}" GREATER "${MAX_DELTA}")
+# Cleanup
+foreach(of ${OUTPUT_FILES})
+ execute_process(COMMAND "@CMAKE_COMMAND@" -E remove -f "${of}")
+endforeach(of ${OUTPUT_FILES})
+
# Local Variables:
# tab-width: 8
# mode: cmake
Deleted: brlcad/trunk/regress/gcv/fastgen_box.fast4
===================================================================
--- brlcad/trunk/regress/gcv/fastgen_box.fast4 2020-05-31 14:04:45 UTC (rev
75986)
+++ brlcad/trunk/regress/gcv/fastgen_box.fast4 2020-05-31 14:20:30 UTC (rev
75987)
@@ -1,22 +0,0 @@
-SECTION 1 501 2 0
-$COMMENT displayColor 0/157/157
-GRID 1 12.200 -1.000 -10.805
-GRID 2 12.200 1.000 -10.805
-GRID 3 13.700 -1.000 -10.805
-GRID 4 13.700 1.000 -10.805
-GRID 5 12.200 -1.000 -8.805
-GRID 6 13.700 -1.000 -8.805
-GRID 7 12.200 1.000 -8.805
-GRID 8 13.700 1.000 -8.805
-CTRI 1 1 1 2 3 0.100 2
-CTRI 2 1 3 2 4 0.100 2
-CTRI 3 1 5 1 6 0.100 2
-CTRI 4 1 6 1 3 0.100 2
-CTRI 5 1 7 5 8 0.100 2
-CTRI 6 1 8 5 6 0.100 2
-CTRI 7 1 2 7 4 0.100 2
-CTRI 8 1 4 7 8 0.100 2
-CTRI 9 1 5 7 1 0.100 2
-CTRI 10 1 1 7 2 0.100 2
-CTRI 11 1 8 6 4 0.100 2
-CTRI 12 1 4 6 3 0.100 2
Deleted: brlcad/trunk/regress/gcv/fastgen_dos.fast4
===================================================================
--- brlcad/trunk/regress/gcv/fastgen_dos.fast4 2020-05-31 14:04:45 UTC (rev
75986)
+++ brlcad/trunk/regress/gcv/fastgen_dos.fast4 2020-05-31 14:20:30 UTC (rev
75987)
@@ -1,22 +0,0 @@
-SECTION 1 501 2 0
-$COMMENT displayColor 0/157/157
-GRID 1 12.200 -1.000 -10.805
-GRID 2 12.200 1.000 -10.805
-GRID 3 13.700 -1.000 -10.805
-GRID 4 13.700 1.000 -10.805
-GRID 5 12.200 -1.000 -8.805
-GRID 6 13.700 -1.000 -8.805
-GRID 7 12.200 1.000 -8.805
-GRID 8 13.700 1.000 -8.805
-CTRI 1 1 1 2 3 0.100 2
-CTRI 2 1 3 2 4 0.100 2
-CTRI 3 1 5 1 6 0.100 2
-CTRI 4 1 6 1 3 0.100 2
-CTRI 5 1 7 5 8 0.100 2
-CTRI 6 1 8 5 6 0.100 2
-CTRI 7 1 2 7 4 0.100 2
-CTRI 8 1 4 7 8 0.100 2
-CTRI 9 1 5 7 1 0.100 2
-CTRI 10 1 1 7 2 0.100 2
-CTRI 11 1 8 6 4 0.100 2
-CTRI 12 1 4 6 3 0.100 2
Deleted: brlcad/trunk/regress/gcv/regress-fastgen.cmake.in
===================================================================
--- brlcad/trunk/regress/gcv/regress-fastgen.cmake.in 2020-05-31 14:04:45 UTC
(rev 75986)
+++ brlcad/trunk/regress/gcv/regress-fastgen.cmake.in 2020-05-31 14:20:30 UTC
(rev 75987)
@@ -1,83 +0,0 @@
-set(CBDIR "@CMAKE_CURRENT_BINARY_DIR@")
-set(CSDIR "@CMAKE_CURRENT_SOURCE_DIR@")
-
-set(SBDIR "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@")
-set(DBDIR "@CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG@")
-set(RBDIR "@CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE@")
-# Use the mechanism created to allow multiconfig builds to
-# know what the current build type is.
-if(EXISTS "@CMAKE_BINARY_DIR@/CMakeTmp/CURRENT_PATH/Release")
- set(BDIR "${RBDIR}")
- set(test_suffix "-Release")
-elseif(EXISTS "@CMAKE_BINARY_DIR@/CMakeTmp/CURRENT_PATH/Debug")
- set(BDIR "${DBDIR}")
- set(test_suffix "-Debug")
-else(EXISTS "@CMAKE_BINARY_DIR@/CMakeTmp/CURRENT_PATH/Release")
- set(BDIR "${SBDIR}")
- set(test_suffix)
-endif(EXISTS "@CMAKE_BINARY_DIR@/CMakeTmp/CURRENT_PATH/Release")
-
-get_filename_component(EXE "@CMAKE_COMMAND@" EXT)
-set(FAST4G "${BDIR}/fast4-g${EXE}")
-set(GDIFF "${BDIR}/gdiff${EXE}")
-
-# Clean up in case we've run before
-execute_process(COMMAND "@CMAKE_COMMAND@" -E remove "${CBDIR}/fastgen_unix.g")
-execute_process(COMMAND "@CMAKE_COMMAND@" -E remove "${CBDIR}/fastgen_dos.g")
-
-# Start with the file using standard UNIX line endings
-file(WRITE "${CBDIR}/fastgen.log" "Converting ${CSDIR}/fastgen_box.fast4 (UNIX
line endings):\n")
-# We need the titles of the .g files to be the same, so copy the file into a
"standard" position
-execute_process(COMMAND "@CMAKE_COMMAND@" -E remove "${CBDIR}/fastgen.fast4")
-execute_process(COMMAND "@CMAKE_COMMAND@" -E copy "${CSDIR}/fastgen_box.fast4"
"${CBDIR}/fastgen.fast4")
-execute_process(
- COMMAND "${FAST4G}" "${CBDIR}/fastgen.fast4" "${CBDIR}/fastgen_unix.g"
- OUTPUT_VARIABLE fastgen_log ERROR_VARIABLE fastgen_log
- )
-file(APPEND "${CBDIR}/fastgen.log" "${fastgen_log}")
-set(fastgen_log)
-if(NOT EXISTS "${CBDIR}/fastgen_unix.g")
- message(FATAL_ERROR "Unable to convert ${CSDIR}/fastgen_box.fast4 to
${CBDIR}/fastgen_unix.g with ${FAST4G}, aborting.\nSee ${CBDIR}/fastgen.log for
more details.")
-endif(NOT EXISTS "${CBDIR}/fastgen_unix.g")
-
-
-# Now the conversion with DOS line endings
-file(APPEND "${CBDIR}/fastgen.log" "\nConverting ${CSDIR}/fastgen_dos.fast4
(DOS line endings):\n")
-# We need the titles of the .g files to be the same, so copy the file into a
"standard" position
-execute_process(COMMAND "@CMAKE_COMMAND@" -E remove "${CBDIR}/fastgen.fast4")
-execute_process(COMMAND "@CMAKE_COMMAND@" -E copy "${CSDIR}/fastgen_dos.fast4"
"${CBDIR}/fastgen.fast4")
-execute_process(
- COMMAND "${FAST4G}" "${CBDIR}/fastgen.fast4" "${CBDIR}/fastgen_dos.g"
- OUTPUT_VARIABLE fastgen_log ERROR_VARIABLE fastgen_log
- )
-file(APPEND "${CBDIR}/fastgen.log" "${fastgen_log}")
-set(fastgen_log)
-if(NOT EXISTS "${CBDIR}/fastgen_dos.g")
- message(FATAL_ERROR "Unable to convert ${CSDIR}/fastgen_dos.fast4 to
${CBDIR}/fastgen_dos.g with ${BDIR}/fast4-g${EXE}, aborting.\nSee
${CBDIR}/fastgen.log for more details.")
-endif(NOT EXISTS "${CBDIR}/fastgen_dos.g")
-
-# Clean up temp file
-execute_process(COMMAND "@CMAKE_COMMAND@" -E remove "${CBDIR}/fastgen.fast4")
-
-# Check for differences (should be none)
-file(APPEND "${CBDIR}/fastgen.log" "\nComparing conversions from sources with
DOS and UNIX line endings:\n")
-execute_process(
- COMMAND "${GDIFF}" "${CBDIR}/fastgen_unix.g" "${CBDIR}/fastgen_dos.g"
RESULT_VARIABLE gdiff_result
- OUTPUT_VARIABLE fastgen_log ERROR_VARIABLE fastgen_log
- )
-file(APPEND "${CBDIR}/fastgen.log" "${fastgen_log}")
-set(fastgen_log)
-if(gdiff_result)
- file(APPEND "${CBDIR}/fastgen.log" "\n\ngdiff reports differences between
${CBDIR}/fastgen_unix.g and ${CBDIR}/fastgen_dos.g")
- message(FATAL_ERROR "[fast4-g] Failure, see ${CBDIR}/fastgen.log for more
info.\n")
-else(gdiff_result)
- execute_process(COMMAND "@CMAKE_COMMAND@" -E touch
"@CMAKE_CURRENT_BINARY_DIR@/fastgen${test_suffix}.done")
-endif(gdiff_result)
-
-# Local Variables:
-# tab-width: 8
-# mode: cmake
-# indent-tabs-mode: t
-# End:
-# ex: shiftwidth=2 tabstop=8
-
Modified: brlcad/trunk/regress/ged/CMakeLists.txt
===================================================================
--- brlcad/trunk/regress/ged/CMakeLists.txt 2020-05-31 14:04:45 UTC (rev
75986)
+++ brlcad/trunk/regress/ged/CMakeLists.txt 2020-05-31 14:20:30 UTC (rev
75987)
@@ -3,50 +3,22 @@
include_directories(${GED_INCLUDE_DIRS})
-if(CMAKE_CONFIGURATION_TYPES)
- set(cfg_testname "-${CMAKE_CFG_INTDIR}")
-else(CMAKE_CONFIGURATION_TYPES)
- set(cfg_testname "")
-endif(CMAKE_CONFIGURATION_TYPES)
+add_definitions(
+ -DHAVE_CONFIG_H
+ -DBRLCADBUILD
+ )
-macro(ADD_GED_Test testname depends_list)
- set(LOG_FILE
"${CMAKE_CURRENT_BINARY_DIR}/regress${cfg_testname}-${testname}.log")
- set(STAMP_FILE "${CMAKE_CURRENT_BINARY_DIR}/${testname}${cfg_testname}.done")
- configure_file("${CMAKE_CURRENT_SOURCE_DIR}/regress-${testname}.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/regress-${testname}.cmake" @ONLY)
- add_custom_command(
- OUTPUT "${STAMP_FILE}"
- COMMAND "${CMAKE_COMMAND}" -P
"${CMAKE_CURRENT_BINARY_DIR}/regress-${testname}.cmake"
- DEPENDS ${depends_list}
- )
- add_test(NAME regress-ged-${testname} COMMAND "${CMAKE_COMMAND}" -P
"${CMAKE_CURRENT_BINARY_DIR}/regress-${testname}.cmake")
- add_custom_target(regress-ged-${testname} DEPENDS ${depends_list}
${STAMP_FILE})
- set_target_properties(regress-ged-${testname} PROPERTIES FOLDER "BRL-CAD
Regression Tests")
- Add_Regression_Test(ged-${testname} "${depends_list}")
+BRLCAD_ADDEXEC(regress_mater mater.c libged TEST_USESDATA)
+target_compile_definitions(regress_mater PUBLIC BRLCADBUILD HAVE_CONFIG_H)
- add_dependencies(regress-ged regress-ged-${testname})
+BRLCAD_REGRESSION_TEST(regress-ged_mater "regress_mater;density_DATAFILES_cp"
EXEC regress_mater)
+DISTCLEAN("${CMAKE_CURRENT_BINARY_DIR}/regress-ged_mater.log")
- DISTCLEAN(
- ${STAMP_FILE}
- ${LOG_FILE}
- ${TARGET_IMAGE}
- )
-endmacro()
-
-add_custom_target(regress-ged)
-set_target_properties(regress-ged PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD 1)
-set_target_properties(regress-ged PROPERTIES FOLDER "BRL-CAD Regression Tests")
-
-Add_GED_Test(mater "regress_ged_mater;density_DATAFILES_cp")
-
CMAKEFILES(
CMakeLists.txt
- regress-mater.cmake.in
+ regress-ged_mater.cmake.in
)
-DISTCLEAN(
- "${CMAKE_CURRENT_BINARY_DIR}/regress_ged_mater.done"
- "${CMAKE_CURRENT_BINARY_DIR}/regress_ged_mater.log"
- )
# Local Variables:
# tab-width: 8
# mode: cmake
Copied: brlcad/trunk/regress/ged/mater.c (from rev 75986,
brlcad/branches/bioh/regress/ged/mater.c)
===================================================================
--- brlcad/trunk/regress/ged/mater.c (rev 0)
+++ brlcad/trunk/regress/ged/mater.c 2020-05-31 14:20:30 UTC (rev 75987)
@@ -0,0 +1,511 @@
+/* M A T E R . C
+ * BRL-CAD
+ *
+ * Copyright (c) 2018-2020 United States Government as represented by
+ * the U.S. Army Research Laboratory.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this file; see the file named COPYING for more
+ * information.
+ */
+/** @file mater.c
+ *
+ * Brief description
+ *
+ */
+
+#include "common.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <bu.h>
+#include <ged.h>
+
+const char *basic_density =
+"15 0.920000 Rubber\n"
+"16 1.230000 Rubber, Neoprene\n";
+
+const char *nist_to_basic =
+"\"Rubber, Butyl\" Rubber\n"
+"\"Rubber, Natural\" Rubber\n";
+
+const char *basic_to_nist =
+"\"Rubber\" \"Rubber, Natural\"\n";
+
+
+int
+check_for_data_exported(const char *filename, const char *key)
+{
+ struct bu_mapped_file *efile = bu_open_mapped_file(filename, "exported
densities data");
+ if (!strstr((char *)efile->buf, key)) {
+ bu_log("Error: 'mater -d export' file %s does not contain all expected
data\n", filename);
+ bu_close_mapped_file(efile);
+ return -1;
+ }
+ bu_close_mapped_file(efile);
+ return 0;
+}
+
+int
+check_for_data_present(struct ged *gedp, const char *key, const char *expected)
+{
+ const char *mater_cmd[10] = {"mater", "-d", NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL};
+ mater_cmd[1] = "-d";
+ mater_cmd[2] = "get";
+ mater_cmd[3] = "--name";
+ mater_cmd[4] = key;
+ if (ged_mater(gedp, 5, (const char **)mater_cmd) != GED_OK) {
+ bu_log("Error: 'mater -d get --name %s' failed\n", key);
+ return -1;
+ }
+ if (!BU_STR_EQUAL(bu_vls_cstr(gedp->ged_result_str), expected)) {
+ bu_log("Error: expected '%s', got: '%s'\n", expected,
bu_vls_cstr(gedp->ged_result_str));
+ return -1;
+ }
+ return 0;
+}
+
+
+int
+check_for_data_not_present(struct ged *gedp, const char *key)
+{
+ const char *mater_cmd[10] = {"mater", "-d", NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL};
+ mater_cmd[1] = "-d";
+ mater_cmd[2] = "get";
+ mater_cmd[3] = "--name";
+ mater_cmd[4] = key;
+ if (ged_mater(gedp, 5, (const char **)mater_cmd) != GED_OK) {
+ bu_log("Error: 'mater -d get --name %s' failed\n", key);
+ return -1;
+ }
+ if (bu_vls_strlen(gedp->ged_result_str)) {
+ bu_log("Error: unexpected result found for key %s: '%s'\n", key,
bu_vls_cstr(gedp->ged_result_str));
+ return -1;
+ }
+ return 0;
+}
+
+int
+attr_val_check(struct ged *gedp, const char *obj, const char *key, const char
*expected)
+{
+ const char *attr_cmd[5] = {"attr", "get", NULL, NULL, NULL};
+ attr_cmd[2] = obj;
+ attr_cmd[3] = key;
+ if (ged_attr(gedp, 4, (const char **)attr_cmd) != GED_OK) {
+ bu_log("Error: 'attr get %s %s' failed\n", obj, key);
+ return -1;
+ }
+ if (!BU_STR_EQUAL(bu_vls_cstr(gedp->ged_result_str), expected)) {
+ bu_log("Error: expected '%s', got: '%s'\n", expected,
bu_vls_cstr(gedp->ged_result_str));
+ return -1;
+ }
+ return 0;
+}
+
+
+int
+main(int ac, char *av[]) {
+ struct ged *gedp;
+ const char *gname = "ged_mater_test.g";
+ const char *exp_data = "ged_mater_density_export.txt";
+ const char *d_data = "ged_mater_density_data.txt";
+ const char *m_data = "ged_mater_density_map.txt";
+ const char *b_data = "ged_mater_density_reverse_map.txt";
+ char mdata[MAXPATHLEN];
+ const char *mater_cmd[10] = {"mater", "-d", NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL};
+ const char *make_cmd[10] = {"make", NULL, "sph", NULL, NULL, NULL, NULL,
NULL, NULL, NULL};
+ const char *reg_cmd[10] = {"r", NULL, "u", NULL, NULL, NULL, NULL, NULL,
NULL, NULL};
+ const char *attr_cmd[10] = {"attr", "set", NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL};
+ const char *mat1 = "1,0.0001,Material01";
+ const char *mat2 = "2,1.1e-1,Material02";
+ const char *mat1_reassign = "1,2.0,Material 03";
+
+ /* Need this for bu_dir to work correctly */
+ bu_setprogname(av[0]);
+
+ if (ac != 2) {
+ printf("Usage: %s test_name\n", av[0]);
+ return 1;
+ }
+
+ if (bu_file_exists(gname, NULL)) {
+ printf("Error: %s already exists\n", gname);
+ return 1;
+ }
+
+ gedp = ged_open("db", gname, 0);
+
+ if (BU_STR_EQUAL(av[1], "dnull")) {
+ if (ged_mater(gedp, 2, (const char **)mater_cmd) != GED_HELP) {
+ bu_log("Error: bare 'mater -d' doesn't return GED_HELP\n");
+ goto ged_test_fail;
+ }
+ }
+
+ if (BU_STR_EQUAL(av[1], "dstd")) {
+
+ if (bu_file_exists(exp_data, NULL)) {
+ printf("ERROR: %s already exists, aborting\n", exp_data);
+ return 2;
+ }
+
+ (void)bu_dir(mdata, MAXPATHLEN, BU_DIR_DATA, "data",
"NIST_DENSITIES", NULL);
+ if (!bu_file_exists(mdata, NULL)) {
+ bu_log("Error: density file %s not found.\n", mdata);
+ goto ged_test_fail;
+ }
+
+ mater_cmd[1] = "-d";
+ mater_cmd[2] = "validate";
+ mater_cmd[3] = mdata;
+ if (ged_mater(gedp, 4, (const char **)mater_cmd) != GED_OK) {
+ bu_log("Error: 'mater -d import' failed to validate %s\n", mdata);
+ goto ged_test_fail;
+ }
+
+ mater_cmd[1] = "-d";
+ mater_cmd[2] = "import";
+ mater_cmd[3] = "-v";
+ mater_cmd[4] = mdata;
+ if (ged_mater(gedp, 5, (const char **)mater_cmd) != GED_OK) {
+ bu_log("Error: 'mater -d import' failed to load %s\n", mdata);
+ goto ged_test_fail;
+ }
+
+ mater_cmd[1] = "-d";
+ mater_cmd[2] = "source";
+ mater_cmd[3] = NULL;
+ if (ged_mater(gedp, 4, (const char **)mater_cmd) != GED_OK) {
+ bu_log("Error: 'mater -d source' failed to run correctly\n");
+ goto ged_test_fail;
+ } else {
+ if (bu_strncmp(bu_vls_cstr(gedp->ged_result_str),
gedp->ged_wdbp->dbip->dbi_filename,
strlen(gedp->ged_wdbp->dbip->dbi_filename))) {
+ bu_log("Error: 'mater -d source' reports a location of %s
instead of %s\n", bu_vls_cstr(gedp->ged_result_str),
gedp->ged_wdbp->dbip->dbi_filename);
+ goto ged_test_fail;
+ }
+ }
+
+ mater_cmd[1] = "-d";
+ mater_cmd[2] = "export";
+ mater_cmd[3] = exp_data;
+ if (ged_mater(gedp, 4, (const char **)mater_cmd) != GED_OK ||
!bu_file_exists(exp_data, NULL)) {
+ bu_log("Error: 'mater -d export' failed to export to %s\n",
exp_data);
+ goto ged_test_fail;
+ }
+ if (check_for_data_exported(exp_data, "Xylene")) {
+ goto ged_test_fail;
+ }
+
+ mater_cmd[1] = "-d";
+ mater_cmd[2] = "clear";
+ if (ged_mater(gedp, 3, (const char **)mater_cmd) != GED_OK) {
+ bu_log("Error: 'mater -d clear' failed\n");
+ goto ged_test_fail;
+ }
+
+ mater_cmd[1] = "-d";
+ mater_cmd[2] = "set";
+ mater_cmd[3] = mat1;
+ if (ged_mater(gedp, 4, (const char **)mater_cmd) != GED_OK) {
+ bu_log("Error: 'mater -d set %s' failed\n", mat1);
+ goto ged_test_fail;
+ }
+ if (check_for_data_present(gedp, "Material01", "1 0.0001
Material01\n")) {
+ goto ged_test_fail;
+ }
+ if (check_for_data_not_present(gedp, "Xylene")) {
+ goto ged_test_fail;
+ }
+
+ mater_cmd[1] = "-d";
+ mater_cmd[2] = "set";
+ mater_cmd[3] = mat2;
+ if (ged_mater(gedp, 4, (const char **)mater_cmd) != GED_OK) {
+ bu_log("Error: 'mater -d set %s' failed\n", mat2);
+ goto ged_test_fail;
+ }
+ if (check_for_data_present(gedp, "Material01", "1 0.0001
Material01\n")) {
+ goto ged_test_fail;
+ }
+ if (check_for_data_present(gedp, "Material02", "2 0.11
Material02\n")) {
+ goto ged_test_fail;
+ }
+
+ mater_cmd[1] = "-d";
+ mater_cmd[2] = "set";
+ mater_cmd[3] = mat1_reassign;
+ if (ged_mater(gedp, 4, (const char **)mater_cmd) != GED_OK) {
+ bu_log("Error: 'mater -d set %s' failed\n", mat1_reassign);
+ goto ged_test_fail;
+ }
+ if (check_for_data_present(gedp, "Material02", "2 0.11
Material02\n")) {
+ goto ged_test_fail;
+ }
+ if (check_for_data_present(gedp, "Material 03", "1 2
Material 03\n")) {
+ goto ged_test_fail;
+ }
+ if (check_for_data_not_present(gedp, "Material01")) {
+ goto ged_test_fail;
+ }
+
+ // Now, test the mapping logic
+
+ mater_cmd[1] = "-d";
+ mater_cmd[2] = "clear";
+ if (ged_mater(gedp, 3, (const char **)mater_cmd) != GED_OK) {
+ bu_log("Error: 'mater -d clear' failed\n");
+ goto ged_test_fail;
+ }
+
+ mater_cmd[1] = "-d";
+ mater_cmd[2] = "import";
+ mater_cmd[3] = "-v";
+ mater_cmd[4] = mdata;
+ if (ged_mater(gedp, 5, (const char **)mater_cmd) != GED_OK) {
+ bu_log("Error: 'mater -d import' failed to load %s\n", mdata);
+ goto ged_test_fail;
+ }
+
+ // Make the initial geometry objects on which the mappings will
+ // operate.
+ make_cmd[1] = "sph1.s";
+ if (ged_make(gedp, 3, (const char **)make_cmd) != GED_OK) {
+ bu_log("Error: failed to make object\n");
+ goto ged_test_fail;
+ }
+ make_cmd[1] = "sph2.s";
+ if (ged_make(gedp, 3, (const char **)make_cmd) != GED_OK) {
+ bu_log("Error: failed to make object\n");
+ goto ged_test_fail;
+ }
+ make_cmd[1] = "sph3.s";
+ if (ged_make(gedp, 3, (const char **)make_cmd) != GED_OK) {
+ bu_log("Error: failed to make object\n");
+ goto ged_test_fail;
+ }
+ reg_cmd[1] = "reg1.r";
+ reg_cmd[3] = "sph1.s";
+ if (ged_region(gedp, 4, (const char **)reg_cmd) != GED_OK) {
+ bu_log("Error: failed to make region\n");
+ goto ged_test_fail;
+ }
+ reg_cmd[1] = "reg2.r";
+ reg_cmd[3] = "sph2.s";
+ if (ged_region(gedp, 4, (const char **)reg_cmd) != GED_OK) {
+ bu_log("Error: failed to make region\n");
+ goto ged_test_fail;
+ }
+ reg_cmd[1] = "reg3.r";
+ reg_cmd[3] = "sph3.s";
+ if (ged_region(gedp, 4, (const char **)reg_cmd) != GED_OK) {
+ bu_log("Error: failed to make region\n");
+ goto ged_test_fail;
+ }
+
+ // Set the seed attributes.
+ attr_cmd[2] = "reg1.r";
+ attr_cmd[3] = "material_id";
+ attr_cmd[4] = "12242";
+ if (ged_attr(gedp, 5, (const char **)attr_cmd) != GED_OK) {
+ bu_log("Error: failed to set attribute\n");
+ goto ged_test_fail;
+ }
+ attr_cmd[2] = "reg2.r";
+ attr_cmd[3] = "material_name";
+ attr_cmd[4] = "Rubber, Natural";
+ if (ged_attr(gedp, 5, (const char **)attr_cmd) != GED_OK) {
+ bu_log("Error: failed to set attribute\n");
+ goto ged_test_fail;
+ }
+ attr_cmd[2] = "reg3.r";
+ attr_cmd[3] = "material_id";
+ attr_cmd[4] = "12244";
+ if (ged_attr(gedp, 5, (const char **)attr_cmd) != GED_OK) {
+ bu_log("Error: failed to set attribute\n");
+ goto ged_test_fail;
+ }
+
+ // In-memory name updates.
+ mater_cmd[1] = "-d";
+ mater_cmd[2] = "map";
+ mater_cmd[3] = "--names-from-ids";
+ if (ged_mater(gedp, 4, (const char **)mater_cmd) != GED_OK) {
+ bu_log("Error: 'mater -d map --names-from-ids' failed to run\n");
+ goto ged_test_fail;
+ }
+ if (attr_val_check(gedp, "reg1.r", "material_name", "Rubber, Butyl")) {
+ goto ged_test_fail;
+ }
+ if (attr_val_check(gedp, "reg2.r", "material_name", "Rubber, Natural"))
{
+ goto ged_test_fail;
+ }
+ if (attr_val_check(gedp, "reg3.r", "material_name", "Rubber,
Neoprene")) {
+ goto ged_test_fail;
+ }
+
+ // In-memory id updates.
+ mater_cmd[1] = "-d";
+ mater_cmd[2] = "map";
+ mater_cmd[3] = "--ids-from-names";
+ if (ged_mater(gedp, 4, (const char **)mater_cmd) != GED_OK) {
+ bu_log("Error: 'mater -d map --ids-from-names' failed to run\n");
+ goto ged_test_fail;
+ }
+ if (attr_val_check(gedp, "reg1.r", "material_id", "12242")) {
+ goto ged_test_fail;
+ }
+ if (attr_val_check(gedp, "reg2.r", "material_id", "12243")) {
+ goto ged_test_fail;
+ }
+ if (attr_val_check(gedp, "reg3.r", "material_id", "12244")) {
+ goto ged_test_fail;
+ }
+
+ // Create files to use for mapping inputs
+ {
+ FILE *dd, *dm, *db;
+ if (((dd = fopen(d_data, "wb")) == NULL) ||
+ ((dm = fopen(m_data, "wb")) == NULL) ||
+ ((db = fopen(b_data, "wb")) == NULL)) {
+ bu_log("Error: could not open mapping input files for
writing\n");
+ goto ged_test_fail;
+ }
+ fprintf(dd, "%s", basic_density);
+ fprintf(dm, "%s", nist_to_basic);
+ fprintf(db, "%s", basic_to_nist);
+ (void)fclose(dd);
+ (void)fclose(dm);
+ (void)fclose(db);
+ }
+
+ // File-based id updates.
+ mater_cmd[1] = "-d";
+ mater_cmd[2] = "map";
+ mater_cmd[3] = "--ids-from-names";
+ mater_cmd[4] = d_data;
+ if (ged_mater(gedp, 5, (const char **)mater_cmd) != GED_OK) {
+ bu_log("Error: 'mater -d map --ids-from-names %s' failed to run\n",
d_data);
+ goto ged_test_fail;
+ }
+ if (attr_val_check(gedp, "reg1.r", "material_id", "12242")) {
+ goto ged_test_fail;
+ }
+ if (attr_val_check(gedp, "reg2.r", "material_id", "12243")) {
+ goto ged_test_fail;
+ }
+ if (attr_val_check(gedp, "reg3.r", "material_id", "16")) {
+ goto ged_test_fail;
+ }
+
+
+ // File-based id updates, with map file.
+ mater_cmd[1] = "-d";
+ mater_cmd[2] = "map";
+ mater_cmd[3] = "--ids-from-names";
+ mater_cmd[4] = d_data;
+ mater_cmd[5] = m_data;
+ if (ged_mater(gedp, 6, (const char **)mater_cmd) != GED_OK) {
+ bu_log("Error: 'mater -d map --ids-from-names %s %s' failed to
run\n", d_data, m_data);
+ goto ged_test_fail;
+ }
+ if (attr_val_check(gedp, "reg1.r", "material_id", "15")) {
+ goto ged_test_fail;
+ }
+ if (attr_val_check(gedp, "reg2.r", "material_id", "15")) {
+ goto ged_test_fail;
+ }
+ if (attr_val_check(gedp, "reg3.r", "material_id", "16")) {
+ goto ged_test_fail;
+ }
+
+ // File-based name updates.
+ mater_cmd[1] = "-d";
+ mater_cmd[2] = "map";
+ mater_cmd[3] = "--names-from-ids";
+ mater_cmd[4] = d_data;
+ if (ged_mater(gedp, 5, (const char **)mater_cmd) != GED_OK) {
+ bu_log("Error: 'mater -d map --names-from-ids %s' failed to run\n",
d_data);
+ goto ged_test_fail;
+ }
+ if (attr_val_check(gedp, "reg1.r", "material_name", "Rubber")) {
+ goto ged_test_fail;
+ }
+ if (attr_val_check(gedp, "reg2.r", "material_name", "Rubber")) {
+ goto ged_test_fail;
+ }
+ if (attr_val_check(gedp, "reg3.r", "material_name", "Rubber,
Neoprene")) {
+ goto ged_test_fail;
+ }
+
+
+ // File-based id updates, with map file, after name update.
+ mater_cmd[1] = "-d";
+ mater_cmd[2] = "map";
+ mater_cmd[3] = "--ids-from-names";
+ mater_cmd[4] = d_data;
+ mater_cmd[5] = m_data;
+ if (ged_mater(gedp, 5, (const char **)mater_cmd) != GED_OK) {
+ bu_log("Error: 'mater -d map --ids-from-names %s %s' failed to
run\n", d_data, m_data);
+ goto ged_test_fail;
+ }
+ if (attr_val_check(gedp, "reg1.r", "material_id", "15")) {
+ goto ged_test_fail;
+ }
+ if (attr_val_check(gedp, "reg2.r", "material_id", "15")) {
+ goto ged_test_fail;
+ }
+ if (attr_val_check(gedp, "reg3.r", "material_id", "16")) {
+ goto ged_test_fail;
+ }
+
+
+ // Map file only id updates.
+ mater_cmd[1] = "-d";
+ mater_cmd[2] = "map";
+ mater_cmd[3] = "--ids-from-names";
+ mater_cmd[4] = b_data;
+ if (ged_mater(gedp, 5, (const char **)mater_cmd) != GED_OK) {
+ bu_log("Error: 'mater -d map --ids-from-names %s' failed to run\n",
b_data);
+ goto ged_test_fail;
+ }
+ if (attr_val_check(gedp, "reg1.r", "material_id", "12243")) {
+ goto ged_test_fail;
+ }
+ if (attr_val_check(gedp, "reg2.r", "material_id", "12243")) {
+ goto ged_test_fail;
+ }
+ if (attr_val_check(gedp, "reg3.r", "material_id", "12244")) {
+ goto ged_test_fail;
+ }
+
+
+ }
+
+ ged_close(gedp);
+ BU_PUT(gedp, struct ged);
+ return 0;
+
+ged_test_fail:
+ ged_close(gedp);
+ BU_PUT(gedp, struct ged);
+ return 1;
+}
+
+/*
+ * Local Variables:
+ * tab-width: 8
+ * mode: C
+ * indent-tabs-mode: t
+ * c-file-style: "stroustrup"
+ * End:
+ * ex: shiftwidth=4 tabstop=8
+ */
Copied: brlcad/trunk/regress/ged/regress-ged_mater.cmake.in (from rev 75986,
brlcad/branches/bioh/regress/ged/regress-ged_mater.cmake.in)
===================================================================
--- brlcad/trunk/regress/ged/regress-ged_mater.cmake.in
(rev 0)
+++ brlcad/trunk/regress/ged/regress-ged_mater.cmake.in 2020-05-31 14:20:30 UTC
(rev 75987)
@@ -0,0 +1,69 @@
+# Values set at CMake configure time
+set(CBDIR "@CMAKE_CURRENT_BINARY_DIR@")
+set(CSDIR "@CMAKE_CURRENT_SOURCE_DIR@")
+set(LOGFILE "${CBDIR}/regress-ged_mater.log")
+
+set(OUTPUT_FILES
+ "${CBDIR}/ged_mater_density_data.txt"
+ "${CBDIR}/ged_mater_density_export.txt"
+ "${CBDIR}/ged_mater_density_map.txt"
+ "${CBDIR}/ged_mater_density_reverse_map.txt"
+ "${CBDIR}/ged_mater_test.g"
+ )
+
+file(WRITE "${LOGFILE}" "Starting mater test run\n")
+
+# The executable locations aren't know at CMake configure time, so it is passed
+# in via the EXEC variable at runtime by a generator expression in the parent
+# build. De-quote it and assign it to the appropriate variable.
+string(REPLACE "\\" "" MATER_EXEC "${EXEC}")
+if (NOT EXISTS "${MATER_EXEC}")
+ file(WRITE "${LOGFILE}" "mater test program not found at location
\"${MATER_EXEC}\" - aborting\n")
+ message(FATAL_ERROR "Unable to find mater test program, aborting.\nSee
${LOGFILE} for more details.")
+endif (NOT EXISTS "${MATER_EXEC}")
+
+# Clean up in case we've run before unsuccessfully
+foreach(of ${OUTPUT_FILES})
+ execute_process(COMMAND "@CMAKE_COMMAND@" -E remove -f "${of}")
+endforeach(of ${OUTPUT_FILES})
+
+# Run empty density test
+file(APPEND "${LOGFILE}" "Running ${MATER_EXEC} dnull\n")
+execute_process(
+ COMMAND "${MATER_EXEC}" "dnull" RESULT_VARIABLE ged_mater_result
+ OUTPUT_VARIABLE ged_mater_log ERROR_VARIABLE ged_mater_log
+ WORKING_DIRECTORY ${CBDIR}
+ )
+file(APPEND "${LOGFILE}" "${ged_mater_log}")
+set(get_mater_log)
+if(ged_mater_result)
+ message(FATAL_ERROR "[regress-ged_mater] Failure: ${ged_mater_result}. See
${LOGFILE} for more info.\n")
+endif(ged_mater_result)
+
+execute_process(COMMAND "@CMAKE_COMMAND@" -E remove -f
"${CBDIR}/ged_mater_test.g")
+
+# Run standard density test
+file(APPEND "${LOGFILE}" "Running ${MATER_EXEC} dstd\n")
+execute_process(
+ COMMAND "${MATER_EXEC}" "dstd" RESULT_VARIABLE ged_mater_result
+ OUTPUT_VARIABLE ged_mater_log ERROR_VARIABLE ged_mater_log
+ WORKING_DIRECTORY ${CBDIR}
+ )
+file(APPEND "${LOGFILE}" "${ged_mater_log}")
+set(get_mater_log)
+if(ged_mater_result)
+ message(FATAL_ERROR "[regress-ged_mater] Failure: ${ged_mater_result}. See
${LOGFILE} for more info.\n")
+endif(ged_mater_result)
+
+# Clean up
+foreach(of ${OUTPUT_FILES})
+ execute_process(COMMAND "@CMAKE_COMMAND@" -E remove -f "${of}")
+endforeach(of ${OUTPUT_FILES})
+
+# Local Variables:
+# tab-width: 8
+# mode: cmake
+# indent-tabs-mode: t
+# End:
+# ex: shiftwidth=2 tabstop=8
+
Deleted: brlcad/trunk/regress/ged/regress-mater.cmake.in
===================================================================
--- brlcad/trunk/regress/ged/regress-mater.cmake.in 2020-05-31 14:04:45 UTC
(rev 75986)
+++ brlcad/trunk/regress/ged/regress-mater.cmake.in 2020-05-31 14:20:30 UTC
(rev 75987)
@@ -1,65 +0,0 @@
-set(CBDIR "@CMAKE_CURRENT_BINARY_DIR@")
-set(CSDIR "@CMAKE_CURRENT_SOURCE_DIR@")
-
-set(SBDIR "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@")
-set(DBDIR "@CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG@")
-set(RBDIR "@CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE@")
-# Use the mechanism created to allow multiconfig builds to
-# know what the current build type is.
-if(EXISTS "@CMAKE_BINARY_DIR@/CMakeTmp/CURRENT_PATH/Release")
- set(BDIR "${RBDIR}")
- set(test_suffix "-Release")
-elseif(EXISTS "@CMAKE_BINARY_DIR@/CMakeTmp/CURRENT_PATH/Debug")
- set(BDIR "${DBDIR}")
- set(test_suffix "-Debug")
-else(EXISTS "@CMAKE_BINARY_DIR@/CMakeTmp/CURRENT_PATH/Release")
- set(BDIR "${SBDIR}")
- set(test_suffix)
-endif(EXISTS "@CMAKE_BINARY_DIR@/CMakeTmp/CURRENT_PATH/Release")
-
-get_filename_component(EXE "@CMAKE_COMMAND@" EXT)
-set(GED_TEST_MATER "${BDIR}/regress_ged_mater${EXE}")
-
-# Clean up in case we've run before
-execute_process(COMMAND "@CMAKE_COMMAND@" -E remove
"${CBDIR}/ged_mater_test.g")
-execute_process(COMMAND "@CMAKE_COMMAND@" -E remove
"${CBDIR}/ged_mater_density_export.txt")
-execute_process(COMMAND "@CMAKE_COMMAND@" -E remove
"${CBDIR}/ged_mater_density_data.txt")
-execute_process(COMMAND "@CMAKE_COMMAND@" -E remove
"${CBDIR}/ged_mater_density_map.txt")
-execute_process(COMMAND "@CMAKE_COMMAND@" -E remove
"${CBDIR}/ged_mater_density_reverse_map.txt")
-
-execute_process(
- COMMAND "${GED_TEST_MATER}" "dnull" RESULT_VARIABLE ged_mater_result
- OUTPUT_VARIABLE ged_mater_log ERROR_VARIABLE ged_mater_log
- WORKING_DIRECTORY ${CBDIR}
- )
-file(APPEND "${CBDIR}/regress_ged_mater.log" "${ged_mater_log}")
-
-execute_process(COMMAND "@CMAKE_COMMAND@" -E remove
"${CBDIR}/ged_mater_test.g")
-
-execute_process(
- COMMAND "${GED_TEST_MATER}" "dstd" RESULT_VARIABLE ged_mater_result
- OUTPUT_VARIABLE ged_mater_log ERROR_VARIABLE ged_mater_log
- WORKING_DIRECTORY ${CBDIR}
- )
-file(APPEND "${CBDIR}/regress_ged_mater.log" "${ged_mater_log}")
-
-# Clean up
-execute_process(COMMAND "@CMAKE_COMMAND@" -E remove
"${CBDIR}/ged_mater_test.g")
-execute_process(COMMAND "@CMAKE_COMMAND@" -E remove
"${CBDIR}/ged_mater_density_export.txt")
-execute_process(COMMAND "@CMAKE_COMMAND@" -E remove
"${CBDIR}/ged_mater_density_data.txt")
-execute_process(COMMAND "@CMAKE_COMMAND@" -E remove
"${CBDIR}/ged_mater_density_map.txt")
-execute_process(COMMAND "@CMAKE_COMMAND@" -E remove
"${CBDIR}/ged_mater_density_reverse_map.txt")
-
-if(ged_mater_result)
- message(FATAL_ERROR "[regress-ged-mater] Failure, see
${CBDIR}/regress_ged_mater.log for more info.\n")
-else(ged_mater_result)
- execute_process(COMMAND "@CMAKE_COMMAND@" -E touch
"@CMAKE_CURRENT_BINARY_DIR@/regress_ged_mater${test_suffix}.done")
-endif(ged_mater_result)
-
-# Local Variables:
-# tab-width: 8
-# mode: cmake
-# indent-tabs-mode: t
-# End:
-# ex: shiftwidth=2 tabstop=8
-
Modified: brlcad/trunk/regress/icv/CMakeLists.txt
===================================================================
--- brlcad/trunk/regress/icv/CMakeLists.txt 2020-05-31 14:04:45 UTC (rev
75986)
+++ brlcad/trunk/regress/icv/CMakeLists.txt 2020-05-31 14:20:30 UTC (rev
75987)
@@ -1,108 +1,77 @@
# Tests for the various image format conversions supported
# by BRL-CAD
-macro(Add_Image_Test testname testtype depends_list)
- CMAKE_PARSE_ARGUMENTS(${testname} ""
"INPUT_IMAGE;CONTROL_IMAGE;TARGET_IMAGE;LOG_FILE" "" ${ARGN})
- set(TARGET_NAME ${testname})
- if (NOT "${testtype}" STREQUAL "IMPORT" AND NOT "${testtype}" STREQUAL
"EXPORT")
- message(FATAL_ERROR "Valid image test types are IMPORT and EXPORT: got
${testtype}")
- endif (NOT "${testtype}" STREQUAL "IMPORT" AND NOT "${testtype}" STREQUAL
"EXPORT")
- set(INPUT_IMAGE ${${testname}_INPUT_IMAGE})
- set(CONTROL_IMAGE ${${testname}_CONTROL_IMAGE})
- set(TARGET_IMAGE ${${testname}_TARGET_IMAGE})
- set(LOG_FILE ${${testname}_LOG_FILE})
- set(STAMP_FILE "${CMAKE_CURRENT_BINARY_DIR}/${testname}.done")
- set(deps_list pixcmp icv ${depends_list})
- if ("${testtype}" STREQUAL "IMPORT")
- configure_file("${CMAKE_CURRENT_SOURCE_DIR}/regress-icv_import.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/regress-${testname}.cmake" @ONLY)
- endif ("${testtype}" STREQUAL "IMPORT")
- if ("${testtype}" STREQUAL "EXPORT")
- configure_file("${CMAKE_CURRENT_SOURCE_DIR}/regress-icv_export.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/regress-${testname}.cmake" @ONLY)
- endif ("${testtype}" STREQUAL "EXPORT")
- add_custom_command(
- OUTPUT ${STAMP_FILE}
- COMMAND "${CMAKE_COMMAND}" -P
"${CMAKE_CURRENT_BINARY_DIR}/regress-${testname}.cmake"
- DEPENDS pixcmp icv ${deps_list}
- )
+# All image conversions with icv use one of two templates - import or export:
+set(TIMPORT "${CMAKE_CURRENT_SOURCE_DIR}/regress-icv_import.cmake.in")
+set(TEXPORT "${CMAKE_CURRENT_SOURCE_DIR}/regress-icv_export.cmake.in")
- add_test(NAME regress-icv-${testname} COMMAND "${CMAKE_COMMAND}" -P
"${CMAKE_CURRENT_BINARY_DIR}/regress-${testname}.cmake")
- add_custom_target(regress-icv-${testname} DEPENDS ${deps_list} ${STAMP_FILE})
- Add_Regression_Test(icv-${testname} "${deps_list}")
- set_target_properties(regress-icv-${testname} PROPERTIES FOLDER "BRL-CAD
Regression Tests/icv")
+# pix-pix
+set(INPUT_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/../../bench/ref/m35.pix")
+set(CONTROL_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/../../bench/ref/m35.pix")
+set(TARGET_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35_icv.pix")
+set(LOG_FILE "${CMAKE_CURRENT_BINARY_DIR}/pix_pix.log")
+BRLCAD_REGRESSION_TEST(regress-pix_pix "pixcmp;icv" TEST_SCRIPT "${TIMPORT}"
EXEC icv)
+DISTCLEAN(${LOG_FILE} ${TARGET_IMAGE})
- add_dependencies(regress-icv regress-icv-${testname})
+# png-pix
+set(INPUT_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/m35.png")
+set(CONTROL_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/../../bench/ref/m35.pix")
+set(TARGET_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35_png.pix")
+set(LOG_FILE "${CMAKE_CURRENT_BINARY_DIR}/png_pix.log")
+BRLCAD_REGRESSION_TEST(regress-png_pix "pixcmp;icv" TEST_SCRIPT "${TIMPORT}"
EXEC icv)
+DISTCLEAN(${LOG_FILE} ${TARGET_IMAGE})
- DISTCLEAN(
- ${STAMP_FILE}
- ${LOG_FILE}
- ${TARGET_IMAGE}
- )
-endmacro()
+# pix-png
+set(INPUT_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/../../bench/ref/m35.pix")
+set(CONTROL_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/m35.png")
+set(TARGET_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35_pix.png")
+set(LOG_FILE "${CMAKE_CURRENT_BINARY_DIR}/pix_png.log")
+set(TARGET_NAME pix_png)
+bRLCAD_REGRESSION_TEST(regress-pix_png "pixcmp;icv" TEST_SCRIPT "${TEXPORT}"
EXEC icv)
+DISTCLEAN(${LOG_FILE} ${TARGET_IMAGE})
-add_custom_target(regress-icv)
-set_target_properties(regress-icv PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD 1)
-set_target_properties(regress-icv PROPERTIES FOLDER "BRL-CAD Regression Tests")
-
-
-Add_Image_Test(pix_pix IMPORT ""
- INPUT_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/../../bench/ref/m35.pix"
- CONTROL_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/../../bench/ref/m35.pix"
- TARGET_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35_icv.pix"
- LOG_FILE "${CMAKE_CURRENT_BINARY_DIR}/pix_pix.log"
- )
-
-Add_Image_Test(png_pix IMPORT ""
- INPUT_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/m35.png"
- CONTROL_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/../../bench/ref/m35.pix"
- TARGET_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35_png.pix"
- LOG_FILE "${CMAKE_CURRENT_BINARY_DIR}/png_pix.log"
- )
-
-Add_Image_Test(pix_png EXPORT ""
- INPUT_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/../../bench/ref/m35.pix"
- CONTROL_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/m35.png"
- TARGET_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35_pix.png"
- LOG_FILE "${CMAKE_CURRENT_BINARY_DIR}/pix_png.log"
- )
-
# Unpack compressed ppm file
execute_process(COMMAND "${CMAKE_COMMAND}" -E tar xjf
"${CMAKE_CURRENT_SOURCE_DIR}/m35.ppm.tbz2" WORKING_DIRECTORY
"${CMAKE_CURRENT_BINARY_DIR}")
DISTCLEAN("${CMAKE_CURRENT_BINARY_DIR}/m35.ppm")
-Add_Image_Test(ppm_pix IMPORT ""
- INPUT_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35.ppm"
- CONTROL_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/../../bench/ref/m35.pix"
- TARGET_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35_ppm.pix"
- LOG_FILE "${CMAKE_CURRENT_BINARY_DIR}/ppm_pix.log"
- )
+# ppm_pix
+set(INPUT_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35.ppm")
+set(CONTROL_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/../../bench/ref/m35.pix")
+set(TARGET_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35_ppm.pix")
+set(LOG_FILE "${CMAKE_CURRENT_BINARY_DIR}/ppm_pix.log")
+BRLCAD_REGRESSION_TEST(regress-ppm_pix "pixcmp;icv" TEST_SCRIPT "${TIMPORT}"
EXEC icv)
+DISTCLEAN(${LOG_FILE} ${TARGET_IMAGE})
-Add_Image_Test(pix_ppm EXPORT ""
- INPUT_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/../../bench/ref/m35.pix"
- CONTROL_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35.ppm"
- TARGET_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35_pix.ppm"
- LOG_FILE "${CMAKE_CURRENT_BINARY_DIR}/pix_ppm.log"
- )
+# pix_ppm
+set(INPUT_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/../../bench/ref/m35.pix")
+set(CONTROL_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35.ppm")
+set(TARGET_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35_pix.ppm")
+set(LOG_FILE "${CMAKE_CURRENT_BINARY_DIR}/pix_ppm.log")
+set(TARGET_NAME pix_ppm)
+BRLCAD_REGRESSION_TEST(regress-pix_ppm "pixcmp;icv" TEST_SCRIPT "${TEXPORT}"
EXEC icv)
+DISTCLEAN(${LOG_FILE} ${TARGET_IMAGE})
-
# Unpack compressed dpix file
execute_process(COMMAND "${CMAKE_COMMAND}" -E tar xjf
"${CMAKE_CURRENT_SOURCE_DIR}/m35.dpix.tbz2" WORKING_DIRECTORY
"${CMAKE_CURRENT_BINARY_DIR}")
DISTCLEAN("${CMAKE_CURRENT_BINARY_DIR}/m35.dpix")
-Add_Image_Test(dpix_pix IMPORT ""
- INPUT_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35.dpix"
- CONTROL_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/../../bench/ref/m35.pix"
- TARGET_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35_dpix.pix"
- LOG_FILE "${CMAKE_CURRENT_BINARY_DIR}/dpix_pix.log"
- )
+# dpix_pix
+set(INPUT_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35.dpix")
+set(CONTROL_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/../../bench/ref/m35.pix")
+set(TARGET_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35_dpix.pix")
+set(LOG_FILE "${CMAKE_CURRENT_BINARY_DIR}/dpix_pix.log")
+BRLCAD_REGRESSION_TEST(regress-dpix_pix "pixcmp;icv" TEST_SCRIPT "${TIMPORT}"
EXEC icv)
+DISTCLEAN(${LOG_FILE} ${TARGET_IMAGE})
-Add_Image_Test(pix_dpix EXPORT ""
- INPUT_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/../../bench/ref/m35.pix"
- CONTROL_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35.dpix"
- TARGET_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35_pix.dpix"
- LOG_FILE "${CMAKE_CURRENT_BINARY_DIR}/pix_dpix.log"
- )
+# pix_dpix
+set(INPUT_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/../../bench/ref/m35.pix")
+set(CONTROL_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35.dpix")
+set(TARGET_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35_pix.dpix")
+set(LOG_FILE "${CMAKE_CURRENT_BINARY_DIR}/pix_dpix.log")
+set(TARGET_NAME pix_dpix)
+BRLCAD_REGRESSION_TEST(regress-pix_dpix "pixcmp;icv" TEST_SCRIPT "${TEXPORT}"
EXEC icv)
+DISTCLEAN(${LOG_FILE} ${TARGET_IMAGE})
-
# Unpack compressed bw file and control
execute_process(COMMAND "${CMAKE_COMMAND}" -E tar xjf
"${CMAKE_CURRENT_SOURCE_DIR}/m35.bw.tbz2" WORKING_DIRECTORY
"${CMAKE_CURRENT_BINARY_DIR}")
execute_process(COMMAND "${CMAKE_COMMAND}" -E tar xjf
"${CMAKE_CURRENT_SOURCE_DIR}/m35_bw.pix.tbz2" WORKING_DIRECTORY
"${CMAKE_CURRENT_BINARY_DIR}")
@@ -109,33 +78,41 @@
DISTCLEAN("${CMAKE_CURRENT_BINARY_DIR}/m35.bw")
DISTCLEAN("${CMAKE_CURRENT_BINARY_DIR}/m35_bw.pix")
-Add_Image_Test(bw_pix IMPORT ""
- INPUT_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35.bw"
- CONTROL_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35_bw.pix"
- TARGET_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35_bw-out.pix"
- LOG_FILE "${CMAKE_CURRENT_BINARY_DIR}/bw_pix.log"
- )
+# bw_pix
+set(INPUT_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35.bw")
+set(CONTROL_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35_bw.pix")
+set(TARGET_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35_bw-out.pix")
+set(LOG_FILE "${CMAKE_CURRENT_BINARY_DIR}/bw_pix.log")
+set(TARGET_NAME bw_pix)
+BRLCAD_REGRESSION_TEST(regress-bw_pix "pixcmp;icv" TEST_SCRIPT "${TIMPORT}"
EXEC icv)
+DISTCLEAN(${LOG_FILE} ${TARGET_IMAGE})
-Add_Image_Test(pix_bw EXPORT ""
- INPUT_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/../../bench/ref/m35.pix"
- CONTROL_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35.bw"
- TARGET_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35_pix.bw"
- LOG_FILE "${CMAKE_CURRENT_BINARY_DIR}/pix_bw.log"
- )
+# pix_bw
+set(INPUT_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/../../bench/ref/m35.pix")
+set(CONTROL_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35.bw")
+set(TARGET_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35_pix.bw")
+set(LOG_FILE "${CMAKE_CURRENT_BINARY_DIR}/pix_bw.log")
+set(TARGET_NAME pix_bw)
+BRLCAD_REGRESSION_TEST(regress-pix_bw "pixcmp;icv" TEST_SCRIPT "${TEXPORT}"
EXEC icv)
+DISTCLEAN(${LOG_FILE} ${TARGET_IMAGE})
-Add_Image_Test(bw_png EXPORT ""
- INPUT_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35.bw"
- CONTROL_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/m35_bw.png"
- TARGET_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35_bw_png.png"
- LOG_FILE "${CMAKE_CURRENT_BINARY_DIR}/bw_png.log"
- )
+# bw_png
+set(INPUT_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35.bw")
+set(CONTROL_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/m35_bw.png")
+set(TARGET_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35_bw_png.png")
+set(LOG_FILE "${CMAKE_CURRENT_BINARY_DIR}/bw_png.log")
+set(TARGET_NAME bw_png)
+BRLCAD_REGRESSION_TEST(regress-bw_png "pixcmp;icv" TEST_SCRIPT "${TEXPORT}"
EXEC icv)
+DISTCLEAN(${LOG_FILE} ${TARGET_IMAGE})
-Add_Image_Test(png_bw EXPORT ""
- INPUT_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/m35_bw.png"
- CONTROL_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35.bw"
- TARGET_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35_png_bw.bw"
- LOG_FILE "${CMAKE_CURRENT_BINARY_DIR}/png_bw.log"
- )
+# png_bw
+set(INPUT_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/m35_bw.png")
+set(CONTROL_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35.bw")
+set(TARGET_IMAGE "${CMAKE_CURRENT_BINARY_DIR}/m35_png_bw.bw")
+set(LOG_FILE "${CMAKE_CURRENT_BINARY_DIR}/png_bw.log")
+set(TARGET_NAME png_bw)
+BRLCAD_REGRESSION_TEST(regress-png_bw "pixcmp;icv" TEST_SCRIPT "${TEXPORT}"
EXEC icv)
+DISTCLEAN(${LOG_FILE} ${TARGET_IMAGE})
CMAKEFILES(
CMakeLists.txt
Modified: brlcad/trunk/regress/icv/regress-icv_export.cmake.in
===================================================================
--- brlcad/trunk/regress/icv/regress-icv_export.cmake.in 2020-05-31
14:04:45 UTC (rev 75986)
+++ brlcad/trunk/regress/icv/regress-icv_export.cmake.in 2020-05-31
14:20:30 UTC (rev 75987)
@@ -1,69 +1,104 @@
+# Values set at CMake configure time
set(CBDIR "@CMAKE_CURRENT_BINARY_DIR@")
-set(SRCIMG "@INPUT_IMAGE@")
set(CTRLIMG "@CONTROL_IMAGE@")
-set(TGTIMG "@TARGET_IMAGE@")
set(LOGFILE "@LOG_FILE@")
+set(SRCIMG "@INPUT_IMAGE@")
set(TGT "@TARGET_NAME@")
+set(TGTIMG "@TARGET_IMAGE@")
-set(SBDIR "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@")
-set(DBDIR "@CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG@")
-set(RBDIR "@CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE@")
-# Use the mechanism created to allow multiconfig builds to
-# know what the current build type is.
-if(EXISTS "@CMAKE_BINARY_DIR@/CMakeTmp/CURRENT_PATH/Release")
- set(BDIR "${RBDIR}")
-elseif(EXISTS "@CMAKE_BINARY_DIR@/CMakeTmp/CURRENT_PATH/Debug")
- set(BDIR "${DBDIR}")
-else(EXISTS "@CMAKE_BINARY_DIR@/CMakeTmp/CURRENT_PATH/Release")
- set(BDIR "${SBDIR}")
-endif(EXISTS "@CMAKE_BINARY_DIR@/CMakeTmp/CURRENT_PATH/Release")
+file(WRITE "${LOGFILE}" "Starting icv_export run\n")
-get_filename_component(EXE "@CMAKE_COMMAND@" EXT)
-set(ICV "${BDIR}/icv${EXE}")
-set(PIXCMP "${BDIR}/pixcmp${EXE}")
+# The executable locations aren't know at CMake configure time, so one of them
+# is passed in via the EXEC variable at runtime. De-quote it and assign it to
+# the appropriate variable.
+string(REPLACE "\\" "" ICV_EXEC "${EXEC}")
+if (NOT EXISTS "${ICV_EXEC}")
+ file(WRITE "${LOGFILE}" "icv not found at location \"${ICV_EXEC}\" -
aborting\n")
+ message(FATAL_ERROR "Unable to find icv, aborting.\nSee ${LOGFILE} for more
details.")
+endif (NOT EXISTS "${ICV_EXEC}")
-# Start with the file using standard UNIX line endings
-file(APPEND "${LOGFILE}" "Converting ${SRCIMG} to ${TGTIMG}:\n")
+# Apparently CMAKE_EXECUTABLE_SUFFIX is not reliably defined in cmake -P - get
+# it from the executable passed in to us.
+get_filename_component(EXE_SUFFIX "${ICV_EXEC}" EXT)
+
+# Use the path passed in from the build target generator expression
+# to ascertain the current binary directory in use, and locate any
+# other necessary programs.
+get_filename_component(BDIR "${ICV_EXEC}" DIRECTORY)
+set(PIXCMP_EXEC "${BDIR}/pixcmp${EXE_SUFFIX}")
+if (NOT EXISTS "${PIXCMP_EXEC}")
+ file(WRITE "${LOGFILE}" "pixcmp not found at location \"${PIXCMP_EXEC}\" -
aborting\n")
+ message(FATAL_ERROR "Unable to find pixcmp, aborting.\nSee ${LOGFILE} for
more details.")
+endif (NOT EXISTS "${PIXCMP_EXEC}")
+
+# Clean up in case we've run before unsuccessfully
+set(OUTPUT_FILES
+ ${TGTIMG}
+ ${CBDIR}/${TGT}-ctrl.pix
+ ${CBDIR}/${TGT}-out.pix
+ )
+foreach(of ${OUTPUT_FILES})
+ execute_process(COMMAND "@CMAKE_COMMAND@" -E remove -f "${of}")
+endforeach(of ${OUTPUT_FILES})
+
+
+# Perform the ICV conversion
+file(APPEND "${LOGFILE}" "Converting ${SRCIMG} to ${TGTIMG}\n")
execute_process(
- COMMAND "${ICV}" "${SRCIMG}" "${TGTIMG}"
- OUTPUT_VARIABLE icv_log ERROR_VARIABLE icv_log
+ COMMAND "${ICV_EXEC}" "${SRCIMG}" "${TGTIMG}"
+ RESULT_VARIABLE icv_result OUTPUT_VARIABLE icv_log ERROR_VARIABLE icv_log
)
file(APPEND "${LOGFILE}" "${icv_log}")
set(icv_log)
if(NOT EXISTS "${TGTIMG}")
- message(FATAL_ERROR "Unable to convert ${SRCIMG} to ${TGTIMG} with ${ICV},
aborting.\nSee ${LOGFILE} for more details.")
+ file(APPEND "${LOGFILE}" "Failure: ${icv_result}")
+ message(FATAL_ERROR "Unable to convert ${SRCIMG} to ${TGTIMG} with
${ICV_EXEC}, aborting.\nSee ${LOGFILE} for more details.")
endif(NOT EXISTS "${TGTIMG}")
+
# Because we are exporting, we need to convert both the control image
# and the target image to PIX format for pixcmp to do its check.
+file(APPEND "${LOGFILE}" "Converting ${CTRLIMG} to ${CBDIR}/${TGT}-ctrl.pix\n")
execute_process(
- COMMAND "${ICV}" "${CTRLIMG}" "${CMAKE_CURRENT_BINARY_DIR}/${TGT}-ctrl.pix"
- OUTPUT_VARIABLE icv_log ERROR_VARIABLE icv_log
+ COMMAND "${ICV_EXEC}" "${CTRLIMG}" "${CBDIR}/${TGT}-ctrl.pix"
+ RESULT_VARIABLE icv_result OUTPUT_VARIABLE icv_log ERROR_VARIABLE icv_log
)
file(APPEND "${LOGFILE}" "${icv_log}")
set(icv_log)
+if(NOT EXISTS "${CBDIR}/${TGT}-ctrl.pix")
+ file(APPEND "${LOGFILE}" "Failure: ${icv_result}")
+ message(FATAL_ERROR "Unable to convert ${SRCIMG} to ${CBDIR}/${TGT}-ctrl.pix
with ${ICV_EXEC}, aborting.\nSee ${LOGFILE} for more details.")
+endif(NOT EXISTS "${CBDIR}/${TGT}-ctrl.pix")
+
+file(APPEND "${LOGFILE}" "Converting ${TGTIMG} to ${CBDIR}/${TGT}-out.pix\n")
execute_process(
- COMMAND "${ICV}" "${TGTIMG}" "${CMAKE_CURRENT_BINARY_DIR}/${TGT}-out.pix"
- OUTPUT_VARIABLE icv_log ERROR_VARIABLE icv_log
+ COMMAND "${ICV_EXEC}" "${TGTIMG}" "${CBDIR}/${TGT}-out.pix"
+ RESULT_VARIABLE icv_result OUTPUT_VARIABLE icv_log ERROR_VARIABLE icv_log
)
file(APPEND "${LOGFILE}" "${icv_log}")
set(icv_log)
+if(NOT EXISTS "${CBDIR}/${TGT}-out.pix")
+ file(APPEND "${LOGFILE}" "Failure: ${icv_result}")
+ message(FATAL_ERROR "Unable to convert ${TGTIMG} to ${CBDIR}/${TGT}-out.pix
with ${ICV_EXEC}, aborting.\nSee ${LOGFILE} for more details.")
+endif(NOT EXISTS "${CBDIR}/${TGT}-out.pix")
+
# pixcmp the results with the control image to make sure icv got it right
-file(APPEND "${LOGFILE}" "\nComparing
${CMAKE_CURRENT_BINARY_DIR}/${TGT}-ctrl.pix to
${CMAKE_CURRENT_BINARY_DIR}/${TGT}-out.pix:\n")
+file(APPEND "${LOGFILE}" "\nComparing ${CBDIR}/${TGT}-ctrl.pix to
${CBDIR}/${TGT}-out.pix:\n")
execute_process(
- COMMAND "${PIXCMP}" "${CMAKE_CURRENT_BINARY_DIR}/${TGT}-ctrl.pix"
"${CMAKE_CURRENT_BINARY_DIR}/${TGT}-out.pix"
+ COMMAND "${PIXCMP_EXEC}" "${CMAKE_CURRENT_BINARY_DIR}/${TGT}-ctrl.pix"
"${CMAKE_CURRENT_BINARY_DIR}/${TGT}-out.pix"
RESULT_VARIABLE pixcmp_val OUTPUT_VARIABLE icv_log ERROR_VARIABLE icv_log
)
file(APPEND "${LOGFILE}" "${icv_log}")
+# Final success/failure check
if(${pixcmp_val} GREATER 0)
- message(FATAL_ERROR "Differences found between
${CMAKE_CURRENT_BINARY_DIR}/${TGT}-ctrl.pix and
${CMAKE_CURRENT_BINARY_DIR}/${TGT}-out.pix with ${PIXCMP}, aborting.\nSee
${LOGFILE} for more details.")
+ file(APPEND "${LOGFILE}" "Failure: ${pixcmp_val}")
+ message(FATAL_ERROR "Differences found between ${CBDIR}/${TGT}-ctrl.pix and
${CBDIR}/${TGT}-out.pix with ${PIXCMP}, aborting.\nSee ${LOGFILE} for more
details.")
else(${pixcmp_val} GREATER 0)
- execute_process(COMMAND "@CMAKE_COMMAND@" -E remove ${TGTIMG})
- execute_process(COMMAND "@CMAKE_COMMAND@" -E remove
${CMAKE_CURRENT_BINARY_DIR}/${TGT}-ctrl.pix)
- execute_process(COMMAND "@CMAKE_COMMAND@" -E remove
${CMAKE_CURRENT_BINARY_DIR}/${TGT}-out.pix)
- execute_process(COMMAND "@CMAKE_COMMAND@" -E touch "@STAMP_FILE@")
+ foreach(of ${OUTPUT_FILES})
+ execute_process(COMMAND "@CMAKE_COMMAND@" -E remove -f "${of}")
+ endforeach(of ${OUTPUT_FILES})
endif(${pixcmp_val} GREATER 0)
# Local Variables:
Modified: brlcad/trunk/regress/icv/regress-icv_import.cmake.in
===================================================================
--- brlcad/trunk/regress/icv/regress-icv_import.cmake.in 2020-05-31
14:04:45 UTC (rev 75986)
+++ brlcad/trunk/regress/icv/regress-icv_import.cmake.in 2020-05-31
14:20:30 UTC (rev 75987)
@@ -1,51 +1,65 @@
+# Values set at CMake configure time
set(CBDIR "@CMAKE_CURRENT_BINARY_DIR@")
+set(CTRLIMG "@CONTROL_IMAGE@")
+set(LOGFILE "@LOG_FILE@")
set(SRCIMG "@INPUT_IMAGE@")
-set(CTRLIMG "@CONTROL_IMAGE@")
set(TGTIMG "@TARGET_IMAGE@")
-set(LOGFILE "@LOG_FILE@")
-set(SBDIR "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@")
-set(DBDIR "@CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG@")
-set(RBDIR "@CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE@")
-# Use the mechanism created to allow multiconfig builds to
-# know what the current build type is.
-if(EXISTS "@CMAKE_BINARY_DIR@/CMakeTmp/CURRENT_PATH/Release")
- set(BDIR "${RBDIR}")
-elseif(EXISTS "@CMAKE_BINARY_DIR@/CMakeTmp/CURRENT_PATH/Debug")
- set(BDIR "${DBDIR}")
-else(EXISTS "@CMAKE_BINARY_DIR@/CMakeTmp/CURRENT_PATH/Release")
- set(BDIR "${SBDIR}")
-endif(EXISTS "@CMAKE_BINARY_DIR@/CMakeTmp/CURRENT_PATH/Release")
+file(WRITE "${LOGFILE}" "Starting icv_import run\n")
-get_filename_component(EXE "@CMAKE_COMMAND@" EXT)
-set(ICV "${BDIR}/icv${EXE}")
-set(PIXCMP "${BDIR}/pixcmp${EXE}")
+# The executable locations aren't know at CMake configure time, so one of them
+# is passed in via the EXEC variable at runtime. De-quote it and assign it to
+# the appropriate variable.
+string(REPLACE "\\" "" ICV_EXEC "${EXEC}")
+if (NOT EXISTS "${ICV_EXEC}")
+ file(WRITE "${LOGFILE}" "icv not found at location \"${ICV_EXEC}\" -
aborting\n")
+ message(FATAL_ERROR "Unable to find icv, aborting.\nSee ${LOGFILE} for more
details.")
+endif (NOT EXISTS "${ICV_EXEC}")
-# Start with the file using standard UNIX line endings
-file(APPEND "${LOGFILE}" "Converting ${SRCIMG} to ${TGTIMG}:\n")
+# Apparently CMAKE_EXECUTABLE_SUFFIX is not reliably defined in cmake -P - get
+# it from the executable passed in to us.
+get_filename_component(EXE_SUFFIX "${ICV_EXEC}" EXT)
+
+# Use the path passed in from the build target generator expression
+# to ascertain the current binary directory in use, and locate any
+# other necessary programs.
+get_filename_component(BDIR "${ICV_EXEC}" DIRECTORY)
+set(PIXCMP_EXEC "${BDIR}/pixcmp${EXE_SUFFIX}")
+if (NOT EXISTS "${PIXCMP_EXEC}")
+ file(WRITE "${LOGFILE}" "pixcmp not found at location \"${PIXCMP_EXEC}\" -
aborting\n")
+ message(FATAL_ERROR "Unable to find pixcmp, aborting.\nSee ${LOGFILE} for
more details.")
+endif (NOT EXISTS "${PIXCMP_EXEC}")
+
+# Clean up in case we've run before unsuccessfully
+execute_process(COMMAND "@CMAKE_COMMAND@" -E remove -f "${TGTIMG}")
+
+# Perform the ICV conversion
+file(APPEND "${LOGFILE}" "Converting ${SRCIMG} to ${TGTIMG}\n")
execute_process(
- COMMAND "${ICV}" "${SRCIMG}" "${TGTIMG}"
- OUTPUT_VARIABLE icv_log ERROR_VARIABLE icv_log
+ COMMAND "${ICV_EXEC}" "${SRCIMG}" "${TGTIMG}"
+ RESULT_VARIABLE icv_result OUTPUT_VARIABLE icv_log ERROR_VARIABLE icv_log
)
file(APPEND "${LOGFILE}" "${icv_log}")
set(icv_log)
if(NOT EXISTS "${TGTIMG}")
- message(FATAL_ERROR "Unable to convert ${SRCIMG} to ${TGTIMG} with ${ICV},
aborting.\nSee ${LOGFILE} for more details.")
+ file(APPEND "${LOGFILE}" "Failure: ${icv_result}")
+ message(FATAL_ERROR "Unable to convert ${SRCIMG} to ${TGTIMG} with
${ICV_EXEC}, aborting.\nSee ${LOGFILE} for more details.")
endif(NOT EXISTS "${TGTIMG}")
# pixcmp the results with the control image to make sure icv got it right
-file(APPEND "${LOGFILE}" "\nComparing ${TGTIMG} to ${CTRLIMG}:\n")
+file(APPEND "${LOGFILE}" "\nComparing ${TGTIMG} to ${CTRLIMG}\n")
execute_process(
- COMMAND "${PIXCMP}" "${TGTIMG}" "${CTRLIMG}"
+ COMMAND "${PIXCMP_EXEC}" "${TGTIMG}" "${CTRLIMG}"
RESULT_VARIABLE pixcmp_val OUTPUT_VARIABLE icv_log ERROR_VARIABLE icv_log
)
file(APPEND "${LOGFILE}" "${icv_log}")
+# Final success/failure check
if(${pixcmp_val} GREATER 0)
- message(FATAL_ERROR "Differences found between ${TGTIMG} and ${CTRLIMG} with
${PIXCMP}, aborting.\nSee ${LOGFILE} for more details.")
+ file(APPEND "${LOGFILE}" "Failure: ${pixcmp_val}")
+ message(FATAL_ERROR "Differences found between ${TGTIMG} and ${CTRLIMG} with
${PIXCMP_EXEC}, aborting.\nSee ${LOGFILE} for more details.")
else(${pixcmp_val} GREATER 0)
- execute_process(COMMAND "@CMAKE_COMMAND@" -E remove ${TGTIMG})
- execute_process(COMMAND "@CMAKE_COMMAND@" -E touch "@STAMP_FILE@")
+ execute_process(COMMAND "@CMAKE_COMMAND@" -E remove -f ${TGTIMG})
endif(${pixcmp_val} GREATER 0)
# Local Variables:
Modified: brlcad/trunk/regress/licenses/CMakeLists.txt
===================================================================
--- brlcad/trunk/regress/licenses/CMakeLists.txt 2020-05-31 14:04:45 UTC
(rev 75986)
+++ brlcad/trunk/regress/licenses/CMakeLists.txt 2020-05-31 14:20:30 UTC
(rev 75987)
@@ -3,7 +3,8 @@
${BRLCAD_SOURCE_DIR}/include
)
-add_executable(lcheck licenses_check.cpp)
+# Build a scanner to read license information and introspect the source tree
+BRLCAD_ADDEXEC(lcheck licenses_check.cpp "" TEST)
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.
@@ -21,27 +22,16 @@
endforeach(lfile ${ELEGAL})
DISTCLEAN("${LICENSE_LIST}")
+# Define the actual regression test
set(ALL_FILES_LIST "${BRLCAD_BINARY_DIR}/cmakefiles.cmake")
+set(LOG_FILE "${CMAKE_CURRENT_BINARY_DIR}/regress-licenses.log")
+BRLCAD_REGRESSION_TEST(regress-licenses "lcheck" EXEC lcheck)
+DISTCLEAN(${LOG_FILE})
-add_test(NAME regress-licenses
- COMMAND "${CMAKE_COMMAND}"
- -DLCHECK_EXEC=$<TARGET_FILE:lcheck>
-DBRLCAD_SOURCE_DIR=${BRLCAD_SOURCE_DIR}
- -DL_LIST=${LICENSE_LIST} -DF_LIST=${ALL_FILES_LIST}
- -P "${CMAKE_CURRENT_SOURCE_DIR}/regress-licenses.cmake"
- )
-
-if (CMAKE_CONFIGURATION_TYPES)
- add_custom_target(regress-licenses COMMAND ${CMAKE_CTEST_COMMAND} -C
${CMAKE_CFG_INTDIR} -R ^regress-licenses --output-on-failure)
@@ Diff output truncated at 100000 characters. @@
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