From e437182c095d5af0f4ab930c738cbd6ea026ad50 Mon Sep 17 00:00:00 2001 From: Don Bright Date: Tue, 3 Jan 2012 12:27:03 -0600 Subject: add --mingw-cross-env switch to test_cmdline_tool.py diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 65becc4..e2920d8 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -538,7 +538,10 @@ macro(add_cmdline_test TESTCMD TESTSUFFIX) set(CONFARG CONFIGURATIONS) set(CONFVAL ${FOUNDCONFIGS}) - add_test(NAME ${TEST_FULLNAME} ${CONFARG} ${CONFVAL} COMMAND ${PYTHON_EXECUTABLE} ${tests_SOURCE_DIR}/test_cmdline_tool.py --comparator=${COMPARATOR} -c ${ImageMagick_convert_EXECUTABLE} -s ${TESTSUFFIX} ${CMAKE_BINARY_DIR}/${TESTCMD} "${SCADFILE}") + if (MINGW_CROSS_ENV_DIR) + set( MINGW_CROSS_ARG "--mingw-cross-env" ) + endif() + add_test(NAME ${TEST_FULLNAME} ${CONFARG} ${CONFVAL} COMMAND ${PYTHON_EXECUTABLE} ${tests_SOURCE_DIR}/test_cmdline_tool.py ${MINGW_CROSS_ARG} --comparator=${COMPARATOR} -c ${ImageMagick_convert_EXECUTABLE} -s ${TESTSUFFIX} ${CMAKE_BINARY_DIR}/${TESTCMD} "${SCADFILE}") endif() endforeach() endmacro() diff --git a/tests/CMingw-cross-env.cmake b/tests/CMingw-cross-env.cmake index 469223d..364326a 100644 --- a/tests/CMingw-cross-env.cmake +++ b/tests/CMingw-cross-env.cmake @@ -82,7 +82,7 @@ set(CMAKE_RC_COMPILER ${MINGW_CROSS_ENV_DIR}/usr/bin/i686-pc-mingw32-windres) set(PKG_CONFIG_EXECUTABLE ${MINGW_CROSS_ENV_DIR}/usr/bin/i686-pc-mingw32-pkg-config) set(QT_QMAKE_EXECUTABLE ${MINGW_CROSS_ENV_DIR}/usr/bin/i686-pc-mingw32-qmake) set(CMAKE_INSTALL_PREFIX ${MINGW_CROSS_ENV_DIR}/usr/i686-pc-mingw32 CACHE PATH "Installation Prefix") -# set(CMAKE_BUILD_TYPE Release CACHE STRING "Debug|Release|RelWithDebInfo|MinSizeRel") +set(CMAKE_BUILD_TYPE RelWithDebInfo) # # Part 3. library settings for mingw-cross-env diff --git a/tests/test_cmdline_tool.py b/tests/test_cmdline_tool.py index ef10a19..f29acc0 100755 --- a/tests/test_cmdline_tool.py +++ b/tests/test_cmdline_tool.py @@ -143,7 +143,7 @@ def run_test(testname, cmd, args): outfile = open(outputname, "wb") try: - if os.path.isfile(cmd+'.exe'): + if os.path.isfile(cmd+'.exe') and options.mingw_cross_env: cmdline = ['wine']+[cmd+'.exe'] + args + [outputname] else: cmdline = [cmd] + args + [outputname] @@ -176,11 +176,11 @@ def usage(): print >> sys.stderr, " -s, --suffix= Write -expected and -actual files with the given suffix instead of .txt" print >> sys.stderr, " -t, --test= Specify test name instead of deducting it from the argument" print >> sys.stderr, " -c, --convexec= Path to ImageMagick 'convert' executable" - + print >> sys.stderr, " -x, --mingw-cross-env Mingw-cross-env cross compilation" if __name__ == '__main__': # Handle command-line arguments try: - opts, args = getopt.getopt(sys.argv[1:], "gs:c:t:m:", ["generate", "convexec=", "suffix=", "test=", "comparator="]) + opts, args = getopt.getopt(sys.argv[1:], "gs:c:t:m:x", ["generate", "convexec=", "suffix=", "test=", "comparator=", "mingw-cross-env"]) except getopt.GetoptError, err: usage() sys.exit(2) @@ -202,6 +202,8 @@ if __name__ == '__main__': options.convert_exec = os.path.normpath( a ) elif o in ("-m", "--comparator"): options.comparator = a + elif o in ("-x", "--mingw-cross-env"): + options.mingw_cross_env = True # and if len(args) < 2: -- cgit v0.10.1