Skip to content
Permalink
Browse files

Create Separate CTest tests for each prebuilt and example pipeline (#903

)

* Separate each Prebuilt Pipeline into an individual CTest

Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>

* Enable both Visual Studio and Ninja Unit Tests
  • Loading branch information...
imikejackson committed May 14, 2019
1 parent 1d76aad commit 83b4201a9d49b81a1fa9cf6e6efbfd6ce319abe4
@@ -92,12 +92,16 @@
},
"6": {
"Delimiter": 0,
"FileExtension": ".csv",
"FilterVersion": "1.0.953",
"FileExtension": ".txt",
"FilterVersion": "1.2.758",
"Filter_Enabled": true,
"Filter_Human_Label": "Export ASCII Data",
"Filter_Name": "WriteASCIIData",
"Filter_Uuid": "{5fbf9204-2c6c-597b-856a-f4612adbac38}",
"MaxValPerLine": 1,
"OutputPath": "Data/Output/Histograms",
"OutputFilePath": "Data/Output/Histograms/Data.csv",
"OutputPath": "",
"OutputStyle": 1,
"SelectedDataArrayPaths": [
{
"Attribute Matrix Name": "Histograms",
@@ -324,10 +324,10 @@
"Filter_Human_Label": "Export ASCII Data",
"Filter_Name": "WriteASCIIData",
"Filter_Uuid": "{5fbf9204-2c6c-597b-856a-f4612adbac38}",
"MaxValPerLine": -1,
"MaxValPerLine": 1,
"OutputFilePath": "Data/Output/INL_Example/Data.csv",
"OutputPath": "",
"OutputType": 1,
"OutputStyle": 1,
"SelectedDataArrayPaths": [
{
"Attribute Matrix Name": "EBSD Scan Data",
@@ -30,11 +30,15 @@
"2": {
"Delimiter": 0,
"FileExtension": ".csv",
"FilterVersion": "1.0.953",
"FilterVersion": "1.2.758",
"Filter_Enabled": true,
"Filter_Human_Label": "Export ASCII Data",
"Filter_Name": "WriteASCIIData",
"Filter_Uuid": "{5fbf9204-2c6c-597b-856a-f4612adbac38}",
"MaxValPerLine": 1,
"OutputPath": "Data/Output/Histograms",
"OutputFilePath": "Data/Output/Histograms/Image_Histogram.csv",
"OutputPath": "",
"OutputStyle": 1,
"SelectedDataArrayPaths": [
{
"Attribute Matrix Name": "HistogramAttributeMatrix",
@@ -56,61 +56,93 @@ set(TEST_PIPELINE_LIST_FILE ${DREAM3DTest_BINARY_DIR}/PipelineRunnerTest.txt)
set(TEST_DATA_DIR ${DREAM3D_DATA_DIR})

set(PREBUILT_PIPELINE_NAMES
"EBSD Reconstruction/(01) SmallIN100 Archive"
"EBSD Reconstruction/(02) SmallIN100 Initial Visualization"
"EBSD Reconstruction/(03) SmallIN100 Alignment"
"EBSD Reconstruction/(04) SmallIN100 Presegmentation Processing"
"EBSD Reconstruction/(05) SmallIN100 Segmentation"
"EBSD Reconstruction/(06) SmallIN100 Postsegmentation Processing"
"EBSD Reconstruction/(07) SmallIN100 Final Processing"
"EBSD Reconstruction/(08) SmallIN100 Full Reconstruction"
"EBSD Statistics/(01) SmallIN100 Morphological Statistics"
"EBSD Statistics/(02) SmallIN100 Export Statistics"
"EBSD Statistics/(03) SmallIN100 Transfer Field Data"
"EBSD Statistics/(04) SmallIN100 Field Threshold"
"EBSD Statistics/(05) SmallIN100 Crystallographic Statistics"
"EBSD SurfaceMeshing/(01) SmallIN100 Quick Mesh"
"EBSD SurfaceMeshing/(02) SmallIN100 Smooth Mesh"
"EBSD SurfaceMeshing/(03) SmallIN100 Mesh Statistics"
"EBSD SurfaceMeshing/(04) SmallIN100 GBCD"
"Synthetic/(01) Single Cubic Phase Equiaxed"
"Synthetic/(02) Single Hexagonal Phase Equiaxed"
"Synthetic/(03) Single Cubic Phase Rolled"
"Synthetic/(04) Two Phase Cubic Hexagonal Particles Equiaxed"
"Synthetic/(05) Composite"
"Synthetic/(06) SmallIN100 Synthetic"
"PrebuiltPipelines/Workshop/EBSD Reconstruction/(01) SmallIN100 Archive"
"PrebuiltPipelines/Workshop/EBSD Reconstruction/(02) SmallIN100 Initial Visualization"
"PrebuiltPipelines/Workshop/EBSD Reconstruction/(03) SmallIN100 Alignment"
"PrebuiltPipelines/Workshop/EBSD Reconstruction/(04) SmallIN100 Presegmentation Processing"
"PrebuiltPipelines/Workshop/EBSD Reconstruction/(05) SmallIN100 Segmentation"
"PrebuiltPipelines/Workshop/EBSD Reconstruction/(06) SmallIN100 Postsegmentation Processing"
"PrebuiltPipelines/Workshop/EBSD Reconstruction/(07) SmallIN100 Final Processing"
"PrebuiltPipelines/Workshop/EBSD Reconstruction/(08) SmallIN100 Full Reconstruction"
"PrebuiltPipelines/Workshop/EBSD Statistics/(01) SmallIN100 Morphological Statistics"
"PrebuiltPipelines/Workshop/EBSD Statistics/(02) SmallIN100 Export Statistics"
"PrebuiltPipelines/Workshop/EBSD Statistics/(03) SmallIN100 Transfer Field Data"
"PrebuiltPipelines/Workshop/EBSD Statistics/(04) SmallIN100 Field Threshold"
"PrebuiltPipelines/Workshop/EBSD Statistics/(05) SmallIN100 Crystallographic Statistics"
"PrebuiltPipelines/Workshop/EBSD SurfaceMeshing/(01) SmallIN100 Quick Mesh"
"PrebuiltPipelines/Workshop/EBSD SurfaceMeshing/(02) SmallIN100 Smooth Mesh"
"PrebuiltPipelines/Workshop/EBSD SurfaceMeshing/(03) SmallIN100 Mesh Statistics"
"PrebuiltPipelines/Workshop/EBSD SurfaceMeshing/(04) SmallIN100 GBCD"
"PrebuiltPipelines/Workshop/Synthetic/(01) Single Cubic Phase Equiaxed"
"PrebuiltPipelines/Workshop/Synthetic/(02) Single Hexagonal Phase Equiaxed"
"PrebuiltPipelines/Workshop/Synthetic/(03) Single Cubic Phase Rolled"
"PrebuiltPipelines/Workshop/Synthetic/(04) Two Phase Cubic Hexagonal Particles Equiaxed"
"PrebuiltPipelines/Workshop/Synthetic/(05) Composite"
"PrebuiltPipelines/Workshop/Synthetic/(06) SmallIN100 Synthetic"

"PrebuiltPipelines/Examples/ASTMD638_specimen"
"PrebuiltPipelines/Examples/CreateLambertSphereSurface"
"PrebuiltPipelines/Examples/Edax_IPF_Colors"
"PrebuiltPipelines/Examples/INL_Export"
"PrebuiltPipelines/Examples/Import_ASCI"
"PrebuiltPipelines/Examples/StatsGenOdfData"
"PrebuiltPipelines/Examples/TxCopper_Exposed"
"PrebuiltPipelines/Examples/CI_Histogram"
"PrebuiltPipelines/Examples/Cylinder_Synthetic"
"PrebuiltPipelines/Examples/ExtractVertexGeometry"
"PrebuiltPipelines/Examples/Image_Histogram"
"PrebuiltPipelines/Examples/Misc_Filters"
"PrebuiltPipelines/Examples/Threshold2_MoveData"
"PrebuiltPipelines/Examples/TxCopper_Unexposed"
)

if(SIMPL_USE_ITK)
set(PREBUILT_PIPELINE_NAMES
${PREBUILT_PIPELINE_NAMES}
"Image Reconstruction/(01) Image Initial Visualization"
"Image Reconstruction/(02) Image Segmentation"
"PrebuiltPipelines/Workshop/Image Reconstruction/(01) Image Initial Visualization"
"PrebuiltPipelines/Workshop/Image Reconstruction/(02) Image Segmentation"
)
endif()


configure_file(${DREAM3DTest_SOURCE_DIR}/PipelineRunnerTest.h.in
${DREAM3DTest_BINARY_DIR}/PipelineRunnerTest.h)
# configure_file(${DREAM3DTest_SOURCE_DIR}/PipelineRunnerTest.h.in
# ${DREAM3DTest_BINARY_DIR}/PipelineRunnerTest.h)

add_executable(PipelineRunnerTest
${DREAM3DTest_SOURCE_DIR}/PipelineRunnerTest.cpp ${DREAM3DTest_BINARY_DIR}/PipelineRunnerTest.h)
target_include_directories(PipelineRunnerTest
PUBLIC
${DREAM3DTest_BINARY_DIR}
${SIMPLProj_SOURCE_DIR}/Source
${SIMPLProj_BINARY_DIR})
target_link_libraries(PipelineRunnerTest Qt5::Core EbsdLib SIMPLib)
set_target_properties(PipelineRunnerTest PROPERTIES FOLDER "DREAM3D UnitTests")
add_test(NAME PipelineRunnerTest
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/PipelineRunnerTest
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
# add_executable(PipelineRunnerTest
# ${DREAM3DTest_SOURCE_DIR}/PipelineRunnerTest.cpp ${DREAM3DTest_BINARY_DIR}/PipelineRunnerTest.h)
# target_include_directories(PipelineRunnerTest
# PUBLIC
# ${DREAM3DTest_BINARY_DIR}
# ${SIMPLProj_SOURCE_DIR}/Source
# ${SIMPLProj_BINARY_DIR})
# target_link_libraries(PipelineRunnerTest Qt5::Core EbsdLib SIMPLib)
# set_target_properties(PipelineRunnerTest PROPERTIES FOLDER "DREAM3D UnitTests")
# add_test(NAME PipelineRunnerTest
# COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/PipelineRunnerTest
# WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

FILE(WRITE ${TEST_PIPELINE_LIST_FILE} )

foreach(f ${PREBUILT_PIPELINE_NAMES} )
set(DREAM3D_PIPELINE_FILE "${DREAM3D_SUPPORT_DIR}/${PREBUILT_PIPELINES_DIR}/${f}.json")

set(TEST_SCRIPT_FILE_EXT "sh")
set(EXE_EXT "")
if(WIN32)
set(TEST_SCRIPT_FILE_EXT "bat")
set(EXE_EXT ".exe")
endif()

set(test_index "0")
foreach(test ${PREBUILT_PIPELINE_NAMES} )
set(DREAM3D_PIPELINE_FILE "${DREAM3D_SUPPORT_DIR}/${PREBUILT_PIPELINES_DIR}/${test}.json")
FILE(APPEND ${TEST_PIPELINE_LIST_FILE} "${DREAM3D_PIPELINE_FILE}\n")

#----------------
set(SIMPL_CTEST_TEST_DRIVER "${DREAM3DTest_BINARY_DIR}/PrebuiltPipelineTests/${test}.${TEST_SCRIPT_FILE_EXT}")
configure_file(${DREAM3DTest_SOURCE_DIR}/ctest_pipeline_driver.${TEST_SCRIPT_FILE_EXT} "${SIMPL_CTEST_TEST_DRIVER}" @ONLY)

string(REPLACE "/" "_" test "${test}")
math(EXPR test_index "${test_index} + 1")
add_test(NAME D3D_Prebuilt_${test_index} COMMAND "${SIMPL_CTEST_TEST_DRIVER}" )
endforeach()

# Some more Testing Only pipelines that can be put here
@@ -0,0 +1,42 @@

@echo off
:: Check to see if we were built using the Visual Studio generators, if so
:: then we need an additional argument to tell this script which configuration
:: directory to use as the source for the compiled files.
:: set CONFIG_DIR=%CMAKE_CONFIG_TYPE%
IF "@MSVC_IDE@" == "1" (
set CONFIG_DIR=%CMAKE_CONFIG_TYPE%
) else (
set CONFIG_DIR=
)

::-----------------------------------------------------------------------------
IF "%CMAKE_CONFIG_TYPE%" == "Debug" (
set EXE_SFX="_debug"
)

::-----------------------------------------------------------------------------
IF "%CMAKE_CONFIG_TYPE%" == "Release" (
set EXE_SFX=""
)

::-----------------------------------------------------------------------------
IF "@CMAKE_BUILD_TYPE@" == "Debug" (
set CONFIG_DIR=
set EXE_SFX="_debug"
)

::-----------------------------------------------------------------------------
IF "@CMAKE_BUILD_TYPE@" == "Release" (
set CONFIG_DIR=
set EXE_SFX=""
)

echo on
@echo "[@test@.json] Prebuilt Pipeline Test Starting"

@echo "Running Executable at @CMAKE_RUNTIME_OUTPUT_DIRECTORY@\%CONFIG_DIR%\PipelineRunner%EXE_SFX%@EXE_EXT@"

cd @CMAKE_RUNTIME_OUTPUT_DIRECTORY@\%CONFIG_DIR%

PipelineRunner%EXE_SFX%@EXE_EXT@ --pipeline "@DREAM3D_SUPPORT_DIR@/@test@.json"
@@ -0,0 +1,18 @@
#!/bin/bash

#set -e

echo "[@test@.json] Prebuilt Pipeline Test Starting"

cd "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@"
"./PipelineRunner@EXE_EXT@" --pipeline "@DREAM3D_SUPPORT_DIR@/@test@.json"

if [ $? -eq 0 ]
then
echo "[@test@] Success"
exit 0
else
echo "[@test@] Failure" >&2
exit 1
fi

0 comments on commit 83b4201

Please sign in to comment.
You can’t perform that action at this time.