fix the use of imagemagick convert during cross-built tests.

master
Don Bright 2014-03-29 13:14:41 -05:00
parent 93eb89c00b
commit 90c549ad0a
4 changed files with 33 additions and 7 deletions

View File

@ -469,7 +469,10 @@ if [ $BUILD_TESTS ]; then
# fixme .. parse CTestTestfiles to find linux+convert python strings
# or have CMake itself dump them during it's cross build cmake call
echo "linux_python='"`which python`"'" >> mingw_cross_info.py
echo "linux_convert='"`which convert`"'" >> mingw_cross_info.py
# note- this has to match the CMakeLists.txt line that sets the
# convert executable... and CMingw-cross-env.cmake's skip-imagemagick
# setting. what a kludge!
echo "linux_convert='/bin/echo'" >> mingw_cross_info.py
echo "win_installdir='OpenSCAD_Tests_"$VERSIONDATE"'" >> mingw_cross_info.py
# Test binaries can be hundreds of megabytes due to debugging info.

View File

@ -433,9 +433,8 @@ inclusion(GLIB2_DIR GLIB2_INCLUDE_DIRS)
# Imagemagick
if (SKIP_IMAGEMAGICK)
if (NOT MINGW_CROSS_ENV_DIR)
set(ImageMagick_convert_EXECUTABLE "echo")
endif()
# cross-building depends on this
set(ImageMagick_convert_EXECUTABLE "/bin/echo")
else()
find_package(ImageMagick COMPONENTS convert)
if (ImageMagick_convert_FOUND)

View File

@ -31,7 +31,7 @@
# Note that under 'cmake', Windows(TM) paths use / instead of \ as a
# folder separator.
# mingw_cross_info.py is created during the the scripts/release-common.sh build
# mingw_cross_info.py is created by scripts/release-common.sh during build
# of the regression test package. it contains info regarding paths in
# CTestTestfiles.cmake that we need to modify
import mingw_cross_info
@ -90,6 +90,27 @@ winexamples=winbase+'/tests/../examples'
if '--debug' in string.join(sys.argv): _debug=True
if '--undo' in string.join(sys.argv): _undo=True
if _debug:
print thisfile_abspath
print 'linbase',linbase
print 'winbase',winbase
print 'linbuild',linbuild
print 'winbuild',winbuild
print 'lintct',lintct
print 'wintct',wintct
print 'linpy',linpy
print 'winpy',winpy
print 'linosng',linosng
print 'winosng',winosng
print 'linconv',linconv
print 'winconv',winconv
print 'linoslib',linoslib
print 'winoslib',winoslib
print 'lintestdata',lintestdata
print 'wintestdata',wintestdata
print 'linexamples',linexamples
print 'winexamples',winexamples
def processfile(infilename):
backup_filename = infilename+'.backup'
if _undo:
@ -125,7 +146,7 @@ def processfile(infilename):
line=line.replace('\\','/')
# Fixme - how do we escape spaces in cmake?
line=line.replace('Program Files','Progra~1')
#line=line.replace('Program Files','Progra~1')
debug('output:',line)

View File

@ -191,7 +191,7 @@ def usage():
if __name__ == '__main__':
# Handle command-line arguments
try:
opts, args = getopt.getopt(sys.argv[1:], "gs:e:c:t:f:m:x", ["generate", "convexec=", "suffix=", "expected_dir=", "test=", "file=", "comparator="])
opts, args = getopt.getopt(sys.argv[1:], "gs:e:c:t:f:m", ["generate", "convexec=", "suffix=", "expected_dir=", "test=", "file=", "comparator="])
except getopt.GetoptError, err:
usage()
sys.exit(2)
@ -229,7 +229,10 @@ if __name__ == '__main__':
if len(args) == 2:
basename = os.path.splitext(args[1])[0]
path, options.filename = os.path.split(basename)
print >> sys.stderr, basename
print >> sys.stderr, path, options.filename
print >> sys.stderr, options.filename
if not hasattr(options, "filename"):
print >> sys.stderr, "Filename cannot be deducted from arguments. Specify test filename using the -f option"
sys.exit(2)