diff options
author | Mats Wichmann <mats@linux.com> | 2020-05-23 12:07:39 -0600 |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2020-05-25 09:19:42 -0600 |
commit | df7422a008be9236cf7ded05d99704a6b7ce7459 (patch) | |
tree | 61b375e5ad65b80a8c93053fed592b25fdbca41d /test/Removed | |
parent | 47b761fa3f9e24419db48393ca9d6064f7b5d21c (diff) | |
download | scons-git-df7422a008be9236cf7ded05d99704a6b7ce7459.tar.gz |
Set Tasks class as abstract
needs_execut method set as an abstract method, meaning you can't
instantiate Task itself, and derived classes must implement the
methid. The former warning framework for this (deprecated) is
disabled, and some unit tests that were not implementing needs_execute
were fixed - by deriving from the AlwaysTask class.
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'test/Removed')
-rw-r--r-- | test/Removed/BuildDir/README.md | 2 | ||||
-rw-r--r-- | test/Removed/CacheDir/README.md | 2 | ||||
-rw-r--r-- | test/Removed/Copy-Method/README.md | 2 | ||||
-rw-r--r-- | test/Removed/Old/TaskmasterNeedsExecute.py | 53 | ||||
-rw-r--r-- | test/Removed/Old/sconstest.skip | 0 | ||||
-rw-r--r-- | test/Removed/README.md | 13 | ||||
-rw-r--r-- | test/Removed/SourceCode/README.md | 2 | ||||
-rw-r--r-- | test/Removed/SourceSignatures/README.md | 2 | ||||
-rw-r--r-- | test/Removed/TargetSignatures/README.md | 2 |
9 files changed, 72 insertions, 6 deletions
diff --git a/test/Removed/BuildDir/README.md b/test/Removed/BuildDir/README.md index c4fd8790b..131e67b32 100644 --- a/test/Removed/BuildDir/README.md +++ b/test/Removed/BuildDir/README.md @@ -1,6 +1,6 @@ BuildDir/Old contains old tests which used the now removed BuildDir function, env.BuildDir method, and build_dir argument to SConscript, -preserved here for reference; the presence of an scontest.skip file +preserved here for reference; the presence of an sconstest.skip file means they are never executed. The "new" tests verify failure using these symbols. diff --git a/test/Removed/CacheDir/README.md b/test/Removed/CacheDir/README.md index c5b75bf94..46fcbc05e 100644 --- a/test/Removed/CacheDir/README.md +++ b/test/Removed/CacheDir/README.md @@ -1,4 +1,4 @@ CacheDir/Old contains old tests of CacheDir which used the now removed SourceSignatures and TargetSignatures methods, preserved here for -reference; the presence of an scontest.skip file means they are never +reference; the presence of an sconstest.skip file means they are never executed. diff --git a/test/Removed/Copy-Method/README.md b/test/Removed/Copy-Method/README.md index 609c6e4ae..6352522a6 100644 --- a/test/Removed/Copy-Method/README.md +++ b/test/Removed/Copy-Method/README.md @@ -2,5 +2,5 @@ Copy-Method.py is the "new" test for env.Copy, making sure we get an AttributeError. The Old directory is the former tests from the deprecated state, -preserved here for reference; the presence of an scontest.skip file +preserved here for reference; the presence of an sconstest.skip file means they are never executed. diff --git a/test/Removed/Old/TaskmasterNeedsExecute.py b/test/Removed/Old/TaskmasterNeedsExecute.py new file mode 100644 index 000000000..9f7ade1df --- /dev/null +++ b/test/Removed/Old/TaskmasterNeedsExecute.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python +# +# __COPYRIGHT__ +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# 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__" + +""" +Verify the message about the deprecated Taskmaster.needs_task() +method, and the ability to suppress it. +""" + +import TestSCons + +test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) + +test.write('SConscript', """ +import SCons.Taskmaster +tm = SCons.Taskmaster.Taskmaster() +task = SCons.Taskmaster.Task(tm, [], True, None) +task.needs_execute() +""") + +msg ="""Taskmaster.Task is an abstract base class; instead of +\tusing it directly, derive from it and override the abstract methods.""" +test.deprecated_warning('taskmaster-needs-execute', msg) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Removed/Old/sconstest.skip b/test/Removed/Old/sconstest.skip new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/test/Removed/Old/sconstest.skip diff --git a/test/Removed/README.md b/test/Removed/README.md new file mode 100644 index 000000000..be3f9b9b5 --- /dev/null +++ b/test/Removed/README.md @@ -0,0 +1,13 @@ +This tree contains tests for formerly deprecated behaviors +that have since been removed. + +If there is a runnable test (i.e. a test that verifies a +particular old behavior actually fails if called), it is +here or in a subdirectory and is left selectable by the +test framework. + +If there is a test that cannot be run, it will be in a +subdirectory named Old, which will contain a sconstest.skip +file, ensuring those test files are never loaded by the +test framework. + diff --git a/test/Removed/SourceCode/README.md b/test/Removed/SourceCode/README.md index c584dc9b2..61feaadb1 100644 --- a/test/Removed/SourceCode/README.md +++ b/test/Removed/SourceCode/README.md @@ -2,5 +2,5 @@ SourceCode.py is the "new" test for SourceCode making sure we get a NameError. The Old directory is the former tests from the deprecated state, -preserved here for reference; the presence of an scontest.skip file +preserved here for reference; the presence of an sconstest.skip file means they are never executed. diff --git a/test/Removed/SourceSignatures/README.md b/test/Removed/SourceSignatures/README.md index 05d8d05fd..4714a6813 100644 --- a/test/Removed/SourceSignatures/README.md +++ b/test/Removed/SourceSignatures/README.md @@ -2,5 +2,5 @@ SourceSignatures.py is the "new" test, only makes sure scons actually fails in the presence of the method or setoption call. The Old directory is the former tests from the deprecated state, -preserved here for reference; the presence of an scontest.skip file +preserved here for reference; the presence of an sconstest.skip file means they are never executed. diff --git a/test/Removed/TargetSignatures/README.md b/test/Removed/TargetSignatures/README.md index 00a8b6bd8..db00b8cc0 100644 --- a/test/Removed/TargetSignatures/README.md +++ b/test/Removed/TargetSignatures/README.md @@ -2,5 +2,5 @@ TargetSignatures.py is the "new" test, only makes sure scons actually fails in the presence of the method or setoption call. The Old directory is the former tests from the deprecated state, -preserved here for reference; the presence of an scontest.skip file +preserved here for reference; the presence of an sconstest.skip file means they are never executed. |