From 7ef3bf28c05eaed128db86855183685e9d7bbd96 Mon Sep 17 00:00:00 2001 From: Gabriel Russell Date: Tue, 3 Oct 2017 12:50:09 -0400 Subject: update mtime on cache retrieval --- src/engine/SCons/CacheDir.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/engine/SCons/CacheDir.py b/src/engine/SCons/CacheDir.py index ac91c85..ab80808 100644 --- a/src/engine/SCons/CacheDir.py +++ b/src/engine/SCons/CacheDir.py @@ -56,6 +56,10 @@ def CacheRetrieveFunc(target, source, env): fs.symlink(fs.readlink(cachefile), t.get_internal_path()) else: env.copy_from_cache(cachefile, t.get_internal_path()) + try: + os.utime(cachefile, None) + except OSError: + pass st = fs.stat(cachefile) fs.chmod(t.get_internal_path(), stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE) return 0 -- cgit v0.12 From 1a6de1b9ec85b8856f9b0b977493d3bac1ebfeb2 Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Sat, 30 Dec 2017 14:21:05 -0500 Subject: coverage reports have been missing the coverage data located in the tmp test dirs, so this change makes sure those data files get included in the report. --- .travis.yml | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7dad533..5703419 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,16 +51,30 @@ jobs: before_script: - sudo pip install coverage - sudo pip install coveralls - - echo "import coverage" | sudo tee --append /usr/lib/python2.7/sitecustomize.py - - echo "coverage.process_startup()" | sudo tee --append /usr/lib/python2.7/sitecustomize.py + # set this ensure user sites are available + - export PYTHONNOUSERSITE= + # we need to preserve the test directories because they have the coverage data + - export PRESERVE=1 + # attempt to get a location where we can store the usercustomize.py fiel + - python -m site + - export PYSITEDIR=$(python -m site --user-site) + - sudo mkdir -p $PYSITEDIR + - sudo touch ${PYSITEDIR}/usercustomize.py + # write the usercustomize.py file so all python processes use coverage and know where the config file is + - echo "import os" | sudo tee --append ${PYSITEDIR}/usercustomize.py + - echo "os.environ['COVERAGE_PROCESS_START'] = '$PWD/.coveragerc'" | sudo tee --append ${PYSITEDIR}/usercustomize.py + - echo "import coverage" | sudo tee --append ${PYSITEDIR}/usercustomize.py + - echo "coverage.process_startup()" | sudo tee --append ${PYSITEDIR}/usercustomize.py script: - export TOTAL_BUILD_JOBS=8 + # write the coverage config file - export COVERAGE_PROCESS_START=$PWD/.coveragerc - echo "[run]" >> .coveragerc - echo "source = $PWD/src" >> .coveragerc - echo "parallel = True" >> .coveragerc - - printf "omit =\n\t*Tests.py\n\tsrc/test_*\n\tsrc/setup.py\n" >> .coveragerc + - printf "omit =\n\t*Tests.py\n\tsrc/test_*\n\tsrc/setup.py\n\n" >> .coveragerc + - echo "[path] = $PWD" >> .coveragerc # Not including this workaround in the coverage report, because it will result # in constantly changing coverage reports depending on the number of times # the JobTests.py had to run to pass @@ -78,10 +92,21 @@ jobs: - if (( ${BUILD_JOB_NUM} == ${TOTAL_BUILD_JOBS} )); then end=$(wc -l < all_tests); fi - if (( ${start} == 0 )); then start=1; fi - sed -n ${start},${end}p all_tests > build_tests - - coverage run --rcfile=$PWD/.coveragerc runtest.py -f build_tests || if [[ $? == 2 ]]; then true; else false; fi + - coverage run -p --rcfile=$PWD/.coveragerc runtest.py -f build_tests || if [[ $? == 2 ]]; then true; else false; fi after_success: - - coverage combine + # get all the coverage data files from the tests and configure them into + # a command line arg list of directories + - find /tmp -name '.coverage.*' -print > coverage_reports.txt + # get just the directories + - sed -i 's/\/\.coverage\..*$//g' coverage_reports.txt + # remove duplicates + - awk '!seen[$0]++' coverage_reports.txt > coverage_reports.txt.tmp + - mv coverage_reports.txt.tmp coverage_reports.txt + # switch newlines for spaces + - sed -i -e ':a' -e 'N' -e '$!ba' -e 's/\n/ /g' coverage_reports.txt + # use all the tmp dir's as locations to collect coverage data + - coverage combine $PWD `cat coverage_reports.txt` - coverage report - coveralls --rcfile=$PWD/.coveragerc @@ -101,4 +126,4 @@ jobs: env: BUILD_JOB_NUM=7 - <<: *coverage_jobs env: BUILD_JOB_NUM=8 - + -- cgit v0.12 From 9f693ab6601ac60bfdc2e7785a1de44bf0bf0e1b Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Sat, 30 Dec 2017 17:22:46 -0500 Subject: several tests will not work with coverage, so set them to skip --- .travis.yml | 4 ---- test/Repository/M4.py | 4 ++++ test/exitfns.py | 6 ++++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5703419..22fb9d7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -82,10 +82,6 @@ jobs: # - n=0; while [[ $n -lt 10 ]]; do coverage run --rcfile=$PWD/.coveragerc runtest.py src/engine/SCons/JobTests.py && break; n=$((n+1)); done; if [ "$n" -gt "9" ]; then false; fi # exclude JobTest.py becuase we already ran that - echo "src/engine/SCons/JobTests.py" > exclude_jobtest - # also exclude this test since it overides the exit function which doesnt work with coverage - # more info here: https://coverage.readthedocs.io/en/coverage-4.4.2/subprocess.html# - # TODO: figure out how to cover test/exitfns.py - - echo "test/exitfns.py" >> exclude_jobtest - python runtest.py -l -a --exclude-list exclude_jobtest > all_tests - let "start = ($(wc -l < all_tests) / ${TOTAL_BUILD_JOBS}) * (${BUILD_JOB_NUM} - 1)"; true; - let "end = ($(wc -l < all_tests) / ${TOTAL_BUILD_JOBS}) * ${BUILD_JOB_NUM}" diff --git a/test/Repository/M4.py b/test/Repository/M4.py index fe1eb7b..29647e9 100644 --- a/test/Repository/M4.py +++ b/test/Repository/M4.py @@ -36,6 +36,10 @@ _python_ = TestSCons._python_ test = TestSCons.TestSCons() +# TODO: figure out how to write the coverage data to the locked folder or maybe somewhere else +if 'COVERAGE_PROCESS_START' in os.environ: + test.skip_test("this test locks the folder for writing meaning coverage data can not be written; skipping test.") + test.subdir('work', 'repository', ['repository', 'src']) test.write('mym4.py', """ diff --git a/test/exitfns.py b/test/exitfns.py index d1bda3a..dcd8762 100644 --- a/test/exitfns.py +++ b/test/exitfns.py @@ -28,6 +28,12 @@ import TestSCons test = TestSCons.TestSCons() +# also exclude these tests since it overides the exit function which doesnt work with coverage +# # more info here: https://coverage.readthedocs.io/en/coverage-4.4.2/subprocess.html# +# TODO: figure out how to cover tests which use exit functions +if 'COVERAGE_PROCESS_START' in os.environ: + test.skip_test("This test replaces the exit function which is needed by coverage to write test data; skipping test.") + sconstruct = """ from SCons.exitfuncs import * -- cgit v0.12 From 573c0510aa57e5e1ba228226a2fdbbb1f633d3f8 Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Sat, 30 Dec 2017 17:23:55 -0500 Subject: forget to add import os for checking the environment for coverage --- test/exitfns.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/exitfns.py b/test/exitfns.py index dcd8762..c0da861 100644 --- a/test/exitfns.py +++ b/test/exitfns.py @@ -25,7 +25,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import TestSCons - +import os test = TestSCons.TestSCons() # also exclude these tests since it overides the exit function which doesnt work with coverage -- cgit v0.12 From a90dd653a51ac7be36122a456b3667fe45d30154 Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Sun, 31 Dec 2017 16:53:51 -0500 Subject: switched to using COVERAGE_FILE for simplicity --- .travis.yml | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 22fb9d7..2b6049a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,13 +53,12 @@ jobs: - sudo pip install coveralls # set this ensure user sites are available - export PYTHONNOUSERSITE= - # we need to preserve the test directories because they have the coverage data - - export PRESERVE=1 - # attempt to get a location where we can store the usercustomize.py fiel + # attempt to get a location where we can store the usercustomize.py file - python -m site - export PYSITEDIR=$(python -m site --user-site) - sudo mkdir -p $PYSITEDIR - sudo touch ${PYSITEDIR}/usercustomize.py + - export COVERAGE_FILE=$PWD/.coverage_file # write the usercustomize.py file so all python processes use coverage and know where the config file is - echo "import os" | sudo tee --append ${PYSITEDIR}/usercustomize.py - echo "os.environ['COVERAGE_PROCESS_START'] = '$PWD/.coveragerc'" | sudo tee --append ${PYSITEDIR}/usercustomize.py @@ -91,18 +90,7 @@ jobs: - coverage run -p --rcfile=$PWD/.coveragerc runtest.py -f build_tests || if [[ $? == 2 ]]; then true; else false; fi after_success: - # get all the coverage data files from the tests and configure them into - # a command line arg list of directories - - find /tmp -name '.coverage.*' -print > coverage_reports.txt - # get just the directories - - sed -i 's/\/\.coverage\..*$//g' coverage_reports.txt - # remove duplicates - - awk '!seen[$0]++' coverage_reports.txt > coverage_reports.txt.tmp - - mv coverage_reports.txt.tmp coverage_reports.txt - # switch newlines for spaces - - sed -i -e ':a' -e 'N' -e '$!ba' -e 's/\n/ /g' coverage_reports.txt - # use all the tmp dir's as locations to collect coverage data - - coverage combine $PWD `cat coverage_reports.txt` + - coverage combine - coverage report - coveralls --rcfile=$PWD/.coveragerc -- cgit v0.12 From a2e35978f159dc4f131451213c2a8c78d4b5835c Mon Sep 17 00:00:00 2001 From: Gabriel Russell Date: Wed, 13 Dec 2017 17:03:00 -0500 Subject: test for readonly cache --- test/CacheDir/readonly-cache.py | 65 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100755 test/CacheDir/readonly-cache.py diff --git a/test/CacheDir/readonly-cache.py b/test/CacheDir/readonly-cache.py new file mode 100755 index 0000000..05c46e6 --- /dev/null +++ b/test/CacheDir/readonly-cache.py @@ -0,0 +1,65 @@ +#!/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 accessing cache works even if it's read-only. +""" + +import os +import TestSCons + +test = TestSCons.TestSCons() + +test.write(['SConstruct'], """\ +CacheDir('cache') +Command('file.out', 'file.in', Copy('$TARGET', '$SOURCE')) +""") + +test.write('file.in', "file.in\n") + +test.run(arguments = '--debug=explain --cache-debug=- .') + +test.unlink('file.out') + +test.run(arguments = '--debug=explain --cache-debug=- .') + +test.unlink('file.out') + +for root, dirs, files in os.walk("cache",topdown=False): + for file in files: + os.chmod(os.path.join(root,file),0o444) + for dir in dirs: + os.chmod(os.path.join(root,dir),0o555) + +test.run(arguments = '--debug=explain --cache-debug=- .') + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: -- cgit v0.12 From 74080a2f9ce5595a7fb9d88433cec9c83c99969c Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Tue, 16 Jan 2018 23:31:47 -0500 Subject: moved coverage check for tests to common location. --- QMTest/TestSCons.py | 5 +++++ test/Repository/M4.py | 2 +- test/exitfns.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/QMTest/TestSCons.py b/QMTest/TestSCons.py index f0d25cb..ef907d8 100644 --- a/QMTest/TestSCons.py +++ b/QMTest/TestSCons.py @@ -1036,6 +1036,11 @@ SConscript( sconscript ) # to use cygwin compilers on cmd.exe -> uncomment following line #Configure_lib = 'm' + def coverage_run(self): + """ Check if the the tests are being run under coverage. + """ + return 'COVERAGE_PROCESS_START' in os.environ or 'COVERAGE_FILE' in os.environ + def skip_if_not_msvc(self, check_platform=True): """ Check whether we are on a Windows platform and skip the test if not. This check can be omitted by setting diff --git a/test/Repository/M4.py b/test/Repository/M4.py index 29647e9..8fa91ab 100644 --- a/test/Repository/M4.py +++ b/test/Repository/M4.py @@ -37,7 +37,7 @@ _python_ = TestSCons._python_ test = TestSCons.TestSCons() # TODO: figure out how to write the coverage data to the locked folder or maybe somewhere else -if 'COVERAGE_PROCESS_START' in os.environ: +if test.coverage_run(): test.skip_test("this test locks the folder for writing meaning coverage data can not be written; skipping test.") test.subdir('work', 'repository', ['repository', 'src']) diff --git a/test/exitfns.py b/test/exitfns.py index c0da861..fca44b8 100644 --- a/test/exitfns.py +++ b/test/exitfns.py @@ -31,7 +31,7 @@ test = TestSCons.TestSCons() # also exclude these tests since it overides the exit function which doesnt work with coverage # # more info here: https://coverage.readthedocs.io/en/coverage-4.4.2/subprocess.html# # TODO: figure out how to cover tests which use exit functions -if 'COVERAGE_PROCESS_START' in os.environ: +if test.coverage_run(): test.skip_test("This test replaces the exit function which is needed by coverage to write test data; skipping test.") sconstruct = """ -- cgit v0.12 From 3bf2fcc70bc91bb46578292e317cde77a5018c92 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Wed, 17 Jan 2018 09:09:26 -0700 Subject: Use prepend for inserts A number of places "append to the beginning", a better word to use here is "prepend". This is a documentation issue only, no executable statements are affected. Signed-off-by: Mats Wichmann --- QMTest/TestCommon.py | 2 +- src/CHANGES.txt | 1 + src/engine/SCons/Defaults.xml | 30 ++++++++++++++++-------------- src/engine/SCons/Platform/posix.xml | 4 ++-- src/engine/SCons/Tool/fortran.xml | 13 +++++++------ src/engine/SCons/Tool/msvc.xml | 5 +++-- src/engine/SCons/Tool/swig.xml | 7 ++++--- 7 files changed, 34 insertions(+), 28 deletions(-) diff --git a/QMTest/TestCommon.py b/QMTest/TestCommon.py index a475ddc..47a149b 100644 --- a/QMTest/TestCommon.py +++ b/QMTest/TestCommon.py @@ -680,7 +680,7 @@ class TestCommon(TestCmd): The parameters are the same as the base TestCmd.run() method, with the addition of: - options Extra options that get appended to the beginning + options Extra options that get prepended to the beginning of the arguments. stdout The expected standard output from diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 42b44d7..accd2f0 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -13,6 +13,7 @@ RELEASE 3.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE From Mats Wichmann: - Updated manpage scons.xml to fix a nested list problem + - Updated doc terminionly: use prepend instead of append as appropriate From Andrew Featherstone - Removed unused --warn options from the man page and source code. diff --git a/src/engine/SCons/Defaults.xml b/src/engine/SCons/Defaults.xml index 23a68dc..b3899d9 100644 --- a/src/engine/SCons/Defaults.xml +++ b/src/engine/SCons/Defaults.xml @@ -76,7 +76,8 @@ An automatically-generated construction variable containing the C preprocessor command-line options to define values. The value of &cv-_CPPDEFFLAGS; is created -by appending &cv-CPPDEFPREFIX; and &cv-CPPDEFSUFFIX; +by respectively prepending and appending +&cv-CPPDEFPREFIX; and &cv-CPPDEFSUFFIX; to the beginning and end of each definition in &cv-CPPDEFINES;. @@ -99,7 +100,8 @@ If &cv-CPPDEFINES; is a string, the values of the &cv-CPPDEFPREFIX; and &cv-CPPDEFSUFFIX; construction variables -will be added to the beginning and end. +will be respectively prepended and appended to the beginning and end +of each definition in &cv-CPPDEFINES;. @@ -113,7 +115,7 @@ If &cv-CPPDEFINES; is a list, the values of the &cv-CPPDEFPREFIX; and &cv-CPPDEFSUFFIX; construction variables -will be appended to the beginning and end +will be respectively prepended and appended to the beginning and end of each element in the list. If any element is a list or tuple, then the first item is the name being @@ -131,7 +133,7 @@ If &cv-CPPDEFINES; is a dictionary, the values of the &cv-CPPDEFPREFIX; and &cv-CPPDEFSUFFIX; construction variables -will be appended to the beginning and end +will be respectively prepended and appended to the beginning and end of each item from the dictionary. The key of each dictionary item is a name being defined @@ -159,7 +161,7 @@ env = Environment(CPPDEFINES={'B':2, 'A':None}) The prefix used to specify preprocessor definitions on the C compiler command line. -This will be appended to the beginning of each definition +This will be prepended to the beginning of each definition in the &cv-CPPDEFINES; construction variable when the &cv-_CPPDEFFLAGS; variable is automatically generated. @@ -185,7 +187,7 @@ An automatically-generated construction variable containing the C preprocessor command-line options for specifying directories to be searched for include files. The value of &cv-_CPPINCFLAGS; is created -by appending &cv-INCPREFIX; and &cv-INCSUFFIX; +by respectively prepending and appending &cv-INCPREFIX; and &cv-INCSUFFIX; to the beginning and end of each directory in &cv-CPPPATH;. @@ -227,7 +229,7 @@ through the automatically-generated &cv-_CPPINCFLAGS; construction variable, which is constructed by -appending the values of the +respectively prepending and appending the value of the &cv-INCPREFIX; and &cv-INCSUFFIX; construction variables to the beginning and end @@ -304,7 +306,7 @@ The default list is: The prefix used to specify an include directory on the C compiler command line. -This will be appended to the beginning of each directory +This will be prepended to the beginning of each directory in the &cv-CPPPATH; and &cv-FORTRANPATH; construction variables when the &cv-_CPPINCFLAGS; and &cv-_FORTRANINCFLAGS; variables are automatically generated. @@ -388,7 +390,7 @@ An automatically-generated construction variable containing the linker command-line options for specifying directories to be searched for library. The value of &cv-_LIBDIRFLAGS; is created -by appending &cv-LIBDIRPREFIX; and &cv-LIBDIRSUFFIX; +by respectively prepending and appending &cv-LIBDIRPREFIX; and &cv-LIBDIRSUFFIX; to the beginning and end of each directory in &cv-LIBPATH;. @@ -399,7 +401,7 @@ of each directory in &cv-LIBPATH;. The prefix used to specify a library directory on the linker command line. -This will be appended to the beginning of each directory +This will be prepended to the beginning of each directory in the &cv-LIBPATH; construction variable when the &cv-_LIBDIRFLAGS; variable is automatically generated. @@ -424,7 +426,7 @@ An automatically-generated construction variable containing the linker command-line options for specifying libraries to be linked with the resulting target. The value of &cv-_LIBFLAGS; is created -by appending &cv-LIBLINKPREFIX; and &cv-LIBLINKSUFFIX; +by respectively prepending and appending &cv-LIBLINKPREFIX; and &cv-LIBLINKSUFFIX; to the beginning and end of each filename in &cv-LIBS;. @@ -435,7 +437,7 @@ of each filename in &cv-LIBS;. The prefix used to specify a library to link on the linker command line. -This will be appended to the beginning of each library +This will be prepended to the beginning of each library in the &cv-LIBS; construction variable when the &cv-_LIBFLAGS; variable is automatically generated. @@ -489,7 +491,7 @@ through the automatically-generated &cv-_LIBDIRFLAGS; construction variable, which is constructed by -appending the values of the +respectively prepending and appending the values of the &cv-LIBDIRPREFIX; and &cv-LIBDIRSUFFIX; construction variables to the beginning and end @@ -520,7 +522,7 @@ through the automatically-generated &cv-_LIBFLAGS; construction variable, which is constructed by -appending the values of the +respectively prepending and appending the values of the &cv-LIBLINKPREFIX; and &cv-LIBLINKSUFFIX; construction variables to the beginning and end diff --git a/src/engine/SCons/Platform/posix.xml b/src/engine/SCons/Platform/posix.xml index e96dd63..80b5e8d 100644 --- a/src/engine/SCons/Platform/posix.xml +++ b/src/engine/SCons/Platform/posix.xml @@ -46,7 +46,7 @@ An automatically-generated construction variable containing the rpath flags to be used when linking a program with shared libraries. The value of &cv-_RPATH; is created -by appending &cv-RPATHPREFIX; and &cv-RPATHSUFFIX; +by respectively prepending &cv-RPATHPREFIX; and appending &cv-RPATHSUFFIX; to the beginning and end of each directory in &cv-RPATH;. @@ -58,7 +58,7 @@ of each directory in &cv-RPATH;. The prefix used to specify a directory to be searched for shared libraries when running programs. -This will be appended to the beginning of each directory +This will be prepended to the beginning of each directory in the &cv-RPATH; construction variable when the &cv-_RPATH; variable is automatically generated. diff --git a/src/engine/SCons/Tool/fortran.xml b/src/engine/SCons/Tool/fortran.xml index 5383d5f..6bfe2bf 100644 --- a/src/engine/SCons/Tool/fortran.xml +++ b/src/engine/SCons/Tool/fortran.xml @@ -125,7 +125,8 @@ containing the Fortran compiler command-line options for specifying directories to be searched for include files and module files. The value of &cv-link-_FORTRANINCFLAGS; is created -by prepending/appending &cv-link-INCPREFIX; and &cv-link-INCSUFFIX; +by respectively prepending and appending +&cv-link-INCPREFIX; and &cv-link-INCSUFFIX; to the beginning and end of each directory in &cv-link-FORTRANPATH;. @@ -148,7 +149,7 @@ for module files, as well. The prefix used to specify a module directory on the Fortran compiler command line. -This will be appended to the beginning of the directory +This will be prepended to the beginning of the directory in the &cv-link-FORTRANMODDIR; construction variables when the &cv-link-_FORTRANMODFLAG; variables is automatically generated. @@ -160,7 +161,7 @@ when the &cv-link-_FORTRANMODFLAG; variables is automatically generated. The suffix used to specify a module directory on the Fortran compiler command line. -This will be appended to the beginning of the directory +This will be appended to the end of the directory in the &cv-link-FORTRANMODDIR; construction variables when the &cv-link-_FORTRANMODFLAG; variables is automatically generated. @@ -176,8 +177,8 @@ for specifying the directory location where the Fortran compiler should place any module files that happen to get generated during compilation. The value of &cv-link-_FORTRANMODFLAG; is created -by prepending/appending &cv-link-FORTRANMODDIRPREFIX; and -&cv-link-FORTRANMODDIRSUFFIX; +by respectively prepending and appending +&cv-link-FORTRANMODDIRPREFIX; and &cv-link-FORTRANMODDIRSUFFIX; to the beginning and end of the directory in &cv-link-FORTRANMODDIR;. @@ -250,7 +251,7 @@ through the automatically-generated &cv-link-_FORTRANINCFLAGS; construction variable, which is constructed by -appending the values of the +respectiviely prepending and appending the values of the &cv-link-INCPREFIX; and &cv-link-INCSUFFIX; construction variables to the beginning and end diff --git a/src/engine/SCons/Tool/msvc.xml b/src/engine/SCons/Tool/msvc.xml index 1823a89..d4ffe0d 100644 --- a/src/engine/SCons/Tool/msvc.xml +++ b/src/engine/SCons/Tool/msvc.xml @@ -305,7 +305,8 @@ containing the command-line options for specifying directories to be searched by the resource compiler. The value of &cv-RCINCFLAGS; is created -by appending &cv-RCINCPREFIX; and &cv-RCINCSUFFIX; +by respectively prepending and appending +&cv-RCINCPREFIX; and &cv-RCINCSUFFIX; to the beginning and end of each directory in &cv-CPPPATH;. @@ -317,7 +318,7 @@ of each directory in &cv-CPPPATH;. The prefix (flag) used to specify an include directory on the resource compiler command line. -This will be appended to the beginning of each directory +This will be prepended to the beginning of each directory in the &cv-CPPPATH; construction variable when the &cv-RCINCFLAGS; variable is expanded. diff --git a/src/engine/SCons/Tool/swig.xml b/src/engine/SCons/Tool/swig.xml index 1160804..db83e6b 100644 --- a/src/engine/SCons/Tool/swig.xml +++ b/src/engine/SCons/Tool/swig.xml @@ -153,7 +153,8 @@ An automatically-generated construction variable containing the SWIG command-line options for specifying directories to be searched for included files. The value of &cv-_SWIGINCFLAGS; is created -by appending &cv-SWIGINCPREFIX; and &cv-SWIGINCSUFFIX; +by respectively prepending and appending +&cv-SWIGINCPREFIX; and &cv-SWIGINCSUFFIX; to the beginning and end of each directory in &cv-SWIGPATH;. @@ -164,7 +165,7 @@ of each directory in &cv-SWIGPATH;. The prefix used to specify an include directory on the SWIG command line. -This will be appended to the beginning of each directory +This will be prepended to the beginning of each directory in the &cv-SWIGPATH; construction variable when the &cv-_SWIGINCFLAGS; variable is automatically generated. @@ -238,7 +239,7 @@ through the automatically-generated &cv-_SWIGINCFLAGS; construction variable, which is constructed by -appending the values of the +respectively prepending and appending the values of the &cv-SWIGINCPREFIX; and &cv-SWIGINCSUFFIX; construction variables to the beginning and end -- cgit v0.12 From 3558b01a8c546cdd08f46d0d70213dc327dab88b Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Wed, 17 Jan 2018 12:12:49 -0500 Subject: fixed the coveralls badge to point to master branch, and small change to descriction of appveyor link. --- README.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 38086b6..8eb5af1 100644 --- a/README.rst +++ b/README.rst @@ -19,10 +19,10 @@ SCons - a software construction tool .. image:: https://ci.appveyor.com/api/projects/status/github/SCons/scons?svg=true&branch=master :target: https://ci.appveyor.com/project/SCons/scons - :alt: AppVeyor CI Status + :alt: AppVeyor CI build Status -.. image:: https://coveralls.io/repos/github/SCons/scons/badge.svg - :target: https://coveralls.io/github/SCons/scons +.. image:: https://coveralls.io/repos/github/SCons/scons/badge.svg?branch=master + :target: https://coveralls.io/github/SCons/scons?branch=master :alt: Coveralls.io Coverage Status -- cgit v0.12 From b497fb596e4751fe95bb25c1d9297d01956baf99 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Wed, 17 Jan 2018 10:52:53 -0700 Subject: correcting typo --- src/engine/SCons/Tool/fortran.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/SCons/Tool/fortran.xml b/src/engine/SCons/Tool/fortran.xml index 6bfe2bf..9af41dd 100644 --- a/src/engine/SCons/Tool/fortran.xml +++ b/src/engine/SCons/Tool/fortran.xml @@ -251,7 +251,7 @@ through the automatically-generated &cv-link-_FORTRANINCFLAGS; construction variable, which is constructed by -respectiviely prepending and appending the values of the +respectively prepending and appending the values of the &cv-link-INCPREFIX; and &cv-link-INCSUFFIX; construction variables to the beginning and end -- cgit v0.12 From 82c09769f9547c99cb0bbb3b746ed10dfe05cf6f Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Tue, 2 Jan 2018 13:48:28 +0000 Subject: Do not add unnormalised entries to PATH in scons.bat --- src/CHANGES.txt | 6 ++++++ src/script/scons.bat | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index accd2f0..f5127dd 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -7,6 +7,12 @@ RELEASE 3.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE + From Ray Donnelly: + - Do not assume execeutables launched via scons.bat can handle unnormalised paths. + Python 3.6 cannot for a start: https://bugs.python.org/issue32457. To be exact + this means we must not add '..', and instead use 'pushd' and '%CD%' to add the + parent directory to PATH. + From Gary Oberbrunner: - Fix bug when Installing multiple subdirs outside the source tree - fix to_str to handle None without raising exception diff --git a/src/script/scons.bat b/src/script/scons.bat index fddeca4..a9e777e 100644 --- a/src/script/scons.bat +++ b/src/script/scons.bat @@ -16,7 +16,9 @@ goto endscons :WinNT setlocal @REM ensure the script will be executed with the Python it was installed for -set path=%~dp0;%~dp0..;%path% +pushd %~dp0.. +set path=%~dp0;%CD%;%path% +popd @REM try the script named as the .bat file in current dir, then in Scripts subdir set scriptname=%~dp0%~n0.py if not exist "%scriptname%" set scriptname=%~dp0Scripts\%~n0.py -- cgit v0.12 From 064382284c23e96e1ee6a3788cf5ebffcb46236e Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 20 Jan 2018 11:44:49 -0500 Subject: Reorder new entries in CHANGES.txt alphabetically as is our policy. Also clarify some of the notes --- src/CHANGES.txt | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index f5127dd..628d2b5 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -8,18 +8,11 @@ RELEASE 3.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE From Ray Donnelly: - - Do not assume execeutables launched via scons.bat can handle unnormalised paths. - Python 3.6 cannot for a start: https://bugs.python.org/issue32457. To be exact - this means we must not add '..', and instead use 'pushd' and '%CD%' to add the - parent directory to PATH. - - From Gary Oberbrunner: - - Fix bug when Installing multiple subdirs outside the source tree - - fix to_str to handle None without raising exception - - From Mats Wichmann: - - Updated manpage scons.xml to fix a nested list problem - - Updated doc terminionly: use prepend instead of append as appropriate + - Fix the PATH created by scons.bat (and other .bat files) to provide a normalized + PATH. Some pythons in the 3.6 series are no longer able to handle paths which + have ".." in them and end up crashing. This is done by cd'ing into the directory + we want to add to the path and then useing %CD% to give us the normalized directory + See bug filed under Python 3.6: https://bugs.python.org/issue32457. From Andrew Featherstone - Removed unused --warn options from the man page and source code. @@ -29,6 +22,14 @@ RELEASE 3.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE - Updated Jar builder to flatten source list which could contain embedded lists - Removed some magic numbers from jar.py on behalf of Mats Wichmann (mats@linux.com) + From Gary Oberbrunner: + - Fix bug when Installing multiple subdirs outside the source tree + - fix to_str to handle None without raising exception + + From Mats Wichmann: + - Updated manpage scons.xml to fix a nested list problem + - Updated doc terminionly: use prepend instead of append as appropriate + RELEASE 3.0.1 - Mon, 12 Nov 2017 15:31:33 -0700 From Daniel Moody: -- cgit v0.12 From 275cf49d568e049f176798495d81324ebae7f628 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sun, 21 Jan 2018 15:40:47 -0500 Subject: Clarify why scons.bat change is being done. --- src/CHANGES.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 628d2b5..c02bb36 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -13,6 +13,9 @@ RELEASE 3.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE have ".." in them and end up crashing. This is done by cd'ing into the directory we want to add to the path and then useing %CD% to give us the normalized directory See bug filed under Python 3.6: https://bugs.python.org/issue32457. + Note: On Win32 PATH's which have not been normalized may cause undefined behavior + by other executables being run by SCons (or any subprocesses of executables being run by SCons). + Resolving this issue should eliminate that possibility going forward. From Andrew Featherstone - Removed unused --warn options from the man page and source code. -- cgit v0.12 From edffc6d98dbd4515827b56671f985209c2f63f3d Mon Sep 17 00:00:00 2001 From: William Deegan Date: Mon, 29 Jan 2018 18:05:19 -0800 Subject: Remove SCons.Options code which has long been deprecated and already removed from documents. Also remove associated tests. --- src/CHANGES.txt | 4 + src/engine/SCons/Options/BoolOption.py | 50 ---- src/engine/SCons/Options/EnumOption.py | 50 ---- src/engine/SCons/Options/ListOption.py | 50 ---- src/engine/SCons/Options/PackageOption.py | 50 ---- src/engine/SCons/Options/PathOption.py | 76 ------ src/engine/SCons/Options/__init__.py | 67 ------ src/engine/SCons/Script/__init__.py | 7 - test/Deprecated/Options/BoolOption.py | 92 ------- test/Deprecated/Options/EnumOption.py | 118 --------- test/Deprecated/Options/ListOption.py | 193 --------------- test/Deprecated/Options/Options.py | 386 ------------------------------ test/Deprecated/Options/PackageOption.py | 98 -------- test/Deprecated/Options/PathOption.py | 296 ----------------------- test/Deprecated/Options/chdir.py | 80 ------- test/Deprecated/Options/help.py | 170 ------------- test/Deprecated/Options/import.py | 78 ------ 17 files changed, 4 insertions(+), 1861 deletions(-) delete mode 100644 src/engine/SCons/Options/BoolOption.py delete mode 100644 src/engine/SCons/Options/EnumOption.py delete mode 100644 src/engine/SCons/Options/ListOption.py delete mode 100644 src/engine/SCons/Options/PackageOption.py delete mode 100644 src/engine/SCons/Options/PathOption.py delete mode 100644 src/engine/SCons/Options/__init__.py delete mode 100644 test/Deprecated/Options/BoolOption.py delete mode 100644 test/Deprecated/Options/EnumOption.py delete mode 100644 test/Deprecated/Options/ListOption.py delete mode 100644 test/Deprecated/Options/Options.py delete mode 100644 test/Deprecated/Options/PackageOption.py delete mode 100644 test/Deprecated/Options/PathOption.py delete mode 100644 test/Deprecated/Options/chdir.py delete mode 100644 test/Deprecated/Options/help.py delete mode 100644 test/Deprecated/Options/import.py diff --git a/src/CHANGES.txt b/src/CHANGES.txt index c02bb36..d2587e3 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -17,6 +17,10 @@ RELEASE 3.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE by other executables being run by SCons (or any subprocesses of executables being run by SCons). Resolving this issue should eliminate that possibility going forward. + From William Deegan: + - Remove long deprecated SCons.Options code and tests. This removes BoolOption,EnumOption, + ListOption,PackageOption, and PathOption which have been replaced by *Variable() many years ago. + From Andrew Featherstone - Removed unused --warn options from the man page and source code. diff --git a/src/engine/SCons/Options/BoolOption.py b/src/engine/SCons/Options/BoolOption.py deleted file mode 100644 index 452fdd3..0000000 --- a/src/engine/SCons/Options/BoolOption.py +++ /dev/null @@ -1,50 +0,0 @@ -# -# __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__" - -__doc__ = """Place-holder for the old SCons.Options module hierarchy - -This is for backwards compatibility. The new equivalent is the Variables/ -class hierarchy. These will have deprecation warnings added (some day), -and will then be removed entirely (some day). -""" - -import SCons.Variables -import SCons.Warnings - -warned = False - -def BoolOption(*args, **kw): - global warned - if not warned: - msg = "The BoolOption() function is deprecated; use the BoolVariable() function instead." - SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg) - warned = True - return SCons.Variables.BoolVariable(*args, **kw) - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/src/engine/SCons/Options/EnumOption.py b/src/engine/SCons/Options/EnumOption.py deleted file mode 100644 index 2db158d..0000000 --- a/src/engine/SCons/Options/EnumOption.py +++ /dev/null @@ -1,50 +0,0 @@ -# -# __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__" - -__doc__ = """Place-holder for the old SCons.Options module hierarchy - -This is for backwards compatibility. The new equivalent is the Variables/ -class hierarchy. These will have deprecation warnings added (some day), -and will then be removed entirely (some day). -""" - -import SCons.Variables -import SCons.Warnings - -warned = False - -def EnumOption(*args, **kw): - global warned - if not warned: - msg = "The EnumOption() function is deprecated; use the EnumVariable() function instead." - SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg) - warned = True - return SCons.Variables.EnumVariable(*args, **kw) - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/src/engine/SCons/Options/ListOption.py b/src/engine/SCons/Options/ListOption.py deleted file mode 100644 index 4167d8e..0000000 --- a/src/engine/SCons/Options/ListOption.py +++ /dev/null @@ -1,50 +0,0 @@ -# -# __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__" - -__doc__ = """Place-holder for the old SCons.Options module hierarchy - -This is for backwards compatibility. The new equivalent is the Variables/ -class hierarchy. These will have deprecation warnings added (some day), -and will then be removed entirely (some day). -""" - -import SCons.Variables -import SCons.Warnings - -warned = False - -def ListOption(*args, **kw): - global warned - if not warned: - msg = "The ListOption() function is deprecated; use the ListVariable() function instead." - SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg) - warned = True - return SCons.Variables.ListVariable(*args, **kw) - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/src/engine/SCons/Options/PackageOption.py b/src/engine/SCons/Options/PackageOption.py deleted file mode 100644 index ba0608a..0000000 --- a/src/engine/SCons/Options/PackageOption.py +++ /dev/null @@ -1,50 +0,0 @@ -# -# __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__" - -__doc__ = """Place-holder for the old SCons.Options module hierarchy - -This is for backwards compatibility. The new equivalent is the Variables/ -class hierarchy. These will have deprecation warnings added (some day), -and will then be removed entirely (some day). -""" - -import SCons.Variables -import SCons.Warnings - -warned = False - -def PackageOption(*args, **kw): - global warned - if not warned: - msg = "The PackageOption() function is deprecated; use the PackageVariable() function instead." - SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg) - warned = True - return SCons.Variables.PackageVariable(*args, **kw) - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/src/engine/SCons/Options/PathOption.py b/src/engine/SCons/Options/PathOption.py deleted file mode 100644 index 0cc2988..0000000 --- a/src/engine/SCons/Options/PathOption.py +++ /dev/null @@ -1,76 +0,0 @@ -# -# __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__" - -__doc__ = """Place-holder for the old SCons.Options module hierarchy - -This is for backwards compatibility. The new equivalent is the Variables/ -class hierarchy. These will have deprecation warnings added (some day), -and will then be removed entirely (some day). -""" - -import SCons.Variables -import SCons.Warnings - -warned = False - -class _PathOptionClass(object): - def warn(self): - global warned - if not warned: - msg = "The PathOption() function is deprecated; use the PathVariable() function instead." - SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg) - warned = True - - def __call__(self, *args, **kw): - self.warn() - return SCons.Variables.PathVariable(*args, **kw) - - def PathAccept(self, *args, **kw): - self.warn() - return SCons.Variables.PathVariable.PathAccept(*args, **kw) - - def PathIsDir(self, *args, **kw): - self.warn() - return SCons.Variables.PathVariable.PathIsDir(*args, **kw) - - def PathIsDirCreate(self, *args, **kw): - self.warn() - return SCons.Variables.PathVariable.PathIsDirCreate(*args, **kw) - - def PathIsFile(self, *args, **kw): - self.warn() - return SCons.Variables.PathVariable.PathIsFile(*args, **kw) - - def PathExists(self, *args, **kw): - self.warn() - return SCons.Variables.PathVariable.PathExists(*args, **kw) - -PathOption = _PathOptionClass() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/src/engine/SCons/Options/__init__.py b/src/engine/SCons/Options/__init__.py deleted file mode 100644 index 2544aec..0000000 --- a/src/engine/SCons/Options/__init__.py +++ /dev/null @@ -1,67 +0,0 @@ -# -# __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__" - -__doc__ = """Place-holder for the old SCons.Options module hierarchy - -This is for backwards compatibility. The new equivalent is the Variables/ -class hierarchy. These will have deprecation warnings added (some day), -and will then be removed entirely (some day). -""" - -import SCons.Variables -import SCons.Warnings - -from .BoolOption import BoolOption # okay -from .EnumOption import EnumOption # okay -from .ListOption import ListOption # naja -from .PackageOption import PackageOption # naja -from .PathOption import PathOption # okay - -warned = False - -class Options(SCons.Variables.Variables): - def __init__(self, *args, **kw): - global warned - if not warned: - msg = "The Options class is deprecated; use the Variables class instead." - SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg) - warned = True - SCons.Variables.Variables.__init__(self, *args, **kw) - - def AddOptions(self, *args, **kw): - return SCons.Variables.Variables.AddVariables(self, *args, **kw) - - def UnknownOptions(self, *args, **kw): - return SCons.Variables.Variables.UnknownVariables(self, *args, **kw) - - def FormatOptionHelpText(self, *args, **kw): - return SCons.Variables.Variables.FormatVariableHelpText(self, *args, - **kw) - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py index 5bdd63e..a05c541 100644 --- a/src/engine/SCons/Script/__init__.py +++ b/src/engine/SCons/Script/__init__.py @@ -81,7 +81,6 @@ import SCons.Action import SCons.Builder import SCons.Environment import SCons.Node.FS -import SCons.Options import SCons.Platform import SCons.Scanner import SCons.SConf @@ -162,12 +161,6 @@ ListVariable = SCons.Variables.ListVariable PackageVariable = SCons.Variables.PackageVariable PathVariable = SCons.Variables.PathVariable -# Deprecated names that will go away some day. -BoolOption = SCons.Options.BoolOption -EnumOption = SCons.Options.EnumOption -ListOption = SCons.Options.ListOption -PackageOption = SCons.Options.PackageOption -PathOption = SCons.Options.PathOption # Action factories. Chmod = SCons.Defaults.Chmod diff --git a/test/Deprecated/Options/BoolOption.py b/test/Deprecated/Options/BoolOption.py deleted file mode 100644 index 5d12fc6..0000000 --- a/test/Deprecated/Options/BoolOption.py +++ /dev/null @@ -1,92 +0,0 @@ -#!/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__" - -""" -Test the BoolOption canned Option type. -""" - -import TestSCons - -test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) - -SConstruct_path = test.workpath('SConstruct') - -def check(expect): - result = test.stdout().split('\n') - assert result[1:len(expect)+1] == expect, (result[1:len(expect)+1], expect) - - -test.write(SConstruct_path, """\ -SetOption('warn', 'deprecated-options') -from SCons.Options.BoolOption import BoolOption -BO = BoolOption - -from SCons.Options import BoolOption - -opts = Options(args=ARGUMENTS) -opts.AddOptions( - BoolOption('warnings', 'compilation with -Wall and similiar', 1), - BO('profile', 'create profiling informations', 0), - ) - -env = Environment(options=opts) -Help(opts.GenerateHelpText(env)) - -print(env['warnings']) -print(env['profile']) - -Default(env.Alias('dummy', None)) -""") - - -warnings = """ -scons: warning: The Options class is deprecated; use the Variables class instead. -%s -scons: warning: The BoolOption\\(\\) function is deprecated; use the BoolVariable\\(\\) function instead. -%s""" % (TestSCons.file_expr, TestSCons.file_expr) - -test.run(stderr=warnings) - -check([str(True), str(False)]) - -test.run(arguments='warnings=0 profile=no profile=true', stderr=warnings) -check([str(False), str(True)]) - -expect_stderr = (warnings + """ -scons: \\*\\*\\* Error converting option: warnings -Invalid value for boolean option: irgendwas -""" + TestSCons.file_expr) - -test.run(arguments='warnings=irgendwas', stderr=expect_stderr, status=2) - - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Deprecated/Options/EnumOption.py b/test/Deprecated/Options/EnumOption.py deleted file mode 100644 index 02afef1..0000000 --- a/test/Deprecated/Options/EnumOption.py +++ /dev/null @@ -1,118 +0,0 @@ -#!/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__" - -""" -Test the EnumOption canned Option type. -""" - -import os.path - -import TestSCons - -test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) - -SConstruct_path = test.workpath('SConstruct') - -def check(expect): - result = test.stdout().split('\n') - assert result[1:len(expect)+1] == expect, (result[1:len(expect)+1], expect) - - - -test.write(SConstruct_path, """\ - -from SCons.Options.EnumOption import EnumOption -EO = EnumOption - -from SCons.Options import EnumOption - -list_of_libs = Split('x11 gl qt ical') - -opts = Options(args=ARGUMENTS) -opts.AddOptions( - EnumOption('debug', 'debug output and symbols', 'no', - allowed_values=('yes', 'no', 'full'), - map={}, ignorecase=0), # case sensitive - EnumOption('guilib', 'gui lib to use', 'gtk', - allowed_values=('motif', 'gtk', 'kde'), - map={}, ignorecase=1), # case insensitive - EO('some', 'some option', 'xaver', - allowed_values=('xaver', 'eins'), - map={}, ignorecase=2), # make lowercase - ) - -env = Environment(options=opts) -Help(opts.GenerateHelpText(env)) - -print(env['debug']) -print(env['guilib']) -print(env['some']) - -Default(env.Alias('dummy', None)) -""") - - - -warnings = """ -scons: warning: The Options class is deprecated; use the Variables class instead. -%s -scons: warning: The EnumOption\\(\\) function is deprecated; use the EnumVariable\\(\\) function instead. -%s""" % (TestSCons.file_expr, TestSCons.file_expr) - -test.run(stderr=warnings); check(['no', 'gtk', 'xaver']) - -test.run(arguments='debug=yes guilib=Motif some=xAVER', stderr=warnings) -check(['yes', 'Motif', 'xaver']) - -test.run(arguments='debug=full guilib=KdE some=EiNs', stderr=warnings) -check(['full', 'KdE', 'eins']) - -expect_stderr = warnings + """ -scons: \\*\\*\\* Invalid value for option debug: FULL. Valid values are: \\('yes', 'no', 'full'\\) -""" + TestSCons.file_expr - -test.run(arguments='debug=FULL', stderr=expect_stderr, status=2) - -expect_stderr = warnings + """ -scons: \\*\\*\\* Invalid value for option guilib: irgendwas. Valid values are: \\('motif', 'gtk', 'kde'\\) -""" + TestSCons.file_expr - -test.run(arguments='guilib=IrGeNdwas', stderr=expect_stderr, status=2) - -expect_stderr = warnings + """ -scons: \\*\\*\\* Invalid value for option some: irgendwas. Valid values are: \\('xaver', 'eins'\\) -""" + TestSCons.file_expr - -test.run(arguments='some=IrGeNdwas', stderr=expect_stderr, status=2) - - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Deprecated/Options/ListOption.py b/test/Deprecated/Options/ListOption.py deleted file mode 100644 index 42af511..0000000 --- a/test/Deprecated/Options/ListOption.py +++ /dev/null @@ -1,193 +0,0 @@ -#!/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__" - -""" -Test the ListOption canned Option type. -""" - -import os - -import TestSCons - - -test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) - -SConstruct_path = test.workpath('SConstruct') - -def check(expect): - result = test.stdout().split('\n') - r = result[1:len(expect)+1] - assert r == expect, (r, expect) - - - -test.write(SConstruct_path, """\ -from SCons.Options.ListOption import ListOption -LO = ListOption - -from SCons.Options import ListOption - -list_of_libs = Split('x11 gl qt ical') - -optsfile = 'scons.options' -opts = Options(optsfile, args=ARGUMENTS) -opts.AddOptions( - ListOption('shared', - 'libraries to build as shared libraries', - 'all', - names = list_of_libs, - map = {'GL':'gl', 'QT':'qt'}), - LO('listvariable', 'listvariable help', 'all', names=['l1', 'l2', 'l3']) - ) - -env = Environment(options=opts) -opts.Save(optsfile, env) -Help(opts.GenerateHelpText(env)) - -print(env['shared']) - -if 'ical' in env['shared']: - print('1') -else: - print('0') - -print(" ".join(env['shared'])) - -print(env.subst('$shared')) -# Test subst_path() because it's used in $CPPDEFINES expansions. -print(env.subst_path('$shared')) -Default(env.Alias('dummy', None)) -""") - -warnings = """ -scons: warning: The Options class is deprecated; use the Variables class instead. -%s -scons: warning: The ListOption\\(\\) function is deprecated; use the ListVariable\\(\\) function instead. -%s""" % (TestSCons.file_expr, TestSCons.file_expr) - -test.run(stderr=warnings) -check(['all', '1', 'gl ical qt x11', 'gl ical qt x11', - "['gl ical qt x11']"]) - -expect = "shared = 'all'"+os.linesep+"listvariable = 'all'"+os.linesep -test.must_match(test.workpath('scons.options'), expect) - -check(['all', '1', 'gl ical qt x11', 'gl ical qt x11', - "['gl ical qt x11']"]) - -test.run(arguments='shared=none', stderr=warnings) -check(['none', '0', '', '', "['']"]) - -test.run(arguments='shared=', stderr=warnings) -check(['none', '0', '', '', "['']"]) - -test.run(arguments='shared=x11,ical', stderr=warnings) -check(['ical,x11', '1', 'ical x11', 'ical x11', - "['ical x11']"]) - -test.run(arguments='shared=x11,,ical,,', stderr=warnings) -check(['ical,x11', '1', 'ical x11', 'ical x11', - "['ical x11']"]) - -test.run(arguments='shared=GL', stderr=warnings) -check(['gl', '0', 'gl', 'gl']) - -test.run(arguments='shared=QT,GL', stderr=warnings) -check(['gl,qt', '0', 'gl qt', 'gl qt', "['gl qt']"]) - - -expect_stderr = warnings + """ -scons: \\*\\*\\* Error converting option: shared -Invalid value\\(s\\) for option: foo -""" + TestSCons.file_expr - -test.run(arguments='shared=foo', stderr=expect_stderr, status=2) - -# be paranoid in testing some more combinations - -expect_stderr = warnings + """ -scons: \\*\\*\\* Error converting option: shared -Invalid value\\(s\\) for option: foo -""" + TestSCons.file_expr - -test.run(arguments='shared=foo,ical', stderr=expect_stderr, status=2) - -expect_stderr = warnings +""" -scons: \\*\\*\\* Error converting option: shared -Invalid value\\(s\\) for option: foo -""" + TestSCons.file_expr - -test.run(arguments='shared=ical,foo', stderr=expect_stderr, status=2) - -expect_stderr = warnings +""" -scons: \\*\\*\\* Error converting option: shared -Invalid value\\(s\\) for option: foo -""" + TestSCons.file_expr - -test.run(arguments='shared=ical,foo,x11', stderr=expect_stderr, status=2) - -expect_stderr = warnings +""" -scons: \\*\\*\\* Error converting option: shared -Invalid value\\(s\\) for option: foo,bar -""" + TestSCons.file_expr - -test.run(arguments='shared=foo,x11,,,bar', stderr=expect_stderr, status=2) - - - -test.write('SConstruct', """ -from SCons.Options import ListOption - -opts = Options(args=ARGUMENTS) -opts.AddOptions( - ListOption('gpib', - 'comment', - ['ENET', 'GPIB'], - names = ['ENET', 'GPIB', 'LINUX_GPIB', 'NO_GPIB']), - ) - -env = Environment(options=opts) -Help(opts.GenerateHelpText(env)) - -print(env['gpib']) -Default(env.Alias('dummy', None)) -""") - -expect = test.wrap_stdout(read_str="ENET,GPIB\n", build_str="""\ -scons: Nothing to be done for `dummy'. -""") - -test.run(stdout=expect, stderr=warnings) - - - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Deprecated/Options/Options.py b/test/Deprecated/Options/Options.py deleted file mode 100644 index f196b79..0000000 --- a/test/Deprecated/Options/Options.py +++ /dev/null @@ -1,386 +0,0 @@ -#!/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__" - -import TestSCons - -test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) - -test.write('SConstruct', """ -DefaultEnvironment(tools=[]) -env = Environment() -print(env['CC']) -print(" ".join(env['CCFLAGS'])) -Default(env.Alias('dummy', None)) -""") -test.run() -cc, ccflags = test.stdout().split('\n')[1:3] - -test.write('SConstruct', """ -DefaultEnvironment(tools=[]) -# test validator. Change a key and add a new one to the environment -def validator(key, value, environ): - environ[key] = "v" - environ["valid_key"] = "v" - - -def old_converter (value): - return "old_converter" - -def new_converter (value, env): - return "new_converter" - - -opts = Options('custom.py') -opts.Add('RELEASE_BUILD', - 'Set to 1 to build a release build', - 0, - None, - int) - -opts.Add('DEBUG_BUILD', - 'Set to 1 to build a debug build', - 1, - None, - int) - -opts.Add('CC', - 'The C compiler') - -opts.Add('VALIDATE', - 'An option for testing validation', - "notset", - validator, - None) - -opts.Add('OLD_CONVERTER', - 'An option for testing converters that take one parameter', - "foo", - None, - old_converter) - -opts.Add('NEW_CONVERTER', - 'An option for testing converters that take two parameters', - "foo", - None, - new_converter) - -opts.Add('UNSPECIFIED', - 'An option with no value') - -def test_tool(env): - if env['RELEASE_BUILD']: - env.Append(CCFLAGS = '-O') - if env['DEBUG_BUILD']: - env.Append(CCFLAGS = '-g') - - -env = Environment(options=opts, tools=['default', test_tool]) - -Help('Variables settable in custom.py or on the command line:\\n' + opts.GenerateHelpText(env)) - -print(env['RELEASE_BUILD']) -print(env['DEBUG_BUILD']) -print(env['CC']) -print(" ".join(env['CCFLAGS'])) -print(env['VALIDATE']) -print(env['valid_key']) - -# unspecified options should not be set: -assert 'UNSPECIFIED' not in env - -# undeclared options should be ignored: -assert 'UNDECLARED' not in env - -# calling Update() should not effect options that -# are not declared on the options object: -r = env['RELEASE_BUILD'] -opts = Options() -opts.Update(env) -assert env['RELEASE_BUILD'] == r - -Default(env.Alias('dummy', None)) - -""") - -warnings = """ -scons: warning: The Options class is deprecated; use the Variables class instead. -""" + TestSCons.file_expr - - -def check(expect): - result = test.stdout().split('\n') - assert result[1:len(expect)+1] == expect, (result[1:len(expect)+1], expect) - -test.run(stderr=warnings) -check(['0', '1', cc, (ccflags + ' -g').strip(), 'v', 'v']) - -test.run(arguments='RELEASE_BUILD=1', stderr=warnings) -check(['1', '1', cc, (ccflags + ' -O -g').strip(), 'v', 'v']) - -test.run(arguments='RELEASE_BUILD=1 DEBUG_BUILD=0', stderr=warnings) -check(['1', '0', cc, (ccflags + ' -O').strip(), 'v', 'v']) - -test.run(arguments='CC=not_a_c_compiler', stderr=warnings) -check(['0', '1', 'not_a_c_compiler', (ccflags + ' -g').strip(), 'v', 'v']) - -test.run(arguments='UNDECLARED=foo', stderr=warnings) -check(['0', '1', cc, (ccflags + ' -g').strip(), 'v', 'v']) - -test.run(arguments='CCFLAGS=--taco', stderr=warnings) -check(['0', '1', cc, (ccflags + ' -g').strip(), 'v', 'v']) - -test.write('custom.py', """ -DEBUG_BUILD=0 -RELEASE_BUILD=1 -""") - -test.run(stderr=warnings) -check(['1', '0', cc, (ccflags + ' -O').strip(), 'v', 'v']) - -test.run(arguments='DEBUG_BUILD=1', stderr=warnings) -check(['1', '1', cc, (ccflags + ' -O -g').strip(), 'v', 'v']) - -test.run(arguments='-h', - stdout = """\ -scons: Reading SConscript files ... -1 -0 -%s -%s -v -v -scons: done reading SConscript files. -Variables settable in custom.py or on the command line: - -RELEASE_BUILD: Set to 1 to build a release build - default: 0 - actual: 1 - -DEBUG_BUILD: Set to 1 to build a debug build - default: 1 - actual: 0 - -CC: The C compiler - default: None - actual: %s - -VALIDATE: An option for testing validation - default: notset - actual: v - -OLD_CONVERTER: An option for testing converters that take one parameter - default: foo - actual: old_converter - -NEW_CONVERTER: An option for testing converters that take two parameters - default: foo - actual: new_converter - -UNSPECIFIED: An option with no value - default: None - actual: None - -Use scons -H for help about command-line options. -"""%(cc, ccflags and ccflags + ' -O' or '-O', cc), - stderr=warnings) - -# Test saving of options and multi loading -# -test.write('SConstruct', """ -DefaultEnvironment(tools=[]) - -opts = Options(['custom.py', 'options.saved']) -opts.Add('RELEASE_BUILD', - 'Set to 1 to build a release build', - 0, - None, - int) - -opts.Add('DEBUG_BUILD', - 'Set to 1 to build a debug build', - 1, - None, - int) - -opts.Add('UNSPECIFIED', - 'An option with no value') - -env = Environment(options = opts) - -print(env['RELEASE_BUILD']) -print(env['DEBUG_BUILD']) - -opts.Save('options.saved', env) -""") - -# Check the save file by executing and comparing against -# the expected dictionary -def checkSave(file, expected): - gdict = {} - ldict = {} - exec(open(file, 'r').read(), gdict, ldict) - assert expected == ldict, "%s\n...not equal to...\n%s" % (expected, ldict) - -# First test with no command line options -# This should just leave the custom.py settings -test.run(stderr=warnings) -check(['1','0']) -checkSave('options.saved', { 'RELEASE_BUILD':1, 'DEBUG_BUILD':0}) - -# Override with command line arguments -test.run(arguments='DEBUG_BUILD=3', stderr=warnings) -check(['1','3']) -checkSave('options.saved', {'RELEASE_BUILD':1, 'DEBUG_BUILD':3}) - -# Now make sure that saved options are overridding the custom.py -test.run(stderr=warnings) -check(['1','3']) -checkSave('options.saved', {'DEBUG_BUILD':3, 'RELEASE_BUILD':1}) - -# Load no options from file(s) -# Used to test for correct output in save option file -test.write('SConstruct', """ -DefaultEnvironment(tools=[]) - -opts = Options() -opts.Add('RELEASE_BUILD', - 'Set to 1 to build a release build', - '0', - None, - int) - -opts.Add('DEBUG_BUILD', - 'Set to 1 to build a debug build', - '1', - None, - int) - -opts.Add('UNSPECIFIED', - 'An option with no value') - -opts.Add('LISTOPTION_TEST', - 'testing list option persistence', - 'none', - names = ['a','b','c',]) - -env = Environment(options = opts) - -print(env['RELEASE_BUILD']) -print(env['DEBUG_BUILD']) -print(env['LISTOPTION_TEST']) - -opts.Save('options.saved', env) -""") - -# First check for empty output file when nothing is passed on command line -test.run(stderr=warnings) -check(['0','1']) -checkSave('options.saved', {}) - -# Now specify one option the same as default and make sure it doesn't write out -test.run(arguments='DEBUG_BUILD=1', stderr=warnings) -check(['0','1']) -checkSave('options.saved', {}) - -# Now specify same option non-default and make sure only it is written out -test.run(arguments='DEBUG_BUILD=0 LISTOPTION_TEST=a,b', stderr=warnings) -check(['0','0']) -checkSave('options.saved',{'DEBUG_BUILD':0, 'LISTOPTION_TEST':'a,b'}) - -test.write('SConstruct', """ -DefaultEnvironment(tools=[]) - -opts = Options('custom.py') -opts.Add('RELEASE_BUILD', - 'Set to 1 to build a release build', - 0, - None, - int) - -opts.Add('DEBUG_BUILD', - 'Set to 1 to build a debug build', - 1, - None, - int) - -opts.Add('CC', - 'The C compiler') - -opts.Add('UNSPECIFIED', - 'An option with no value') - -env = Environment(options=opts) - -def compare(a, b): - return (a > b) - (a < b) - -Help('Variables settable in custom.py or on the command line:\\n' + opts.GenerateHelpText(env,sort=compare)) - -""") - -test.run(arguments='-h', - stdout = """\ -scons: Reading SConscript files ... -scons: done reading SConscript files. -Variables settable in custom.py or on the command line: - -CC: The C compiler - default: None - actual: %s - -DEBUG_BUILD: Set to 1 to build a debug build - default: 1 - actual: 0 - -RELEASE_BUILD: Set to 1 to build a release build - default: 0 - actual: 1 - -UNSPECIFIED: An option with no value - default: None - actual: None - -Use scons -H for help about command-line options. -"""%cc, - stderr=warnings) - -test.write('SConstruct', """ -DefaultEnvironment(tools=[]) - -import SCons.Options -env1 = Environment(options = Options()) -env2 = Environment(options = SCons.Options.Options()) -""") - -test.run(stderr=warnings) - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Deprecated/Options/PackageOption.py b/test/Deprecated/Options/PackageOption.py deleted file mode 100644 index ec8990c..0000000 --- a/test/Deprecated/Options/PackageOption.py +++ /dev/null @@ -1,98 +0,0 @@ -#!/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__" - -""" -Test the PackageOption canned Option type. -""" - -import os - -import TestSCons - -test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) - -SConstruct_path = test.workpath('SConstruct') - -def check(expect): - result = test.stdout().split('\n') - assert result[1:len(expect)+1] == expect, (result[1:len(expect)+1], expect) - - - -test.write(SConstruct_path, """\ -from SCons.Options.PackageOption import PackageOption -PO = PackageOption - -from SCons.Options import PackageOption - -opts = Options(args=ARGUMENTS) -opts.AddOptions( - PackageOption('x11', - 'use X11 installed here (yes = search some places', - 'yes'), - PO('package', 'help for package', 'yes'), - ) - -env = Environment(options=opts) -Help(opts.GenerateHelpText(env)) - -print(env['x11']) -Default(env.Alias('dummy', None)) -""") - -warnings = """ -scons: warning: The Options class is deprecated; use the Variables class instead. -%s -scons: warning: The PackageOption\\(\\) function is deprecated; use the PackageVariable\\(\\) function instead. -%s""" % (TestSCons.file_expr, TestSCons.file_expr) - -test.run(stderr=warnings) -check([str(True)]) - -test.run(arguments='x11=no', stderr=warnings) -check([str(False)]) - -test.run(arguments='x11=0', stderr=warnings) -check([str(False)]) - -test.run(arguments=['x11=%s' % test.workpath()], stderr=warnings) -check([test.workpath()]) - -expect_stderr = warnings + """ -scons: \\*\\*\\* Path does not exist for option x11: /non/existing/path/ -""" + TestSCons.file_expr - -test.run(arguments='x11=/non/existing/path/', stderr=expect_stderr, status=2) - - - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Deprecated/Options/PathOption.py b/test/Deprecated/Options/PathOption.py deleted file mode 100644 index 0e6949c..0000000 --- a/test/Deprecated/Options/PathOption.py +++ /dev/null @@ -1,296 +0,0 @@ -#!/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__" - -""" -Test the PathOption canned option type, with tests for its -various canned validators. -""" - -import os.path -import re - -import TestSCons - -test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) - -SConstruct_path = test.workpath('SConstruct') - -def check(expect): - result = test.stdout().split('\n') - assert result[1:len(expect)+1] == expect, (result[1:len(expect)+1], expect) - -#### test PathOption #### - -test.subdir('lib', 'qt', ['qt', 'lib'], 'nolib' ) -workpath = test.workpath() -libpath = os.path.join(workpath, 'lib') - -test.write(SConstruct_path, """\ -from SCons.Options.PathOption import PathOption -PO = PathOption - -from SCons.Options import PathOption - -qtdir = r'%s' - -opts = Options(args=ARGUMENTS) -opts.AddOptions( - PathOption('qtdir', 'where the root of Qt is installed', qtdir), - PO('qt_libraries', 'where the Qt library is installed', r'%s'), - ) - -env = Environment(options=opts) -Help(opts.GenerateHelpText(env)) - -print(env['qtdir']) -print(env['qt_libraries']) -print(env.subst('$qt_libraries')) - -Default(env.Alias('dummy', None)) -""" % (workpath, os.path.join('$qtdir', 'lib') )) - -warnings = """ -scons: warning: The Options class is deprecated; use the Variables class instead. -%s -scons: warning: The PathOption\\(\\) function is deprecated; use the PathVariable\\(\\) function instead. -%s""" % (TestSCons.file_expr, TestSCons.file_expr) - -qtpath = workpath -libpath = os.path.join(qtpath, 'lib') -test.run(stderr=warnings) -check([qtpath, os.path.join('$qtdir', 'lib'), libpath]) - -qtpath = os.path.join(workpath, 'qt') -libpath = os.path.join(qtpath, 'lib') -test.run(arguments=['qtdir=%s' % qtpath], stderr=warnings) -check([qtpath, os.path.join('$qtdir', 'lib'), libpath]) - -qtpath = workpath -libpath = os.path.join(qtpath, 'nolib') -test.run(arguments=['qt_libraries=%s' % libpath], stderr=warnings) -check([qtpath, libpath, libpath]) - -qtpath = os.path.join(workpath, 'qt') -libpath = os.path.join(workpath, 'nolib') -test.run(arguments=['qtdir=%s' % qtpath, 'qt_libraries=%s' % libpath], stderr=warnings) -check([qtpath, libpath, libpath]) - -qtpath = os.path.join(workpath, 'non', 'existing', 'path') -qtpath_re = re.escape(qtpath) - -expect_stderr = warnings + (""" -scons: \\*\\*\\* Path for option qtdir does not exist: %(qtpath_re)s -""" % locals()) + TestSCons.file_expr - -test.run(arguments=['qtdir=%s' % qtpath], stderr=expect_stderr, status=2) - -expect_stderr = warnings + (""" -scons: \\*\\*\\* Path for option qt_libraries does not exist: %(qtpath_re)s -""" % locals()) + TestSCons.file_expr - -test.run(arguments=['qt_libraries=%s' % qtpath], stderr=expect_stderr, status=2) - - - -default_file = test.workpath('default_file') -default_subdir = test.workpath('default_subdir') - -existing_subdir = test.workpath('existing_subdir') -test.subdir(existing_subdir) - -existing_file = test.workpath('existing_file') -test.write(existing_file, "existing_file\n") - -non_existing_subdir = test.workpath('non_existing_subdir') -non_existing_file = test.workpath('non_existing_file') - -default_file_re = re.escape(default_file) -default_subdir_re = re.escape(default_subdir) -existing_subdir_re = re.escape(existing_subdir) -existing_file_re = re.escape(existing_file) -non_existing_subdir_re = re.escape(non_existing_subdir) -non_existing_file_re = re.escape(non_existing_file) - - - -test.write('SConstruct', """\ -opts = Options(args=ARGUMENTS) -opts.AddOptions( - PathOption('X', 'X variable', r'%s', validator=PathOption.PathAccept), - ) - -env = Environment(options=opts) - -print(env['X']) - -Default(env.Alias('dummy', None)) -""" % default_subdir) - -test.run(stderr=warnings) -check([default_subdir]) - -test.run(arguments=['X=%s' % existing_file], stderr=warnings) -check([existing_file]) - -test.run(arguments=['X=%s' % non_existing_file], stderr=warnings) -check([non_existing_file]) - -test.run(arguments=['X=%s' % existing_subdir], stderr=warnings) -check([existing_subdir]) - -test.run(arguments=['X=%s' % non_existing_subdir], stderr=warnings) -check([non_existing_subdir]) - -test.must_not_exist(non_existing_file) -test.must_not_exist(non_existing_subdir) - - - -test.write(SConstruct_path, """\ -opts = Options(args=ARGUMENTS) -opts.AddOptions( - PathOption('X', 'X variable', r'%s', validator=PathOption.PathIsFile), - ) - -env = Environment(options=opts) - -print(env['X']) - -Default(env.Alias('dummy', None)) -""" % default_file) - -expect_stderr = warnings + (""" -scons: \\*\\*\\* File path for option X does not exist: %(default_file_re)s -""" % locals()) + TestSCons.file_expr - -test.run(status=2, stderr=expect_stderr) - -test.write(default_file, "default_file\n") - -test.run(stderr=warnings) -check([default_file]) - -expect_stderr = warnings + (""" -scons: \\*\\*\\* File path for option X is a directory: %(existing_subdir_re)s -""" % locals()) + TestSCons.file_expr - -test.run(arguments=['X=%s' % existing_subdir], status=2, stderr=expect_stderr) - -test.run(arguments=['X=%s' % existing_file], stderr=warnings) -check([existing_file]) - -expect_stderr = warnings + (""" -scons: \\*\\*\\* File path for option X does not exist: %(non_existing_file_re)s -""" % locals()) + TestSCons.file_expr - -test.run(arguments=['X=%s' % non_existing_file], status=2, stderr=expect_stderr) - - - -test.write('SConstruct', """\ -opts = Options(args=ARGUMENTS) -opts.AddOptions( - PathOption('X', 'X variable', r'%s', validator=PathOption.PathIsDir), - ) - -env = Environment(options=opts) - -print(env['X']) - -Default(env.Alias('dummy', None)) -""" % default_subdir) - -expect_stderr = warnings + (""" -scons: \\*\\*\\* Directory path for option X does not exist: %(default_subdir_re)s -""" % locals()) + TestSCons.file_expr - -test.run(status=2, stderr=expect_stderr) - -test.subdir(default_subdir) - -test.run(stderr=warnings) -check([default_subdir]) - -expect_stderr = warnings + (""" -scons: \\*\\*\\* Directory path for option X is a file: %(existing_file_re)s -""" % locals()) + TestSCons.file_expr - -test.run(arguments=['X=%s' % existing_file], - status=2, - stderr=expect_stderr) - -test.run(arguments=['X=%s' % existing_subdir], stderr=warnings) -check([existing_subdir]) - -expect_stderr = warnings + (""" -scons: \\*\\*\\* Directory path for option X does not exist: %(non_existing_subdir_re)s -""" % locals()) + TestSCons.file_expr - -test.run(arguments=['X=%s' % non_existing_subdir], - status=2, - stderr=expect_stderr) - - - -test.write('SConstruct', """\ -opts = Options(args=ARGUMENTS) -opts.AddOptions( - PathOption('X', 'X variable', r'%s', validator=PathOption.PathIsDirCreate), - ) - -env = Environment(options=opts) - -print(env['X']) - -Default(env.Alias('dummy', None)) -""" % default_subdir) - -test.run(stderr=warnings) -check([default_subdir]) - -expect_stderr = warnings + (""" -scons: \\*\\*\\* Path for option X is a file, not a directory: %(existing_file_re)s -""" % locals()) + TestSCons.file_expr - -test.run(arguments=['X=%s' % existing_file], status=2, stderr=expect_stderr) - -test.run(arguments=['X=%s' % existing_subdir], stderr=warnings) -check([existing_subdir]) - -test.run(arguments=['X=%s' % non_existing_subdir], stderr=warnings) -check([non_existing_subdir]) - -test.must_exist(non_existing_subdir) - - - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Deprecated/Options/chdir.py b/test/Deprecated/Options/chdir.py deleted file mode 100644 index bfeda1b..0000000 --- a/test/Deprecated/Options/chdir.py +++ /dev/null @@ -1,80 +0,0 @@ -#!/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 that we can chdir() to the directory in which an Options -file lives by using the __name__ value. -""" - -import TestSCons - -test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) - -test.subdir('bin', 'subdir') - -test.write('SConstruct', """\ -opts = Options('../bin/opts.cfg', ARGUMENTS) -opts.Add('VARIABLE') -Export("opts") -SConscript('subdir/SConscript') -""") - -SConscript_contents = """\ -Import("opts") -env = Environment() -opts.Update(env) -print("VARIABLE = %s"%repr(env['VARIABLE'])) -""" - -test.write(['bin', 'opts.cfg'], """\ -import os -os.chdir(os.path.split(__name__)[0]) -exec(open('opts2.cfg', 'r').read()) -""") - -test.write(['bin', 'opts2.cfg'], """\ -VARIABLE = 'opts2.cfg value' -""") - -test.write(['subdir', 'SConscript'], SConscript_contents) - -expect = """\ -VARIABLE = 'opts2.cfg value' -""" - -warnings = """ -scons: warning: The Options class is deprecated; use the Variables class instead. -""" + TestSCons.file_expr - -test.run(arguments = '-q -Q .', stdout=expect, stderr=warnings) - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Deprecated/Options/help.py b/test/Deprecated/Options/help.py deleted file mode 100644 index ad8a96b..0000000 --- a/test/Deprecated/Options/help.py +++ /dev/null @@ -1,170 +0,0 @@ -#!/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__" - -""" -Test the Options help messages. -""" - -import os -import re - -import TestSCons - -str_True = str(True) -str_False = str(False) - -test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) - -workpath = test.workpath() -qtpath = os.path.join(workpath, 'qt') -libpath = os.path.join(qtpath, 'lib') -libdirvar = os.path.join('$qtdir', 'lib') - -qtpath_re = re.escape(qtpath) -libpath_re = re.escape(libpath) -libdirvar_re = re.escape(libdirvar) - -test.subdir(qtpath) -test.subdir(libpath) - -test.write('SConstruct', """ -from SCons.Options import BoolOption, EnumOption, ListOption, \ - PackageOption, PathOption - -list_of_libs = Split('x11 gl qt ical') -qtdir = r'%(qtpath)s' - -opts = Options(args=ARGUMENTS) -opts.AddOptions( - BoolOption('warnings', 'compilation with -Wall and similiar', 1), - BoolOption('profile', 'create profiling informations', 0), - EnumOption('debug', 'debug output and symbols', 'no', - allowed_values=('yes', 'no', 'full'), - map={}, ignorecase=0), # case sensitive - EnumOption('guilib', 'gui lib to use', 'gtk', - allowed_values=('motif', 'gtk', 'kde'), - map={}, ignorecase=1), # case insensitive - EnumOption('some', 'some option', 'xaver', - allowed_values=('xaver', 'eins'), - map={}, ignorecase=2), # make lowercase - ListOption('shared', - 'libraries to build as shared libraries', - 'all', - names = list_of_libs), - PackageOption('x11', - 'use X11 installed here (yes = search some places)', - 'yes'), - PathOption('qtdir', 'where the root of Qt is installed', qtdir), - PathOption('qt_libraries', - 'where the Qt library is installed', - r'%(libdirvar)s'), - ) - -env = Environment(options=opts) -Help(opts.GenerateHelpText(env)) - -print(env['warnings']) -print(env['profile']) - -Default(env.Alias('dummy', None)) -""" % locals()) - - -expected_stdout = """\ -scons: Reading SConscript files ... -%(str_True)s -%(str_False)s -scons: done reading SConscript files. - -warnings: compilation with -Wall and similiar \\(yes|no\\) - default: 1 - actual: %(str_True)s - -profile: create profiling informations \\(yes|no\\) - default: 0 - actual: %(str_False)s - -debug: debug output and symbols \\(yes|no|full\\) - default: no - actual: no - -guilib: gui lib to use \\(motif|gtk|kde\\) - default: gtk - actual: gtk - -some: some option \\(xaver|eins\\) - default: xaver - actual: xaver - -shared: libraries to build as shared libraries - \\(all|none|comma-separated list of names\\) - allowed names: x11 gl qt ical - default: all - actual: x11 gl qt ical - -x11: use X11 installed here \\(yes = search some places\\) - \\( yes | no | /path/to/x11 \\) - default: yes - actual: %(str_True)s - -qtdir: where the root of Qt is installed \\( /path/to/qtdir \\) - default: %(qtpath_re)s - actual: %(qtpath_re)s - -qt_libraries: where the Qt library is installed \\( /path/to/qt_libraries \\) - default: %(libdirvar_re)s - actual: %(libpath_re)s - -Use scons -H for help about command-line options. -""" % locals() - -file_expr = TestSCons.file_expr - -expected_stderr = """ -scons: warning: The Options class is deprecated; use the Variables class instead. -%(file_expr)s -scons: warning: The BoolOption\\(\\) function is deprecated; use the BoolVariable\\(\\) function instead. -%(file_expr)s -scons: warning: The EnumOption\\(\\) function is deprecated; use the EnumVariable\\(\\) function instead. -%(file_expr)s -scons: warning: The ListOption\\(\\) function is deprecated; use the ListVariable\\(\\) function instead. -%(file_expr)s -scons: warning: The PackageOption\\(\\) function is deprecated; use the PackageVariable\\(\\) function instead. -%(file_expr)s -scons: warning: The PathOption\\(\\) function is deprecated; use the PathVariable\\(\\) function instead. -%(file_expr)s""" % locals() - -test.run(arguments='-h', stdout=expected_stdout, stderr=expected_stderr) - - - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Deprecated/Options/import.py b/test/Deprecated/Options/import.py deleted file mode 100644 index 764a061..0000000 --- a/test/Deprecated/Options/import.py +++ /dev/null @@ -1,78 +0,0 @@ -#!/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 that an Options file in a different directory can import -a module in that directory. -""" - -import TestSCons - -test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) - -workpath = test.workpath('') - -test.subdir('bin', 'subdir') - -test.write('SConstruct', """\ -opts = Options('../bin/opts.cfg', ARGUMENTS) -opts.Add('VARIABLE') -Export("opts") -SConscript('subdir/SConscript') -""") - -SConscript_contents = """\ -Import("opts") -env = Environment() -opts.Update(env) -print("VARIABLE = %s"%env.get('VARIABLE')) -""" - -test.write(['bin', 'opts.cfg'], """\ -from local_options import VARIABLE -""" % locals()) - -test.write(['bin', 'local_options.py'], """\ -VARIABLE = 'bin/local_options.py' -""") - -test.write(['subdir', 'SConscript'], SConscript_contents) - -stdout = "VARIABLE = bin/local_options.py\n" - -stderr = """ -scons: warning: The Options class is deprecated; use the Variables class instead. -""" + TestSCons.file_expr - -test.run(arguments = '-q -Q .', stdout = stdout, stderr = stderr) - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: -- cgit v0.12 From 28d93e43689e9e91f1a648c522bf6fd11bb28f90 Mon Sep 17 00:00:00 2001 From: Gabriel Russell Date: Tue, 30 Jan 2018 14:45:41 -0500 Subject: test for mtime update --- test/CacheDir/readonly-cache.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/CacheDir/readonly-cache.py b/test/CacheDir/readonly-cache.py index 05c46e6..db3b3ec 100755 --- a/test/CacheDir/readonly-cache.py +++ b/test/CacheDir/readonly-cache.py @@ -28,8 +28,11 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Verify accessing cache works even if it's read-only. """ +import glob import os import TestSCons +import time +from stat import * test = TestSCons.TestSCons() @@ -42,10 +45,22 @@ test.write('file.in', "file.in\n") test.run(arguments = '--debug=explain --cache-debug=- .') +cachefile = glob.glob("cache/??/*")[0] + +time0 = os.stat(cachefile).st_mtime + +time.sleep(.1) + test.unlink('file.out') test.run(arguments = '--debug=explain --cache-debug=- .') +time1 = os.stat(cachefile).st_mtime + +# make sure that mtime has been updated on cache use +if time1 <= time0: + test.fail_test() + test.unlink('file.out') for root, dirs, files in os.walk("cache",topdown=False): -- cgit v0.12 From 0ec795c27d1311b0ef815165395a43dd85ec3eec Mon Sep 17 00:00:00 2001 From: William Deegan Date: Wed, 31 Jan 2018 14:12:08 -0800 Subject: Remove SCons/Options from Manifest for packaging. --- src/engine/MANIFEST.in | 1 - 1 file changed, 1 deletion(-) diff --git a/src/engine/MANIFEST.in b/src/engine/MANIFEST.in index 2df278e..3f883be 100644 --- a/src/engine/MANIFEST.in +++ b/src/engine/MANIFEST.in @@ -18,7 +18,6 @@ SCons/Node/__init__.py SCons/Node/Alias.py SCons/Node/FS.py SCons/Node/Python.py -SCons/Options/*.py SCons/PathList.py SCons/Platform/__init__.py SCons/Platform/aix.py -- cgit v0.12 From d9842caf097ffc90144a1f7683aa7b27ff955507 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Thu, 1 Feb 2018 09:02:24 -0800 Subject: Remove SCons.Options from setup.py --- src/setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/setup.py b/src/setup.py index 100e367..442315c 100644 --- a/src/setup.py +++ b/src/setup.py @@ -416,7 +416,6 @@ arguments = { 'packages': ["SCons", "SCons.compat", "SCons.Node", - "SCons.Options", "SCons.Platform", "SCons.Scanner", "SCons.Script", -- cgit v0.12 From 486e13a3760e52d3a877fcb720320a0115b9630d Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Sat, 10 Feb 2018 17:39:57 -0500 Subject: pickle protocal was causing issues in some cases --- src/engine/SCons/compat/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/SCons/compat/__init__.py b/src/engine/SCons/compat/__init__.py index 0b6c016..c053edf 100644 --- a/src/engine/SCons/compat/__init__.py +++ b/src/engine/SCons/compat/__init__.py @@ -98,7 +98,7 @@ import pickle # Was pickle.HIGHEST_PROTOCOL # Changed to 2 so py3.5+'s pickle will be compatible with py2.7. -PICKLE_PROTOCOL = 2 +PICKLE_PROTOCOL = -2 # TODO: FIXME # In 3.x, 'profile' automatically loads the fast version if available. -- cgit v0.12 From ad792d38e8f3cabf7da8aa990d1c29c6b79bb41f Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 10 Feb 2018 19:30:55 -0800 Subject: Remove obsolete HOWTO for sub releases. --- HOWTO/subrelease.txt | 114 --------------------------------------------------- 1 file changed, 114 deletions(-) delete mode 100644 HOWTO/subrelease.txt diff --git a/HOWTO/subrelease.txt b/HOWTO/subrelease.txt deleted file mode 100644 index 06b757a..0000000 --- a/HOWTO/subrelease.txt +++ /dev/null @@ -1,114 +0,0 @@ -__COPYRIGHT__ - -This document covers how to prepare subreleases of SCons--that is, -releases numbered with X.Y.Z format, such as 0.94.1, 1.0.1, etc. - -If you need to prepare a release (X.Y, such as 0.93, 1.0, etc.), then -see the document HOWTO/release.txt. - -Things to do to release a new X.Y.Z version of SCons: - - BEFORE STARTING THE SUB-BRANCH: - - Update the user's guide on the parent - - sh bin/docdiff - - sh bin/docupdate - - START THE NEW SUB-BRANCH FOR SUBRELEASE - - aenbr -p scons.0.{94} {1} - - aenc -p scons.0.{94}.{1} - - Call it something like, - "Prepare a new sub-release for XYZ." - Cause = internal_enhancement. - Exempt it from all tests (*_exempt = true). - - ae_p scons.0.{94}.{1} - - aedb 100 - - aecd - - # Change the hard-coded package version numbers - # in the following files. - aecp README - vi README - - aecp SConstruct - vi SConstruct - - aecp QMTest/TestSCons.py - vi QMTest/TestSCons.py - - # Read through and update the README files if necessary - [optional] aecp README - [optional] vi README - - [optional] aecp src/README.txt - [optional] vi src/README.txt - - # Prepare src/CHANGES.txt - aecp src/CHANGES.txt - vi src/CHANGES.txt - - change the release line to reflect - the new subrelease - - date -R the new subrelease - - add an explanatory not after the subrelease line: - - NOTE: This is a pre-release of 0.{95} - for testing purposes. When 0.{95} is - released, all these changes will show - up as 0.95 changes. - - # Prepare src/RELEASE.txt - aecp src/RELEASE.txt - vi src/RELEASE.txt - - date -R the release only if necessary - - Read through and edit appropriately. - - Can probably keep most of the existing text - - Add any new known problems - - # Prepare debian/changelog - aecp debian/changelog - vi debian/changelog - - add the new subrelease - - date -R the new subrelease - - # Now build and prepare the release itself. - aeb - - aet -reg - - aed - - aede - - etc. - - - - Make the relevant packages available for by-hand pickup directly - off the web site: - - scp scons-0.{94}.{1}.tar.gz stevenknight@scons.sourceforge.net:/home/groups/s/sc/scons/htdocs - scp scons-0.{94}.{1}.zip stevenknight@scons.sourceforge.net:/home/groups/s/sc/scons/htdocs - - - Test downloading from the web site. - - - - Announce to scons-dev@scons.org -- cgit v0.12 From 014b0bf4a0ba87a3a7ec1ebce2f9ae81ae8e5d86 Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Sat, 10 Feb 2018 23:40:58 -0500 Subject: Updated CHANGES.txt --- src/CHANGES.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index d2587e3..de06e84 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -7,6 +7,10 @@ RELEASE 3.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE + From Daniel Moody: + - Made a small change to scons main __init__.py to set the pickling protocal + to choose the latest which fixed 2 failing test varient dir test from Interactive + From Ray Donnelly: - Fix the PATH created by scons.bat (and other .bat files) to provide a normalized PATH. Some pythons in the 3.6 series are no longer able to handle paths which -- cgit v0.12 From 3d65c6d31d19ab9d439413b89efa083c6d887542 Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Sun, 11 Feb 2018 17:20:36 -0500 Subject: forcing passing of python 3.5 and 3.6 tests for successful build in travis CI --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2b6049a..bdb3baa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,6 @@ install: # so allow failure so the coverage stage can be reached with python 2 matrix: allow_failures: - - python: 3.5 - - python: 3.6 - python: pypy -- cgit v0.12 From da0a0c9a2de08fcfb5b0a0b4df30d21c4c786045 Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Sun, 11 Feb 2018 17:22:41 -0500 Subject: updated comments no functional change --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index bdb3baa..0e02b41 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,7 @@ language: python install: - ./.travis/install.sh -# python 3 is not fulling passing at this time -# so allow failure so the coverage stage can be reached with python 2 +# pypy is not passing, but allow failures for coverage stage to be reached matrix: allow_failures: - python: pypy -- cgit v0.12 From 090107e5282cdbff7481a52467b9abcba5a9652d Mon Sep 17 00:00:00 2001 From: Jonathon Reinhart Date: Fri, 9 Feb 2018 23:49:36 -0500 Subject: Replace all instances of `int main()` with `int main(void)` --- bin/SConsExamples.py | 2 +- src/engine/SCons/Conftest.py | 20 ++++++++++---------- src/engine/SCons/SConfTests.py | 8 ++++---- src/engine/SCons/Scanner/CTests.py | 14 +++++++------- src/engine/SCons/Scanner/IDLTests.py | 6 +++--- test/CacheDir/up-to-date-q.py | 2 +- test/Case.py | 2 +- test/Configure/VariantDir-SConscript.py | 2 +- test/Configure/VariantDir.py | 2 +- test/Configure/VariantDir2.py | 2 +- test/Configure/basic.py | 2 +- test/Configure/build-fail.py | 2 +- test/Configure/clean.py | 2 +- test/Configure/custom-tests.py | 6 +++--- test/Configure/help.py | 2 +- test/FindSourceFiles.py | 2 +- test/Interactive/added-include.py | 4 ++-- test/Interactive/implicit-VariantDir.py | 4 ++-- test/LINK/VersionedLib-VariantDir.py | 2 +- test/LINK/VersionedLib-j2.py | 2 +- test/LINK/VersionedLib-subdir.py | 2 +- test/Libs/Library.py | 2 +- test/MSVC/pch-basics.py | 2 +- test/MSVC/pch-spaces-subdir.py | 2 +- test/MSVS/CPPPATH-Dirs.py | 2 +- test/QT/CPPPATH-appended.py | 2 +- test/QT/CPPPATH.py | 2 +- test/QT/QTFLAGS.py | 4 ++-- test/QT/empty-env.py | 2 +- test/QT/manual.py | 2 +- test/QT/moc-from-header.py | 2 +- test/QT/reentrant.py | 2 +- test/RPATH.py | 2 +- test/YACC/live.py | 4 ++-- 34 files changed, 60 insertions(+), 60 deletions(-) diff --git a/bin/SConsExamples.py b/bin/SConsExamples.py index 722e50a..a2ed570 100644 --- a/bin/SConsExamples.py +++ b/bin/SConsExamples.py @@ -39,7 +39,7 @@ # env.Program('foo') # # -# int main() { printf("foo.c\n"); } +# int main(void) { printf("foo.c\n"); } # # # diff --git a/src/engine/SCons/Conftest.py b/src/engine/SCons/Conftest.py index abaf00d..84aa992 100644 --- a/src/engine/SCons/Conftest.py +++ b/src/engine/SCons/Conftest.py @@ -136,7 +136,7 @@ def CheckBuilder(context, text = None, language = None): if not text: text = """ -int main() { +int main(void) { return 0; } """ @@ -157,7 +157,7 @@ def CheckCC(context): """ context.Display("Checking whether the C compiler works... ") text = """ -int main() +int main(void) { return 0; } @@ -177,7 +177,7 @@ def CheckSHCC(context): """ context.Display("Checking whether the (shared) C compiler works... ") text = """ -int foo() +int foo(void) { return 0; } @@ -197,7 +197,7 @@ def CheckCXX(context): """ context.Display("Checking whether the C++ compiler works... ") text = """ -int main() +int main(void) { return 0; } @@ -217,7 +217,7 @@ def CheckSHCXX(context): """ context.Display("Checking whether the (shared) C++ compiler works... ") text = """ -int main() +int main(void) { return 0; } @@ -290,7 +290,7 @@ char %s();""" % function_name #include %(hdr)s -int main() { +int main(void) { #if defined (__stub_%(name)s) || defined (__stub___%(name)s) fail fail fail #else @@ -400,7 +400,7 @@ def CheckType(context, type_name, fallback = None, %(include)s %(header)s -int main() { +int main(void) { if ((%(name)s *) 0) return 0; if (sizeof (%(name)s)) @@ -465,7 +465,7 @@ def CheckTypeSize(context, type_name, header = None, language = None, expect = N src = src + r""" typedef %s scons_check_type; -int main() +int main(void) { static int test_array[1 - 2 * !(((long int) (sizeof(scons_check_type))) == %d)]; test_array[0] = 0; @@ -498,7 +498,7 @@ int main() src = src + """ #include #include -int main() { +int main(void) { printf("%d", (int)sizeof(""" + type_name + """)); return 0; } @@ -560,7 +560,7 @@ def CheckDeclaration(context, symbol, includes = None, language = None): context.Display('Checking whether %s is declared... ' % symbol) src = src + r""" -int main() +int main(void) { #ifndef %s (void) %s; diff --git a/src/engine/SCons/SConfTests.py b/src/engine/SCons/SConfTests.py index f4c6f89..65c4b5f 100644 --- a/src/engine/SCons/SConfTests.py +++ b/src/engine/SCons/SConfTests.py @@ -115,9 +115,9 @@ class SConfTestCase(unittest.TestCase): def checks(self, sconf, TryFuncString): TryFunc = self.SConf.SConfBase.__dict__[TryFuncString] - res1 = TryFunc( sconf, "int main() { return 0; }\n", ".c" ) + res1 = TryFunc( sconf, "int main(void) { return 0; }\n", ".c" ) res2 = TryFunc( sconf, - '#include "no_std_header.h"\nint main() {return 0; }\n', + '#include "no_std_header.h"\nint main(void) {return 0; }\n', '.c' ) return (res1,res2) @@ -254,7 +254,7 @@ class SConfTestCase(unittest.TestCase): def checks(sconf): prog = """ #include -int main() { +int main(void) { printf( "Hello" ); return 0; } @@ -755,7 +755,7 @@ int main() { prog = """ #include -int main() { +int main(void) { printf( "Hello" ); return 0; } diff --git a/src/engine/SCons/Scanner/CTests.py b/src/engine/SCons/Scanner/CTests.py index 9c7df12..c31d373 100644 --- a/src/engine/SCons/Scanner/CTests.py +++ b/src/engine/SCons/Scanner/CTests.py @@ -48,7 +48,7 @@ test.write('f1.cpp',""" #include \"f1.h\" #include -int main() +int main(void) { return 0; } @@ -60,7 +60,7 @@ test.write('f2.cpp',""" #include \"f1.h\" #import -int main() +int main(void) { return 0; } @@ -79,7 +79,7 @@ test.write('f3.cpp',""" const char* x = "#include " -int main() +int main(void) { return 0; } @@ -113,7 +113,7 @@ test.write('fa.cpp',""" #include \"fa.h\" #include -int main() +int main(void) { return 0; } @@ -135,7 +135,7 @@ test.write(['work', 'src', 'fff.c'], """ #include #include -int main() +int main(void) { return 0; } @@ -144,7 +144,7 @@ int main() test.write([ 'work', 'src', 'aaa.c'], """ #include "bbb.h" -int main() +int main(void) { return 0; } @@ -155,7 +155,7 @@ test.write([ 'work', 'src', 'bbb.h'], "\n") test.write([ 'repository', 'src', 'ccc.c'], """ #include "ddd.h" -int main() +int main(void) { return 0; } diff --git a/src/engine/SCons/Scanner/IDLTests.py b/src/engine/SCons/Scanner/IDLTests.py index 227799e..7b53801 100644 --- a/src/engine/SCons/Scanner/IDLTests.py +++ b/src/engine/SCons/Scanner/IDLTests.py @@ -159,7 +159,7 @@ test.write(['work', 'src', 'fff.c'], """ #include #include -int main() +int main(void) { return 0; } @@ -168,7 +168,7 @@ int main() test.write([ 'work', 'src', 'aaa.c'], """ #include "bbb.idl" -int main() +int main(void) { return 0; } @@ -179,7 +179,7 @@ test.write([ 'work', 'src', 'bbb.idl'], "\n") test.write([ 'repository', 'src', 'ccc.c'], """ #include "ddd.idl" -int main() +int main(void) { return 0; } diff --git a/test/CacheDir/up-to-date-q.py b/test/CacheDir/up-to-date-q.py index 275b127..f0e3962 100644 --- a/test/CacheDir/up-to-date-q.py +++ b/test/CacheDir/up-to-date-q.py @@ -55,7 +55,7 @@ test = TestSCons.TestSCons() test.subdir('cache', 'alpha', 'beta') foo_c = """ -int main(){ return 0; } +int main(void){ return 0; } """ sconstruct = """ diff --git a/test/Case.py b/test/Case.py index fb6821d..193da54 100644 --- a/test/Case.py +++ b/test/Case.py @@ -43,7 +43,7 @@ test.write('main.c', """\ void foo(); void bar(); -int main() { +int main(void) { foo(); bar(); exit (0); diff --git a/test/Configure/VariantDir-SConscript.py b/test/Configure/VariantDir-SConscript.py index c82778a..deb7b8f 100644 --- a/test/Configure/VariantDir-SConscript.py +++ b/test/Configure/VariantDir-SConscript.py @@ -96,7 +96,7 @@ test.write(['sub', 'TestProgram.c'], """\ #include "TestProgram.h" #include -int main() { +int main(void) { printf( "Hello\\n" ); } """) diff --git a/test/Configure/VariantDir.py b/test/Configure/VariantDir.py index 01df276..23a4b14 100644 --- a/test/Configure/VariantDir.py +++ b/test/Configure/VariantDir.py @@ -63,7 +63,7 @@ env.Program( 'TestProgram', 'TestProgram.c' ) test.write('TestProgram.c', """\ #include -int main() { +int main(void) { printf( "Hello\\n" ); } """) diff --git a/test/Configure/VariantDir2.py b/test/Configure/VariantDir2.py index 62b832f..ffe6525 100644 --- a/test/Configure/VariantDir2.py +++ b/test/Configure/VariantDir2.py @@ -41,7 +41,7 @@ SConscript('SConscript', variant_dir='build', src='.') test.write('SConscript', """\ env = Environment() config = env.Configure(conf_dir='sconf', log_file='config.log') -config.TryRun("int main() {}", ".c") +config.TryRun("int main(void) {}", ".c") config.Finish() """) diff --git a/test/Configure/basic.py b/test/Configure/basic.py index 4344941..4038a45 100644 --- a/test/Configure/basic.py +++ b/test/Configure/basic.py @@ -61,7 +61,7 @@ env.Program( 'TestProgram', 'TestProgram.c' ) test.write('TestProgram.c', """\ #include -int main() { +int main(void) { printf( "Hello\\n" ); } """) diff --git a/test/Configure/build-fail.py b/test/Configure/build-fail.py index 74609f6..218cf18 100644 --- a/test/Configure/build-fail.py +++ b/test/Configure/build-fail.py @@ -58,7 +58,7 @@ def _check(context): result = context.TryRun(''' #include "%s" - int main() { return 0; } + int main(void) { return 0; } ''' % inc, '.cpp')[0] if result: import sys diff --git a/test/Configure/clean.py b/test/Configure/clean.py index bb15165..d7a5dc7 100644 --- a/test/Configure/clean.py +++ b/test/Configure/clean.py @@ -53,7 +53,7 @@ env.Program( 'TestProgram', 'TestProgram.c' ) test.write('TestProgram.c', """\ #include -int main() { +int main(void) { printf( "Hello\\n" ); } """) diff --git a/test/Configure/custom-tests.py b/test/Configure/custom-tests.py index 7bb2366..6362e25 100644 --- a/test/Configure/custom-tests.py +++ b/test/Configure/custom-tests.py @@ -41,12 +41,12 @@ CR = test.CR # cached rebuild (up to date) NCF = test.NCF # non-cached build failure CF = test.CF # cached build failure -compileOK = '#include \\nint main() {printf("Hello");return 0;}' +compileOK = '#include \\nint main(void) {printf("Hello");return 0;}' compileFAIL = "syntax error" linkOK = compileOK -linkFAIL = "void myFunc(); int main() { myFunc(); }" +linkFAIL = "void myFunc(); int main(void) { myFunc(); }" runOK = compileOK -runFAIL = "int main() { return 1; }" +runFAIL = "int main(void) { return 1; }" test.write('pyAct.py', """\ from __future__ import print_function diff --git a/test/Configure/help.py b/test/Configure/help.py index f42088b..32f74da 100644 --- a/test/Configure/help.py +++ b/test/Configure/help.py @@ -53,7 +53,7 @@ env.Program( 'TestProgram', 'TestProgram.c' ) test.write('TestProgram.c', """\ #include -int main() { +int main(void) { printf( "Hello\\n" ); } """) diff --git a/test/FindSourceFiles.py b/test/FindSourceFiles.py index 88b9d7e..62b906c 100644 --- a/test/FindSourceFiles.py +++ b/test/FindSourceFiles.py @@ -63,7 +63,7 @@ foo_c = env.Substfile('foo.c.in', SUBST_DICT = {'__A__' : '0' }) foo = env.Program(foo_c) """) -test.write('src/foo.c.in', """ int main() { return __A__;} +test.write('src/foo.c.in', """ int main(void) { return __A__;} """) test.run(arguments = 'package') diff --git a/test/Interactive/added-include.py b/test/Interactive/added-include.py index 86a473d..e65cb14 100644 --- a/test/Interactive/added-include.py +++ b/test/Interactive/added-include.py @@ -41,7 +41,7 @@ test.write('foo.h.in', """ test.write('foo.c', """ #include -int main() +int main(void) { printf("foo.c\\n"); return 0; @@ -81,7 +81,7 @@ test.write('foo.c', """ #include -int main() +int main(void) { printf("%s\\n", FOO_STRING); return 0; diff --git a/test/Interactive/implicit-VariantDir.py b/test/Interactive/implicit-VariantDir.py index 5ef4583..fc52080 100644 --- a/test/Interactive/implicit-VariantDir.py +++ b/test/Interactive/implicit-VariantDir.py @@ -74,7 +74,7 @@ test.write(['src', 'foo.c'], """ #define FOO_PRINT_STRING "Hello from foo.c" -int main() +int main(void) { printf(FOO_PRINT_STRING "\\n"); return 0; @@ -115,7 +115,7 @@ test.write(['src', 'foo.c'], """ #include "foo.h" #include -int main() +int main(void) { printf(FOO_PRINT_STRING "\\n"); return 0; diff --git a/test/LINK/VersionedLib-VariantDir.py b/test/LINK/VersionedLib-VariantDir.py index 0350c6e..340fee0 100644 --- a/test/LINK/VersionedLib-VariantDir.py +++ b/test/LINK/VersionedLib-VariantDir.py @@ -65,7 +65,7 @@ test.write(['src','bin','main.c'], """ __declspec(dllimport) #endif int foo(); -int main() +int main(void) { return foo(); } diff --git a/test/LINK/VersionedLib-j2.py b/test/LINK/VersionedLib-j2.py index 4646a37..ed3b7ff 100644 --- a/test/LINK/VersionedLib-j2.py +++ b/test/LINK/VersionedLib-j2.py @@ -57,7 +57,7 @@ test.write('main.c', """ __declspec(dllimport) #endif int foo(); -int main() { return foo(); } +int main(void) { return foo(); } """) test.write('SConstruct', """ diff --git a/test/LINK/VersionedLib-subdir.py b/test/LINK/VersionedLib-subdir.py index 91f3011..2271a54 100644 --- a/test/LINK/VersionedLib-subdir.py +++ b/test/LINK/VersionedLib-subdir.py @@ -58,7 +58,7 @@ test.write('main.c', """ __declspec(dllimport) #endif int foo(); -int main() +int main(void) { return foo(); } diff --git a/test/Libs/Library.py b/test/Libs/Library.py index b603926..50fe68b 100644 --- a/test/Libs/Library.py +++ b/test/Libs/Library.py @@ -152,7 +152,7 @@ void nrd() { test.write('uses-nrd.c', r""" void nrd(); -int main() { +int main(void) { nrd(); return 0; } diff --git a/test/MSVC/pch-basics.py b/test/MSVC/pch-basics.py index 45735ed..ebee0da 100644 --- a/test/MSVC/pch-basics.py +++ b/test/MSVC/pch-basics.py @@ -39,7 +39,7 @@ test.skip_if_not_msvc() test.write('Main.cpp', """\ #include "Precompiled.h" -int main() +int main(void) { return testf(); } diff --git a/test/MSVC/pch-spaces-subdir.py b/test/MSVC/pch-spaces-subdir.py index 3a65b44..65595fc 100644 --- a/test/MSVC/pch-spaces-subdir.py +++ b/test/MSVC/pch-spaces-subdir.py @@ -39,7 +39,7 @@ test.skip_if_not_msvc() test.write('Main.cpp', """\ #include "Precompiled.h" -int main() +int main(void) { return testf(); } diff --git a/test/MSVS/CPPPATH-Dirs.py b/test/MSVS/CPPPATH-Dirs.py index 45ec846..53c7a8b 100644 --- a/test/MSVS/CPPPATH-Dirs.py +++ b/test/MSVS/CPPPATH-Dirs.py @@ -68,7 +68,7 @@ test.write('SConstruct', SConscript_contents) test.write('main.cpp', """\ #include -int main() { +int main(void) { printf("hello, world!\\n"); } """) diff --git a/test/QT/CPPPATH-appended.py b/test/QT/CPPPATH-appended.py index 2780921..98baad8 100644 --- a/test/QT/CPPPATH-appended.py +++ b/test/QT/CPPPATH-appended.py @@ -57,7 +57,7 @@ env.Program(target = 'aaa', source = 'aaa.cpp') test.write(['sub', 'aaa.cpp'], r""" #include "aaa.h" -int main() { aaa(); return 0; } +int main(void) { aaa(); return 0; } """) test.write(['sub', 'aaa.h'], r""" diff --git a/test/QT/CPPPATH.py b/test/QT/CPPPATH.py index 4ea42bd..5de41d9 100644 --- a/test/QT/CPPPATH.py +++ b/test/QT/CPPPATH.py @@ -47,7 +47,7 @@ env.Program(target = 'aaa', source = 'aaa.cpp', CPPPATH=['$CPPPATH', './local_in test.write('aaa.cpp', r""" #include "aaa.h" -int main() { aaa(); return 0; } +int main(void) { aaa(); return 0; } """) test.write('aaa.h', r""" diff --git a/test/QT/QTFLAGS.py b/test/QT/QTFLAGS.py index 8d266ad..61a1d87 100644 --- a/test/QT/QTFLAGS.py +++ b/test/QT/QTFLAGS.py @@ -127,7 +127,7 @@ test.write(['work1', 'main.cpp'], """ #include "uic-another_ui_file.hpp" void mocFromCpp(); -int main() { +int main(void) { mocFromH(); mocFromCpp(); an_ui_file(); @@ -189,7 +189,7 @@ env2.Program('main.cpp') """ % {'QTDIR':QT}) test.write(['work2', 'main.cpp'], """ -int main() { return 0; } +int main(void) { return 0; } """) # Ignore stderr, because if Qt is not installed, diff --git a/test/QT/empty-env.py b/test/QT/empty-env.py index 77547e7..b7867e5 100644 --- a/test/QT/empty-env.py +++ b/test/QT/empty-env.py @@ -46,7 +46,7 @@ env.Program('main', 'main.cpp', CPPDEFINES=['FOO'], LIBS=[]) test.write('main.cpp', r""" #include "foo6.h" -int main() { foo6(); return 0; } +int main(void) { foo6(); return 0; } """) test.write(['qt', 'include', 'foo6.h'], """\ diff --git a/test/QT/manual.py b/test/QT/manual.py index 1f140ae..c5cf74e 100644 --- a/test/QT/manual.py +++ b/test/QT/manual.py @@ -119,7 +119,7 @@ test.write('main.cpp', r""" #include "eee.h" #include "uic_fff.hpp" -int main() { +int main(void) { aaa(); bbb(); ccc(); ddd(); eee(); fff(); return 0; } """) diff --git a/test/QT/moc-from-header.py b/test/QT/moc-from-header.py index 41b1b3d..4151cba 100644 --- a/test/QT/moc-from-header.py +++ b/test/QT/moc-from-header.py @@ -61,7 +61,7 @@ if env['PLATFORM'] == 'darwin': test.write('aaa.cpp', r""" #include "aaa.h" -int main() { aaa(); return 0; } +int main(void) { aaa(); return 0; } """) test.write('aaa.h', r""" diff --git a/test/QT/reentrant.py b/test/QT/reentrant.py index be464b9..af19af9 100644 --- a/test/QT/reentrant.py +++ b/test/QT/reentrant.py @@ -56,7 +56,7 @@ env.Program('main', 'main.cpp', CPPDEFINES=['FOO'], LIBS=[]) test.write('main.cpp', r""" #include "foo5.h" -int main() { foo5(); return 0; } +int main(void) { foo5(); return 0; } """) test.run() diff --git a/test/RPATH.py b/test/RPATH.py index 4e13bb1..754abfe 100644 --- a/test/RPATH.py +++ b/test/RPATH.py @@ -46,7 +46,7 @@ Program('foo', 'foo.c', LIBS='bar', LIBPATH='bar', RPATH='bar') test.write('foo.c', """\ #include -int main() { +int main(void) { void bar(); bar(); exit (0); diff --git a/test/YACC/live.py b/test/YACC/live.py index 253a387..6dd08f7 100644 --- a/test/YACC/live.py +++ b/test/YACC/live.py @@ -60,7 +60,7 @@ extern int yyparse(); int yyerror(char *s); int yylex(); -int main() +int main(void) { return yyparse(); } @@ -108,7 +108,7 @@ file_hpp = 'file.hpp' test.write("hello.cpp", """\ #include "%(file_hpp)s" -int main() +int main(void) { } """ % locals()) -- cgit v0.12 From dc52eb2d432cef90be3c8fee69f927c4aa5b0cfb Mon Sep 17 00:00:00 2001 From: Jonathon Reinhart Date: Sun, 11 Feb 2018 18:15:51 -0500 Subject: Update CHANGES.txt --- src/CHANGES.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index d2587e3..2fc06fe 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -37,6 +37,12 @@ RELEASE 3.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE - Updated manpage scons.xml to fix a nested list problem - Updated doc terminionly: use prepend instead of append as appropriate + From Jonathon Reinhart: + - Replace all instances of `int main()` in C code with `int main(void)`. + Specifically, this fixes the test cases use by Configure.CheckCC() which + would fail when using -Wstrict-prototypes. + + RELEASE 3.0.1 - Mon, 12 Nov 2017 15:31:33 -0700 From Daniel Moody: -- cgit v0.12 From 5af439a4cab5a55b43fce75118eccbd45bf82fe5 Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Sun, 11 Feb 2018 21:02:30 -0500 Subject: used pickle.HIGHEST_PROTOCAL instead of -2 for better readability --- src/engine/SCons/compat/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/SCons/compat/__init__.py b/src/engine/SCons/compat/__init__.py index c053edf..7ab94c5 100644 --- a/src/engine/SCons/compat/__init__.py +++ b/src/engine/SCons/compat/__init__.py @@ -98,7 +98,7 @@ import pickle # Was pickle.HIGHEST_PROTOCOL # Changed to 2 so py3.5+'s pickle will be compatible with py2.7. -PICKLE_PROTOCOL = -2 +PICKLE_PROTOCOL = pickle.HIGHEST_PROTOCOL # TODO: FIXME # In 3.x, 'profile' automatically loads the fast version if available. -- cgit v0.12 From 0589244884a657553258addd579fe0f592238b96 Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Mon, 12 Feb 2018 08:45:52 -0500 Subject: updated changes to make note that increasing the pickling protocal will cause issues when reading sconsigns with the previous pickle protocal --- src/CHANGES.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index de06e84..62c6aa7 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -8,9 +8,10 @@ RELEASE 3.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE From Daniel Moody: - - Made a small change to scons main __init__.py to set the pickling protocal - to choose the latest which fixed 2 failing test varient dir test from Interactive - + - Set the pickling protocal back to highest which was causing issues + with variant dir tests. This will cause issues if reading sconsigns + pickled with the previous lower protocal. + From Ray Donnelly: - Fix the PATH created by scons.bat (and other .bat files) to provide a normalized PATH. Some pythons in the 3.6 series are no longer able to handle paths which -- cgit v0.12