get rid of test type 'shell'
it's bound to the bourne shell, which is not readily available on windows hosts. on the way, the pch, fvisibility, and bsymbolic_functions tests were rewritten as regular compile tests. they now just verify that qmake's built-in support for the tested features actually works. Change-Id: Ibac246f21b5ececa40da3f576dc789982eaf9fdf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
ce50eb4a73
commit
4a1bafcc4e
1
config.tests/common/pch/header.h
Normal file
1
config.tests/common/pch/header.h
Normal file
@ -0,0 +1 @@
|
||||
#define HEADER_H
|
3
config.tests/common/pch/pch.pro
Normal file
3
config.tests/common/pch/pch.pro
Normal file
@ -0,0 +1,3 @@
|
||||
CONFIG += precompile_header
|
||||
PRECOMPILED_HEADER = header.h
|
||||
SOURCES = source.cpp
|
44
config.tests/common/pch/source.cpp
Normal file
44
config.tests/common/pch/source.cpp
Normal file
@ -0,0 +1,44 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the configuration of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or (at your option) the GNU General
|
||||
** Public license version 3 or any later version approved by the KDE Free
|
||||
** Qt Foundation. The licenses are as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
||||
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef HEADER_H
|
||||
#error no go
|
||||
#endif
|
||||
|
||||
int main() { return 0; }
|
@ -1,31 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
BSYMBOLIC_FUNCTIONS_SUPPORT=no
|
||||
COMPILER=$1
|
||||
VERBOSE=$2
|
||||
|
||||
|
||||
cat >>bsymbolic_functions.c << EOF
|
||||
#if !(defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) || defined(__amd64))
|
||||
#error "Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129)."
|
||||
#endif
|
||||
|
||||
int main() { return 0; }
|
||||
EOF
|
||||
|
||||
if [ "$VERBOSE" = "yes" ] ; then
|
||||
echo $COMPILER $SYSROOT_FLAG -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c
|
||||
$COMPILER $SYSROOT_FLAG -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c && BSYMBOLIC_FUNCTIONS_SUPPORT=yes
|
||||
else
|
||||
$COMPILER $SYSROOT_FLAG -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c >/dev/null 2>&1 && BSYMBOLIC_FUNCTIONS_SUPPORT=yes
|
||||
fi
|
||||
rm -f bsymbolic_functions.c libtest.so
|
||||
|
||||
# done
|
||||
if [ "$BSYMBOLIC_FUNCTIONS_SUPPORT" != "yes" ]; then
|
||||
[ "$VERBOSE" = "yes" ] && echo "Symbolic function binding disabled."
|
||||
exit 0
|
||||
else
|
||||
[ "$VERBOSE" = "yes" ] && echo "Symbolic function binding enabled."
|
||||
exit 1
|
||||
fi
|
@ -1,74 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
FVISIBILITY_SUPPORT=no
|
||||
COMPILER=$1
|
||||
VERBOSE=$2
|
||||
|
||||
CMDLINE=
|
||||
|
||||
|
||||
RunCompileTest() {
|
||||
cat >>fvisibility.c << EOF
|
||||
#if defined(__GNUC__)
|
||||
# if (__GNUC__ < 4)
|
||||
# error "GCC3 with backported visibility patch is known to miscompile Qt"
|
||||
# endif
|
||||
__attribute((visibility("default"))) void blah();
|
||||
#elif defined(__SUNPRO_CC)
|
||||
# if (__SUNPRO_CC < 0x0550)
|
||||
# error "SunStudio 8 or later is required for ELF visibility"
|
||||
# endif
|
||||
__global void blah();
|
||||
#else
|
||||
# error "GCC4+ or SunStudio 8+ are required to support ELF visibility"
|
||||
#endif
|
||||
EOF
|
||||
|
||||
if [ "$VERBOSE" = "yes" ] ; then
|
||||
echo $COMPILER -c $CMDLINE fvisibility.c
|
||||
$COMPILER -c $CMDLINE fvisibility.c && FVISIBILITY_SUPPORT=yes
|
||||
else
|
||||
$COMPILER -c $CMDLINE fvisibility.c >/dev/null 2>&1 && FVISIBILITY_SUPPORT=yes
|
||||
fi
|
||||
rm -f fvisibility.c fvisibility.o
|
||||
}
|
||||
|
||||
|
||||
case "$COMPILER" in
|
||||
*g++*|*c++*|*qcc*)
|
||||
CMDLINE="-fvisibility=hidden"
|
||||
RunCompileTest
|
||||
;;
|
||||
|
||||
aCC*)
|
||||
;;
|
||||
|
||||
icpc)
|
||||
ICPC_VERSION=`icpc -dumpversion`
|
||||
case "$ICPC_VERSION" in
|
||||
8.*|9.*|10.0)
|
||||
# 8.x, 9.x, and 10.0 don't support symbol visibility
|
||||
;;
|
||||
*)
|
||||
# the compile test works for the intel compiler because it mimics gcc's behavior
|
||||
CMDLINE="-fvisibility=hidden"
|
||||
RunCompileTest
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
CC)
|
||||
# This should be SunStudio. If not, it'll get caught.
|
||||
CMDLINE="-xldscope=hidden"
|
||||
RunCompileTest
|
||||
;;
|
||||
esac
|
||||
|
||||
# done
|
||||
if [ "$FVISIBILITY_SUPPORT" != "yes" ]; then
|
||||
[ "$VERBOSE" = "yes" ] && echo "Symbol visibility control disabled."
|
||||
exit 0
|
||||
else
|
||||
[ "$VERBOSE" = "yes" ] && echo "Symbol visibility control enabled."
|
||||
exit 1
|
||||
fi
|
@ -1,54 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
PRECOMP_SUPPORT=no
|
||||
COMPILER=$1
|
||||
VERBOSE=$2
|
||||
|
||||
case "$COMPILER" in
|
||||
*icpc)
|
||||
cat >header.h <<EOF
|
||||
#define HEADER_H
|
||||
|
||||
EOF
|
||||
>header.cpp
|
||||
cat >source.cpp <<EOF
|
||||
#ifndef HEADER_H
|
||||
#error no go
|
||||
#endif
|
||||
|
||||
EOF
|
||||
|
||||
rm -f header.pchi
|
||||
$COMPILER -pch-create header.pchi -include header.h -c header.cpp -o header.o >/dev/null 2>&1 \
|
||||
&& $COMPILER -pch-use header.pchi -include header.h -c source.cpp -o source.o >/dev/null 2>&1 \
|
||||
&& PRECOMP_SUPPORT=yes
|
||||
|
||||
rm -f header.h header.cpp source.cpp
|
||||
rm -f header.pchi header.o source.o
|
||||
;;
|
||||
|
||||
*g++*|c++|*qcc*)
|
||||
case `"$COMPILER" -dumpversion 2>/dev/null` in
|
||||
3.*)
|
||||
;;
|
||||
*)
|
||||
|
||||
>precomp_header.h
|
||||
if $COMPILER -x c-header precomp_header.h >/dev/null 2>&1; then
|
||||
$COMPILER -x c++-header precomp_header.h && PRECOMP_SUPPORT=yes
|
||||
fi
|
||||
rm -f precomp_header.h precomp_header.h.gch
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
# done
|
||||
if [ "$PRECOMP_SUPPORT" != "yes" ]; then
|
||||
[ "$VERBOSE" = "yes" ] && echo "Precompiled-headers support disabled."
|
||||
exit 0
|
||||
else
|
||||
[ "$VERBOSE" = "yes" ] && echo "Precompiled-headers support enabled."
|
||||
exit 1
|
||||
fi
|
52
config.tests/unix/reduce_exports/fvisibility.c
Normal file
52
config.tests/unix/reduce_exports/fvisibility.c
Normal file
@ -0,0 +1,52 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the configuration of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or (at your option) the GNU General
|
||||
** Public license version 3 or any later version approved by the KDE Free
|
||||
** Qt Foundation. The licenses are as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
||||
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(__GNUC__)
|
||||
# if (__GNUC__ < 4)
|
||||
# error "GCC3 with backported visibility patch is known to miscompile Qt"
|
||||
# endif
|
||||
__attribute((visibility("default"))) void blah();
|
||||
#elif defined(__SUNPRO_CC)
|
||||
# if (__SUNPRO_CC < 0x0550)
|
||||
# error "SunStudio 8 or later is required for ELF visibility"
|
||||
# endif
|
||||
__global void blah();
|
||||
#else
|
||||
# error "GCC4+ or SunStudio 8+ are required to support ELF visibility"
|
||||
#endif
|
5
config.tests/unix/reduce_exports/reduce_exports.pro
Normal file
5
config.tests/unix/reduce_exports/reduce_exports.pro
Normal file
@ -0,0 +1,5 @@
|
||||
TEMPLATE = lib
|
||||
CONFIG += dll hide_symbols
|
||||
SOURCES = fvisibility.c
|
||||
|
||||
isEmpty(QMAKE_CFLAGS_HIDESYMS): error("Nope")
|
44
config.tests/unix/reduce_relocs/bsymbolic_functions.c
Normal file
44
config.tests/unix/reduce_relocs/bsymbolic_functions.c
Normal file
@ -0,0 +1,44 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the configuration of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or (at your option) the GNU General
|
||||
** Public license version 3 or any later version approved by the KDE Free
|
||||
** Qt Foundation. The licenses are as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
||||
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#if !(defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) || defined(__amd64))
|
||||
# error Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129).
|
||||
#endif
|
||||
|
||||
int main() { return 0; }
|
5
config.tests/unix/reduce_relocs/reduce_relocs.pro
Normal file
5
config.tests/unix/reduce_relocs/reduce_relocs.pro
Normal file
@ -0,0 +1,5 @@
|
||||
TEMPLATE = lib
|
||||
CONFIG += dll bsymbolic_functions
|
||||
SOURCES = bsymbolic_functions.c
|
||||
|
||||
isEmpty(QMAKE_LFLAGS_BSYMBOLIC_FUNC): error("Nope")
|
@ -251,9 +251,8 @@
|
||||
},
|
||||
"precompile_header": {
|
||||
"description": "precompiled header support",
|
||||
"type": "shell",
|
||||
"test": "unix/precomp.test",
|
||||
"args": "$$QMAKE_CXX yes"
|
||||
"type": "compile",
|
||||
"test": "common/pch"
|
||||
},
|
||||
"use_gold_linker": {
|
||||
"description": "gold linker",
|
||||
@ -267,15 +266,13 @@
|
||||
},
|
||||
"reduce_exports": {
|
||||
"description": "symbol visibility support",
|
||||
"type": "shell",
|
||||
"test": "unix/fvisibility.test",
|
||||
"args": "$$QMAKE_CXX yes"
|
||||
"type": "compile",
|
||||
"test": "unix/reduce_exports"
|
||||
},
|
||||
"reduce_relocations": {
|
||||
"description": "-Bsymbolic-functions support",
|
||||
"type": "shell",
|
||||
"test": "unix/bsymbolic_functions.test",
|
||||
"args": "$$QMAKE_CXX yes"
|
||||
"type": "compile",
|
||||
"test": "unix/reduce_relocs"
|
||||
},
|
||||
"skip_modules": {
|
||||
"description": "modules to skip",
|
||||
|
@ -248,25 +248,6 @@ defineTest(qtConfParseCommandLine) {
|
||||
}
|
||||
}
|
||||
|
||||
defineTest(qtConfTest_shell) {
|
||||
test = $$eval($${1}.test)
|
||||
dir = $$replace(test, [^/]*$, "")
|
||||
test = $$replace(test, ([^/]*/)*, "")
|
||||
args = $$eval($${1}.args)
|
||||
# replace any things like $$QMAKE_CXX by their values
|
||||
eval(args = $$args)
|
||||
|
||||
test_dir = $$QMAKE_CONFIG_TESTS_DIR/$$dir
|
||||
test_out_dir = $$shadowed($$test_dir)
|
||||
test_cmd_base = "cd $$system_quote($$system_path($$test_out_dir)) &&"
|
||||
|
||||
mkpath($$test_out_dir)|error()
|
||||
|
||||
qtRunLoggedCommand("$$test_cmd_base $$test_dir/$${test} $${args}"): \
|
||||
return(false)
|
||||
return(true)
|
||||
}
|
||||
|
||||
defineReplace(qtConfToolchainSupportsFlag) {
|
||||
test_out_dir = $$shadowed($$QMAKE_CONFIG_TESTS_DIR)
|
||||
test_cmd_base = "cd $$system_quote($$system_path($$test_out_dir)) &&"
|
||||
|
Loading…
Reference in New Issue
Block a user