summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2012-01-17 05:49:10 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2012-01-17 05:49:10 (GMT)
commit2169ee312aed492f3fdbc5fa1a4892df49394185 (patch)
tree11c968f804cc8342a084e980f6a4d9ce07b6a35d
parentc702cb8b220c197db85b7d4f2f9f67234a434b7f (diff)
downloadSCons-2169ee312aed492f3fdbc5fa1a4892df49394185.zip
SCons-2169ee312aed492f3fdbc5fa1a4892df49394185.tar.gz
SCons-2169ee312aed492f3fdbc5fa1a4892df49394185.tar.bz2
fixed test for update release to work in 2012 (and years thereafter). It had 2011 hardcoded in many places. Now it'll calculate the current year and use that instead
-rw-r--r--test/update-release-info/update-release-info.py26
1 files changed, 15 insertions, 11 deletions
diff --git a/test/update-release-info/update-release-info.py b/test/update-release-info/update-release-info.py
index dfcd236..654a25c 100644
--- a/test/update-release-info/update-release-info.py
+++ b/test/update-release-info/update-release-info.py
@@ -31,6 +31,9 @@ import os, sys, time
import TestRuntest
+# Needed to ensure we're using the correct year
+this_year=time.localtime()[0]
+
TestSCons = 'QMTest/TestSCons.py' .split('/')
README = 'README' .split('/')
ReleaseConfig = 'ReleaseConfig' .split('/')
@@ -69,14 +72,14 @@ combo_strings = [
"""version_tuple = (2, 0, 0, 'final', 0)
""",
# Index 5: bad release date
-"""release_date = (2011, 12)
-""",
+"""release_date = (%d, 12)
+"""%this_year,
# Index 6: release date (hhhh, mm, dd)
-"""release_date = (2011, 12, 21)
-""",
+"""release_date = (%d, 12, 21)
+"""%this_year,
# Index 7: release date (hhhh, mm, dd, hh, mm, ss)
-"""release_date = (2011, 12, 21, 12, 21, 12)
-""",
+"""release_date = (%d, 12, 21, 12, 21, 12)
+"""%this_year,
]
combo_error = \
@@ -114,8 +117,8 @@ combo_fail(0, 1, 2, stdout =
combo_strings[0] = combo_strings[1] + combo_strings[2] + combo_strings[3]
combo_fail(0, 5, stdout =
-"""ERROR: Invalid release date (2011, 12)
-""")
+"""ERROR: Invalid release date (%d, 12)
+"""%this_year )
def pave(path):
path = path[:-1]
@@ -195,7 +198,8 @@ test.must_match(Announce, """
RELEASE 2.0.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE
""", mode = 'r')
-years = ', '.join(map(str, range(2001, time.localtime()[0] + 1)))
+
+years = ', '.join(map(str, range(2001, this_year + 1)))
test.must_match(SConstruct, """
month_year = 'MONTH YEAR'
copyright_years = %s
@@ -213,11 +217,11 @@ These files are a part of 33.22.11:
# should get Python floors from TestSCons module.
test.must_match(TestSCons, """
-copyright_years = '2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011'
+copyright_years = '%s'
default_version = '2.0.0.alpha.yyyymmdd'
python_version_unsupported = (2, 3)
python_version_deprecated = (2, 4)
-""", mode = 'r')
+"""%years, mode = 'r')
# should get Python floors from TestSCons module.
test.must_match(Main, """