summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2021-11-07 13:39:50 -0700
committerMats Wichmann <mats@linux.com>2021-11-11 15:19:53 -0700
commit5093d3f59a2d33db040eb04ed4057cbd6bbd71b6 (patch)
tree8121fc5ac3afc318e8f092e36e4473c44d2bfb91
parent6051c8beb7bc59f083552e9f431733e93fd56360 (diff)
downloadscons-git-5093d3f59a2d33db040eb04ed4057cbd6bbd71b6.tar.gz
Deprecate the qt tool.
Updates tests to disable the warning that this change enables. Fix runtest.py to make sure -o logging option captures all the output. Signed-off-by: Mats Wichmann <mats@linux.com>
-rwxr-xr-xCHANGES.txt2
-rwxr-xr-xRELEASE.txt3
-rw-r--r--SCons/Tool/qt.py5
-rw-r--r--SCons/Tool/qt.xml15
-rw-r--r--SCons/Warnings.py2
-rw-r--r--doc/man/scons.xml11
-rw-r--r--test/QT/CPPPATH-appended.py9
-rw-r--r--test/QT/CPPPATH.py9
-rw-r--r--test/QT/QTFLAGS.py71
-rw-r--r--test/QT/Tool.py8
-rw-r--r--test/QT/copied-env.py8
-rw-r--r--test/QT/empty-env.py18
-rw-r--r--test/QT/generated-ui.py17
-rw-r--r--test/QT/installed.py36
-rw-r--r--test/QT/manual.py9
-rw-r--r--test/QT/moc-from-cpp.py45
-rw-r--r--test/QT/moc-from-header.py34
-rw-r--r--test/QT/qt_warnings.py12
-rw-r--r--test/QT/reentrant.py17
-rw-r--r--test/QT/source-from-ui.py57
-rw-r--r--test/QT/up-to-date.py16
21 files changed, 225 insertions, 179 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 50eb4c4dd..802e71b3a 100755
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -93,6 +93,8 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
on version selection to docs.
Update docs on JavaH tool in light of javah command dropped since 10.0.
Try to be better about preserving user's passed-in JAVA* construction vars.
+ - Depracate the qt tool, which refers to Qt3 (usupported since around
+ 2006).
From Brian Quistorff:
- Fix crash when scons is run from a python environement where a signal
diff --git a/RELEASE.txt b/RELEASE.txt
index 5c824a1f2..62f87fbd2 100755
--- a/RELEASE.txt
+++ b/RELEASE.txt
@@ -15,7 +15,8 @@ NEW FUNCTIONALITY
DEPRECATED FUNCTIONALITY
------------------------
-- List anything that's been deprecated since the last release
+- The qt tool, which targets Qt version 3, is deprecated. Qt3 has been unsupported by
+ upstream for many years. Qt4 and Qt5 tools are available from scons-contrib.
CHANGED/ENHANCED EXISTING FUNCTIONALITY
---------------------------------------
diff --git a/SCons/Tool/qt.py b/SCons/Tool/qt.py
index 494fab00f..ff995657d 100644
--- a/SCons/Tool/qt.py
+++ b/SCons/Tool/qt.py
@@ -38,6 +38,7 @@ import SCons.Scanner
import SCons.Tool
import SCons.Util
import SCons.Tool.cxx
+import SCons.Warnings
cplusplus = SCons.Tool.cxx
class ToolQtWarning(SCons.Warnings.SConsWarning):
@@ -270,6 +271,10 @@ def generate(env):
Action = SCons.Action.Action
Builder = SCons.Builder.Builder
+ SCons.Warnings.warn(
+ SCons.Warnings.ToolQtDeprecatedWarning, "Tool module for Qt version 3 is deprecated"
+ )
+
env.SetDefault(QTDIR = _detect(env),
QT_BINPATH = os.path.join('$QTDIR', 'bin'),
QT_CPPPATH = os.path.join('$QTDIR', 'include'),
diff --git a/SCons/Tool/qt.xml b/SCons/Tool/qt.xml
index f43a09d01..5298a82c4 100644
--- a/SCons/Tool/qt.xml
+++ b/SCons/Tool/qt.xml
@@ -31,12 +31,11 @@ Sets &consvars; for building Qt3 applications.
<note><para>
This tool is only suitable for building targeted to Qt3,
-which is obsolete.
-There are contributed tools for Qt4 and Qt5,
-see
-<ulink url="https://github.com/SCons/scons/wiki/ToolsIndex">
-https://github.com/SCons/scons/wiki/ToolsIndex
-</ulink>.
+which is obsolete
+(<emphasis>the tool is deprecated since 4.3</emphasis>).
+There are contributed tools for Qt4 and Qt5, see
+<ulink url="https://github.com/SCons/scons-contrib">
+https://github.com/SCons/scons-contrib</ulink>.
Qt4 has also passed end of life for standard support (in Dec 2015).
</para></note>
@@ -45,8 +44,8 @@ Note paths for these &consvars; are assembled
using the <function>os.path.join</function> method
so they will have the appropriate separator at runtime,
but are listed here in the various
-entries with the <literal>'/'</literal> separator
-for easier reading.
+entries only with the <literal>'/'</literal> separator
+for simplicity.
</para>
<para>
diff --git a/SCons/Warnings.py b/SCons/Warnings.py
index 198c6aeda..f6159a3fc 100644
--- a/SCons/Warnings.py
+++ b/SCons/Warnings.py
@@ -128,6 +128,8 @@ class DeprecatedDebugOptionsWarning(MandatoryDeprecatedWarning):
class DeprecatedMissingSConscriptWarning(DeprecatedWarning):
pass
+class ToolQtDeprecatedWarning(DeprecatedWarning):
+ pass
# The below is a list of 2-tuples. The first element is a class object.
# The second element is true if that class is enabled, false if it is disabled.
diff --git a/doc/man/scons.xml b/doc/man/scons.xml
index e90ea0f5d..e9ee45e71 100644
--- a/doc/man/scons.xml
+++ b/doc/man/scons.xml
@@ -1998,7 +1998,8 @@ after other processing.</para>
<option>--warn=no-<replaceable>type</replaceable></option>
</term>
<listitem>
-<para>Enable or disable (with the no- prefix) warnings.
+<para>Enable or disable (with the prefix "no-") warnings
+(<option>--warning</option> is a synonym).
<replaceable>type</replaceable>
specifies the type of warnings to be enabled or disabled:</para>
@@ -2124,6 +2125,14 @@ can themselves refer to lists of names or nodes.</para>
</varlistentry>
<varlistentry>
+ <term><emphasis role="bold">tool-qt-deprecated</emphasis></term>
+ <listitem>
+<para>Warnings about the &t-link-qt; tool being deprecated.
+These warnings are enabled by default.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><emphasis role="bold">missing-sconscript</emphasis></term>
<listitem>
<para>Warnings about missing SConscript files.
diff --git a/test/QT/CPPPATH-appended.py b/test/QT/CPPPATH-appended.py
index 98baad86a..ee1808faf 100644
--- a/test/QT/CPPPATH-appended.py
+++ b/test/QT/CPPPATH-appended.py
@@ -1,6 +1,8 @@
#!/usr/bin/env python
#
-# __COPYRIGHT__
+# MIT License
+#
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -20,9 +22,6 @@
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
Test that an appended relative CPPPATH works with generated files.
@@ -70,7 +69,7 @@ test.write(['sub', 'local_include', 'local_include.h'], r"""
/* empty; just needs to be found */
""")
-test.run(arguments = aaa_exe)
+test.run(arguments='--warn=no-tool-qt-deprecated ' + aaa_exe)
test.pass_test()
diff --git a/test/QT/CPPPATH.py b/test/QT/CPPPATH.py
index 5de41d910..b56efad44 100644
--- a/test/QT/CPPPATH.py
+++ b/test/QT/CPPPATH.py
@@ -1,6 +1,8 @@
#!/usr/bin/env python
#
-# __COPYRIGHT__
+# MIT License
+#
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -20,9 +22,6 @@
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
Test that an overwritten CPPPATH works with generated files.
@@ -60,7 +59,7 @@ test.write(['local_include', 'local_include.h'], r"""
/* empty; just needs to be found */
""")
-test.run(arguments = aaa_exe)
+test.run(arguments='--warn=no-tool-qt-deprecated ' + aaa_exe)
test.pass_test()
diff --git a/test/QT/QTFLAGS.py b/test/QT/QTFLAGS.py
index aa142f516..c759c2a4a 100644
--- a/test/QT/QTFLAGS.py
+++ b/test/QT/QTFLAGS.py
@@ -1,6 +1,8 @@
#!/usr/bin/env python
#
-# __COPYRIGHT__
+# MIT License
+#
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -20,9 +22,6 @@
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
Testing the configuration mechanisms of the 'qt' tool.
@@ -40,7 +39,7 @@ test.subdir('work1', 'work2')
test.run(
chdir=test.workpath('qt', 'lib'),
- arguments='.',
+ arguments="--warn=no-tool-qt-deprecated .",
stderr=TestSCons.noisy_ar,
match=TestSCons.match_re_dotall,
)
@@ -138,16 +137,18 @@ int main(void) {
}
""")
-test.run(chdir = 'work1', arguments = "mytest" + _exe)
-
-test.must_exist(['work1', 'mmmmocFromH.cxx'],
- ['work1', 'mocmocFromCpp.inl'],
- ['work1', 'an_ui_file.cxx'],
- ['work1', 'uic-an_ui_file.hpp'],
- ['work1', 'mmman_ui_file.cxx'],
- ['work1', 'another_ui_file.cxx'],
- ['work1', 'uic-another_ui_file.hpp'],
- ['work1', 'mmmanother_ui_file.cxx'])
+test.run(chdir='work1', arguments="--warn=no-tool-qt-deprecated mytest" + _exe)
+
+test.must_exist(
+ ['work1', 'mmmmocFromH.cxx'],
+ ['work1', 'mocmocFromCpp.inl'],
+ ['work1', 'an_ui_file.cxx'],
+ ['work1', 'uic-an_ui_file.hpp'],
+ ['work1', 'mmman_ui_file.cxx'],
+ ['work1', 'another_ui_file.cxx'],
+ ['work1', 'uic-another_ui_file.hpp'],
+ ['work1', 'mmmanother_ui_file.cxx'],
+)
def _flagTest(test,fileToContentsStart):
for f,c in fileToContentsStart.items():
@@ -155,19 +156,29 @@ def _flagTest(test,fileToContentsStart):
return 1
return 0
-test.fail_test(_flagTest(test, {'mmmmocFromH.cxx':'/* mymoc.py -z */',
- 'mocmocFromCpp.inl':'/* mymoc.py -w */',
- 'an_ui_file.cxx':'/* myuic.py -x */',
- 'uic-an_ui_file.hpp':'/* myuic.py -y */',
- 'mmman_ui_file.cxx':'/* mymoc.py -z */'}))
+test.fail_test(
+ _flagTest(
+ test,
+ {
+ 'mmmmocFromH.cxx': '/* mymoc.py -z */',
+ 'mocmocFromCpp.inl': '/* mymoc.py -w */',
+ 'an_ui_file.cxx': '/* myuic.py -x */',
+ 'uic-an_ui_file.hpp': '/* myuic.py -y */',
+ 'mmman_ui_file.cxx': '/* mymoc.py -z */',
+ },
+ )
+)
test.write(['work2', 'SConstruct'], """
import os.path
-env1 = Environment(tools=['qt'],
- QTDIR = r'%(QTDIR)s',
- QT_BINPATH='$QTDIR/bin64',
- QT_LIBPATH='$QTDIR/lib64',
- QT_CPPPATH='$QTDIR/h64')
+
+env1 = Environment(
+ tools=['qt'],
+ QTDIR=r'%(QTDIR)s',
+ QT_BINPATH='$QTDIR/bin64',
+ QT_LIBPATH='$QTDIR/lib64',
+ QT_CPPPATH='$QTDIR/h64',
+)
cpppath = env1.subst('$CPPPATH')
if os.path.normpath(cpppath) != os.path.join(r'%(QTDIR)s', 'h64'):
@@ -182,11 +193,9 @@ if os.path.normpath(qt_moc) != os.path.join(r'%(QTDIR)s', 'bin64', 'moc'):
print(qt_moc)
Exit(3)
-env2 = Environment(tools=['default', 'qt'],
- QTDIR = None,
- QT_LIB = None,
- QT_CPPPATH = None,
- QT_LIBPATH = None)
+env2 = Environment(
+ tools=['default', 'qt'], QTDIR=None, QT_LIB=None, QT_CPPPATH=None, QT_LIBPATH=None
+)
env2.Program('main.cpp')
""" % {'QTDIR':QT})
@@ -197,7 +206,7 @@ int main(void) { return 0; }
# Ignore stderr, because if Qt is not installed,
# there may be a warning about an empty QTDIR on stderr.
-test.run(chdir='work2', stderr=None)
+test.run(arguments="--warn=no-tool-qt-deprecated", chdir='work2', stderr=None)
test.must_exist(['work2', 'main' + _exe])
diff --git a/test/QT/Tool.py b/test/QT/Tool.py
index f684e912a..122e7f413 100644
--- a/test/QT/Tool.py
+++ b/test/QT/Tool.py
@@ -1,6 +1,8 @@
#!/usr/bin/env python
#
-# __COPYRIGHT__
+# MIT License
+#
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -31,8 +33,6 @@ not completely minimal, but we're leaving it as-is since it represents a
good real-world sanity check on the interaction of some key subsystems.
"""
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-
import os
import TestSCons
@@ -145,7 +145,7 @@ if not config.CheckForQt():
env.Tool('qt', ['$TOOL_PATH'])
""")
-test.run(arguments = '.')
+test.run(arguments='--warn=no-tool-qt-deprecated .')
test.pass_test()
diff --git a/test/QT/copied-env.py b/test/QT/copied-env.py
index be9f599b8..74f59b7fc 100644
--- a/test/QT/copied-env.py
+++ b/test/QT/copied-env.py
@@ -1,6 +1,8 @@
#!/usr/bin/env python
#
-# __COPYRIGHT__
+# MIT License
+#
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -25,8 +27,6 @@
Test Qt with a copied construction environment.
"""
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-
import TestSCons
test = TestSCons.TestSCons()
@@ -63,7 +63,7 @@ test.write('MyForm.ui', r"""
void aaa(void)
""")
-test.run()
+test.run(arguments="--warn=no-tool-qt-deprecated")
moc_MyForm = [x for x in test.stdout().split('\n') if x.find('moc_MyForm') != -1]
diff --git a/test/QT/empty-env.py b/test/QT/empty-env.py
index b7867e551..e9dfc81b1 100644
--- a/test/QT/empty-env.py
+++ b/test/QT/empty-env.py
@@ -1,6 +1,8 @@
#!/usr/bin/env python
#
-# __COPYRIGHT__
+# MIT License
+#
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -20,9 +22,6 @@
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
Test Qt creation from a copied empty environment.
@@ -62,11 +61,14 @@ foo6(void)
# we can receive warnings about a non detected qt (empty QTDIR)
# these are not critical, but may be annoying.
-test.run(stderr=None)
+test.run(stderr=None, arguments='--warn=no-tool-qt-deprecated')
-test.run(program = test.workpath('main' + TestSCons._exe),
- stderr = None,
- stdout = 'qt/include/foo6.h\n')
+test.run(
+ program=test.workpath('main' + TestSCons._exe),
+ arguments='--warn=no-tool-qt-deprecated',
+ stderr=None,
+ stdout='qt/include/foo6.h\n',
+)
test.pass_test()
diff --git a/test/QT/generated-ui.py b/test/QT/generated-ui.py
index 4692a82b0..fd368b34d 100644
--- a/test/QT/generated-ui.py
+++ b/test/QT/generated-ui.py
@@ -1,6 +1,8 @@
#!/usr/bin/env python
#
-# __COPYRIGHT__
+# MIT License
+#
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -20,9 +22,6 @@
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
Test that the UI scanning logic correctly picks up scansG
@@ -120,11 +119,13 @@ test.write(['layer', 'aclock', 'qt_bug', 'migraform.ui'], """\
</UI>
""")
-test.run(arguments = '.',
- stderr = TestSCons.noisy_ar,
- match = TestSCons.match_re_dotall)
+test.run(
+ arguments='--warn=no-tool-qt-deprecated',
+ stderr=TestSCons.noisy_ar,
+ match=TestSCons.match_re_dotall,
+)
-test.up_to_date(arguments = '.')
+test.up_to_date(options="--warn=no-tool-qt-deprecated", arguments=".")
test.pass_test()
diff --git a/test/QT/installed.py b/test/QT/installed.py
index c3ba168ce..9e8693e3f 100644
--- a/test/QT/installed.py
+++ b/test/QT/installed.py
@@ -1,6 +1,8 @@
#!/usr/bin/env python
#
-# __COPYRIGHT__
+# MIT License
+#
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -20,9 +22,6 @@
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
Look if qt is installed, and try out all builders.
@@ -173,13 +172,15 @@ int main(int argc, char **argv) {
}
""")
-test.run(arguments="bld/test_realqt" + TestSCons._exe)
+test.run(arguments="--warn=no-tool-qt-deprecated bld/test_realqt" + TestSCons._exe)
-
-test.run(program=test.workpath("bld", "test_realqt"),
- stdout=None,
- status=None,
- stderr=None)
+test.run(
+ program=test.workpath("bld", "test_realqt"),
+ arguments="--warn=no-tool-qt-deprecated",
+ stdout=None,
+ status=None,
+ stderr=None,
+)
if test.stdout() != "Hello World\n" or test.stderr() != '' or test.status:
sys.stdout.write(test.stdout())
@@ -191,23 +192,24 @@ if test.stdout() != "Hello World\n" or test.stderr() != '' or test.status:
expect = 'cannot connect to X server'
test.fail_test(test.stdout())
test.fail_test(expect not in test.stderr())
- if test.status != 1 and (test.status>>8) != 1:
+ if test.status != 1 and (test.status >> 8) != 1:
sys.stdout.write('test_realqt returned status %s\n' % test.status)
test.fail_test()
QTDIR = os.environ['QTDIR']
PATH = os.environ['PATH']
-os.environ['QTDIR']=''
-os.environ['PATH']='.'
+os.environ['QTDIR'] = ''
+os.environ['PATH'] = '.'
-test.run(stderr=None, arguments="-c bld/test_realqt" + TestSCons._exe)
+test.run(
+ stderr=None,
+ arguments="--warn=no-tool-qt-deprecated -c bld/test_realqt" + TestSCons._exe,
+)
expect1 = "scons: warning: Could not detect qt, using empty QTDIR"
expect2 = "scons: warning: Could not detect qt, using moc executable as a hint"
-test.fail_test(expect1 not in test.stderr() and
- expect2 not in test.stderr())
-
+test.fail_test(expect1 not in test.stderr() and expect2 not in test.stderr())
test.pass_test()
diff --git a/test/QT/manual.py b/test/QT/manual.py
index c5cf74e8a..84c6df8e0 100644
--- a/test/QT/manual.py
+++ b/test/QT/manual.py
@@ -1,6 +1,8 @@
#!/usr/bin/env python
#
-# __COPYRIGHT__
+# MIT License
+#
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -20,9 +22,6 @@
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
Test the manual QT builder calls.
@@ -124,7 +123,7 @@ int main(void) {
}
""")
-test.run(arguments = aaa_exe)
+test.run(arguments="--warn=no-tool-qt-deprecated " + aaa_exe)
# normal invocation
test.must_exist(test.workpath('include', 'moc_aaa.cc'))
diff --git a/test/QT/moc-from-cpp.py b/test/QT/moc-from-cpp.py
index 1bd7b1018..bbab8cab8 100644
--- a/test/QT/moc-from-cpp.py
+++ b/test/QT/moc-from-cpp.py
@@ -1,6 +1,8 @@
#!/usr/bin/env python
#
-# __COPYRIGHT__
+# MIT License
+#
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -20,9 +22,6 @@
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
Create a moc file from a cpp file.
@@ -64,11 +63,13 @@ void useit() {
}
""")
-test.run(arguments=lib_aaa,
- stderr=TestSCons.noisy_ar,
- match=TestSCons.match_re_dotall)
+test.run(
+ arguments="--warn=no-tool-qt-deprecated " + lib_aaa,
+ stderr=TestSCons.noisy_ar,
+ match=TestSCons.match_re_dotall,
+)
-test.up_to_date(options = '-n', arguments = lib_aaa)
+test.up_to_date(options='-n --warn=no-tool-qt-deprecated', arguments=lib_aaa)
test.write('aaa.cpp', r"""
#include "my_qobject.h"
@@ -77,22 +78,30 @@ void aaa(void) Q_OBJECT
#include "%s"
""" % moc)
-test.not_up_to_date(options = '-n', arguments = moc)
+test.not_up_to_date(options='-n --warn=no-tool-qt-deprecated', arguments=moc)
-test.run(options = '-c', arguments = lib_aaa)
+test.run(options="--warn=no-tool-qt-deprecated -c", arguments=lib_aaa)
-test.run(arguments = "variant_dir=1 " + test.workpath('build', lib_aaa),
- stderr=TestSCons.noisy_ar,
- match=TestSCons.match_re_dotall)
+test.run(
+ arguments="--warn=no-tool-qt-deprecated variant_dir=1 "
+ + test.workpath('build', lib_aaa),
+ stderr=TestSCons.noisy_ar,
+ match=TestSCons.match_re_dotall,
+)
-test.run(arguments = "variant_dir=1 chdir=1 " + test.workpath('build', lib_aaa))
+test.run(
+ arguments="--warn=no-tool-qt-deprecated variant_dir=1 chdir=1 "
+ + test.workpath('build', lib_aaa)
+)
test.must_exist(test.workpath('build', moc))
-test.run(arguments = "variant_dir=1 dup=0 " +
- test.workpath('build_dup0', lib_aaa),
- stderr=TestSCons.noisy_ar,
- match=TestSCons.match_re_dotall)
+test.run(
+ arguments="--warn=no-tool-qt-deprecated variant_dir=1 dup=0 "
+ + test.workpath('build_dup0', lib_aaa),
+ stderr=TestSCons.noisy_ar,
+ match=TestSCons.match_re_dotall,
+)
test.must_exist(test.workpath('build_dup0', moc))
diff --git a/test/QT/moc-from-header.py b/test/QT/moc-from-header.py
index 4151cba7d..65a12e1ed 100644
--- a/test/QT/moc-from-header.py
+++ b/test/QT/moc-from-header.py
@@ -1,6 +1,8 @@
#!/usr/bin/env python
#
-# __COPYRIGHT__
+# MIT License
+#
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -20,9 +22,6 @@
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
Create a moc file from a header file.
@@ -69,11 +68,8 @@ test.write('aaa.h', r"""
void aaa(void) Q_OBJECT;
""")
-test.run()
-
-test.up_to_date(options = '-n', arguments=aaa_exe)
-
-test.up_to_date(options = '-n', arguments = aaa_exe)
+test.run(arguments="--warn=no-tool-qt-deprecated")
+test.up_to_date(options='--warn=no-tool-qt-deprecated -n', arguments=aaa_exe)
test.write('aaa.h', r"""
/* a change */
@@ -81,18 +77,26 @@ test.write('aaa.h', r"""
void aaa(void) Q_OBJECT;
""")
-test.not_up_to_date(options='-n', arguments = moc)
+test.not_up_to_date(options='--warn=no-tool-qt-deprecated -n', arguments=moc)
-test.run(program = test.workpath(aaa_exe), stdout = 'aaa.h\n')
+test.run(
+ arguments="--warn=no-tool-qt-deprecated",
+ program=test.workpath(aaa_exe),
+ stdout='aaa.h\n',
+)
-test.run(arguments = "variant_dir=1 " + build_aaa_exe)
+test.run(arguments="--warn=no-tool-qt-deprecated variant_dir=1 " + build_aaa_exe)
-test.run(arguments = "variant_dir=1 chdir=1 " + build_aaa_exe)
+test.run(
+ arguments="--warn=no-tool-qt-deprecated variant_dir=1 chdir=1 " + build_aaa_exe
+)
test.must_exist(test.workpath('build', moc))
-test.run(arguments = "variant_dir=1 chdir=1 dup=0 " +
- test.workpath('build_dup0', aaa_exe) )
+test.run(
+ arguments="--warn=no-tool-qt-deprecated variant_dir=1 chdir=1 dup=0 "
+ + test.workpath('build_dup0', aaa_exe)
+)
test.must_exist(['build_dup0', moc])
diff --git a/test/QT/qt_warnings.py b/test/QT/qt_warnings.py
index 2aa7940af..fb23a7151 100644
--- a/test/QT/qt_warnings.py
+++ b/test/QT/qt_warnings.py
@@ -1,6 +1,8 @@
#!/usr/bin/env python
#
-# __COPYRIGHT__
+# MIT License
+#
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -25,8 +27,6 @@
Test the Qt tool warnings.
"""
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-
import os
import re
@@ -51,7 +51,7 @@ import os
env.StaticLibrary('aaa.cpp')
""")
-test.run(stderr=None)
+test.run(arguments="--warn=no-tool-qt-deprecated", stderr=None)
match12 = r"""
scons: warning: Generated moc file 'aaa.moc' is not included by 'aaa.cpp'
@@ -64,7 +64,7 @@ if not re.search(match12, test.stderr()):
os.environ['QTDIR'] = test.QT
-test.run(arguments='-n noqtdir=1')
+test.run(arguments='--warn=no-tool-qt-deprecated -n noqtdir=1')
# We'd like to eliminate $QTDIR from the environment as follows:
# del os.environ['QTDIR']
@@ -74,7 +74,7 @@ test.run(arguments='-n noqtdir=1')
# environment, so it only gets removed from the Python dictionary.
# Consequently, we need to just wipe out its value as follows>
os.environ['QTDIR'] = ''
-test.run(stderr=None, arguments='-n noqtdir=1')
+test.run(stderr=None, arguments='--warn=no-tool-qt-deprecated -n noqtdir=1')
moc = test.where_is('moc')
if moc:
diff --git a/test/QT/reentrant.py b/test/QT/reentrant.py
index af19af9de..40fb1f19a 100644
--- a/test/QT/reentrant.py
+++ b/test/QT/reentrant.py
@@ -1,6 +1,8 @@
#!/usr/bin/env python
#
-# __COPYRIGHT__
+# MIT License
+#
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -20,9 +22,6 @@
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
Test creation from a copied environment that already has QT variables.
@@ -59,11 +58,13 @@ test.write('main.cpp', r"""
int main(void) { foo5(); return 0; }
""")
-test.run()
-
-test.run(program = test.workpath('main' + TestSCons._exe),
- stdout = 'qt/include/foo5.h\n')
+test.run(arguments="--warn=no-tool-qt-deprecated")
+test.run(
+ arguments='--warn=no-tool-qt-deprecated',
+ program=test.workpath('main' + TestSCons._exe),
+ stdout='qt/include/foo5.h\n',
+)
test.pass_test()
# Local Variables:
diff --git a/test/QT/source-from-ui.py b/test/QT/source-from-ui.py
index 792271714..569fbab2c 100644
--- a/test/QT/source-from-ui.py
+++ b/test/QT/source-from-ui.py
@@ -1,6 +1,8 @@
#!/usr/bin/env python
#
-# __COPYRIGHT__
+# MIT License
+#
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -20,9 +22,6 @@
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
Create .cpp, .h, moc_....cpp from a .ui file.
@@ -68,9 +67,9 @@ void useit() {
}
""")
-test.run(arguments = aaa_dll)
+test.run(arguments="--warn=no-tool-qt-deprecated " + aaa_dll)
-test.up_to_date(options='-n', arguments = aaa_dll)
+test.up_to_date(options='--warn=no-tool-qt-deprecated -n', arguments=aaa_dll)
test.write('aaa.ui', r"""
/* a change */
@@ -82,11 +81,11 @@ test.write('aaa.ui', r"""
DLLEXPORT void aaa(void)
""")
-test.not_up_to_date(options = '-n', arguments = moc)
-test.not_up_to_date(options = '-n', arguments = cpp)
-test.not_up_to_date(options = '-n', arguments = h)
+test.not_up_to_date(options='--warn=no-tool-qt-deprecated -n', arguments=moc)
+test.not_up_to_date(options='--warn=no-tool-qt-deprecated -n', arguments=cpp)
+test.not_up_to_date(options='--warn=no-tool-qt-deprecated -n', arguments=h)
-test.run(arguments = aaa_dll)
+test.run(arguments="--warn=no-tool-qt-deprecated " + aaa_dll)
test.write('aaa.ui', r"""
void aaa(void)
@@ -94,28 +93,30 @@ void aaa(void)
""")
# test that non-existant ui.h files are ignored (as uic does)
-test.run(arguments = aaa_dll)
+test.run(arguments="--warn=no-tool-qt-deprecated " + aaa_dll)
test.write('aaa.ui.h', r"""
/* test dependency to .ui.h */
""")
-test.run(arguments = aaa_dll)
+test.run(arguments="--warn=no-tool-qt-deprecated " + aaa_dll)
test.write('aaa.ui.h', r"""
/* changed */
""")
-test.not_up_to_date(options = '-n', arguments = obj)
-test.not_up_to_date(options = '-n', arguments = cpp)
-test.not_up_to_date(options = '-n', arguments = h)
-test.not_up_to_date(options = '-n', arguments = moc)
+test.not_up_to_date(options='--warn=no-tool-qt-deprecated -n', arguments=obj)
+test.not_up_to_date(options='--warn=no-tool-qt-deprecated -n', arguments=cpp)
+test.not_up_to_date(options='--warn=no-tool-qt-deprecated -n', arguments=h)
+test.not_up_to_date(options='--warn=no-tool-qt-deprecated -n', arguments=moc)
# clean up
-test.run(arguments = '-c ' + aaa_dll)
+test.run(arguments="--warn=no-tool-qt-deprecated -c " + aaa_dll)
-test.run(arguments = "variant_dir=1 " +
- test.workpath('build', aaa_dll) )
+test.run(
+ arguments="--warn=no-tool-qt-deprecated variant_dir=1 "
+ + test.workpath('build', aaa_dll)
+)
test.must_exist(test.workpath('build', moc))
test.must_exist(test.workpath('build', cpp))
@@ -127,8 +128,10 @@ test.must_not_exist(test.workpath(h))
cppContents = test.read(test.workpath('build', cpp), mode='r')
test.fail_test(cppContents.find('#include "aaa.ui.h"') == -1)
-test.run(arguments = "variant_dir=1 chdir=1 " +
- test.workpath('build', aaa_dll) )
+test.run(
+ arguments="--warn=no-tool-qt-deprecated variant_dir=1 chdir=1 "
+ + test.workpath('build', aaa_dll)
+)
test.must_exist(test.workpath('build', moc))
test.must_exist(test.workpath('build', cpp))
@@ -137,12 +140,14 @@ test.must_not_exist(test.workpath(moc))
test.must_not_exist(test.workpath(cpp))
test.must_not_exist(test.workpath(h))
-test.run(arguments = "variant_dir=1 chdir=1 dup=0 " +
- test.workpath('build_dup0', aaa_dll) )
+test.run(
+ arguments="--warn=no-tool-qt-deprecated variant_dir=1 chdir=1 dup=0 "
+ + test.workpath('build_dup0', aaa_dll)
+)
-test.must_exist(test.workpath('build_dup0',moc))
-test.must_exist(test.workpath('build_dup0',cpp))
-test.must_exist(test.workpath('build_dup0',h))
+test.must_exist(test.workpath('build_dup0', moc))
+test.must_exist(test.workpath('build_dup0', cpp))
+test.must_exist(test.workpath('build_dup0', h))
test.must_not_exist(test.workpath(moc))
test.must_not_exist(test.workpath(cpp))
test.must_not_exist(test.workpath(h))
diff --git a/test/QT/up-to-date.py b/test/QT/up-to-date.py
index e1734bd84..06fb5590e 100644
--- a/test/QT/up-to-date.py
+++ b/test/QT/up-to-date.py
@@ -1,6 +1,8 @@
#!/usr/bin/env python
#
-# __COPYRIGHT__
+# MIT License
+#
+# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -22,8 +24,6 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-
"""
Validate that a stripped-down real-world Qt configuation (thanks
to Leanid Nazdrynau) with a generated .h file is correctly
@@ -128,14 +128,12 @@ test.write(['layer', 'aclock', 'qt_bug', 'my.cc'], """\
#include <main.h>
""")
-my_obj = 'layer/aclock/qt_bug/my'+_obj
+my_obj = 'layer/aclock/qt_bug/my' + _obj
-test.run(arguments = my_obj, stderr=None)
+test.run(arguments='--warn=no-tool-qt-deprecated ' + my_obj, stderr=None)
-expect = my_obj.replace( '/', os.sep )
-test.up_to_date(options = '--debug=explain',
- arguments =expect,
- stderr=None)
+expect = my_obj.replace('/', os.sep)
+test.up_to_date(options='--debug=explain', arguments=expect, stderr=None)
test.pass_test()