Commit 610bd74b authored by John Tourtellott's avatar John Tourtellott
Browse files

Add powershell script for windows package tests

parent de44cf98
Pipeline #210028 waiting for manual action with stages
......@@ -38,8 +38,6 @@ if ("$ENV{CI_JOB_NAME}" MATCHES "windows")
"displayAuxiliaryGeometry"
# Rendering changes.
"displayModelToMesh-simple"
# Todo script for windows still todo
"^package-import-test"
# EGL context creation fails.
"^pv\\."
# Unknown SEGFAULT.
......
......@@ -51,30 +51,31 @@ function (add_package_import_test generator)
set(extract_dir "${modelbuilder_extract_root}/modelbuilder-${generator}/test-extracted")
set(this_dir "${CMAKE_SOURCE_DIR}/cmake")
# Current implementation only supports linux
if (UNIX AND NOT CYGWIN)
set(exe_path "bin/modelbuilder")
set(shell_script "import_python_test.sh")
set(exe_path "bin/modelbuilder")
if (APPLE)
set(exe_path "modelbuilder.app/Contents/MacOS/modelbuilder")
endif ()
if (APPLE)
set(exe_path "modelbuilder.app/Contents/MacOS/modelbuilder")
endif ()
if (WIN32)
set(shell_script "import_python_test.ps1")
else ()
set(shell_script "import_python_test.sh")
endif ()
add_test(
NAME "package-import-test-${generator}"
COMMAND "${this_dir}/scripts/${shell_script}"
"${extract_dir}/${exe_path}"
"-dr"
"--data-directory=${this_dir}/scripts"
"--test-directory=${CMAKE_BINARY_DIR}/Testing/Temporary"
"--test-script=${this_dir}/scripts/import_minimum_operation.xml"
"--exit"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/Testing/Temporary"
)
add_test(
NAME "package-import-test-${generator}"
COMMAND "${this_dir}/scripts/${shell_script}"
"${extract_dir}/${exe_path}"
"-dr"
"--data-directory=${this_dir}/scripts"
"--test-directory=${CMAKE_BINARY_DIR}/Testing/Temporary"
"--test-script=${this_dir}/scripts/import_minimum_operation.xml"
"--exit"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/Testing/Temporary"
)
set_tests_properties("package-import-test-${generator}"
PROPERTIES
${ARGN}
)
endif ()
set_tests_properties("package-import-test-${generator}"
PROPERTIES
${ARGN}
)
endfunction ()
# Script for running import-python test
# - The full set of input arguments are the
# command + arguments to run modelbuilder.
# - The commands are expected to create a file
# minimum_operation.txt in the working directory
# Remove expected file from the working directory
Set-Variable -Name filename -Value "minimum_operation.txt"
Remove-Item -Force ${filename}
# Run the input arguments, which should constitute a
# modelbuilder command that runs an xml script and exits.
$args
# Check for the expected file in the working directory
if ( Test-Path ${filename} -PathType Leaf)
{
exit 0
}
Write-Host "ERROR: File ${filename} NOT found"
exit 1
......@@ -6,7 +6,7 @@
# - The commands are expected to create a file
# minimum_operation.txt in the working directory
# Remove expected from from the working directory
# Remove expected file from the working directory
filename=minimum_operation.txt
rm -f ${filename}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment