diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Configure/is_conftest/fixture/SConstruct | 24 | ||||
-rw-r--r-- | test/Configure/is_conftest/fixture/sconstest.skip | 0 | ||||
-rw-r--r-- | test/Configure/is_conftest/is_conftest.py | 48 |
3 files changed, 72 insertions, 0 deletions
diff --git a/test/Configure/is_conftest/fixture/SConstruct b/test/Configure/is_conftest/fixture/SConstruct new file mode 100644 index 0000000..8118db2 --- /dev/null +++ b/test/Configure/is_conftest/fixture/SConstruct @@ -0,0 +1,24 @@ +""" +Test the nodes are created as conftest nodes in configure tests. +""" +import sys +DefaultEnvironment(tools=[]) + +env = Environment() + +conf = Configure(env) +if sys.platform == "win32": + conf.env.Append( + CCFLAGS="/DEBUG /Z7 /INCREMENTAL:NO", + LINKFLAGS="/DEBUG /INCREMENTAL:NO", + PDB='${TARGET.base}.pdb') +if not conf.TryRun("int main( int argc, char* argv[] ){return 0;}", '.c'): + print("FAIL") + +env = conf.Finish() + +for node in env.Glob('.sconf_temp/*'): + if not node.is_conftest(): + print("FAIL") + + diff --git a/test/Configure/is_conftest/fixture/sconstest.skip b/test/Configure/is_conftest/fixture/sconstest.skip new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/Configure/is_conftest/fixture/sconstest.skip diff --git a/test/Configure/is_conftest/is_conftest.py b/test/Configure/is_conftest/is_conftest.py new file mode 100644 index 0000000..58dbdfe --- /dev/null +++ b/test/Configure/is_conftest/is_conftest.py @@ -0,0 +1,48 @@ +#!/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 is_conftest is marking nodes. +""" + +import TestSCons + +test = TestSCons.TestSCons() + +test.file_fixture('./fixture/SConstruct') + +test.run('-Q --silent') + +if "FAIL" in test.stdout(): + test.fail_test() + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: |