Gary Oberbrunner avatar Gary Oberbrunner committed bb567fa Merge

Merged in dirkbaechle/scons (pull request #40): fix RPM tests to use new rpmutils

Comments (0)

Files changed (6)

src/engine/SCons/Tool/xgettext.py

   import SCons.Util
   from SCons.Tool.GettextCommon import RPaths, _detect_xgettext
 
-  env['XGETTEXT'] = _detect_xgettext(env)
+  try:
+    env['XGETTEXT'] = _detect_xgettext(env)
+  except:
+    env['XGETTEXT'] = 'xgettext' 
   # NOTE: sources="$SOURCES" would work as well. However, we use following
   # construction to convert absolute paths provided by scons onto paths
   # relative to current working dir. Note, that scons expands $SOURCE(S) to

test/packaging/option--package-type.py

 """
 
 import TestSCons
+import SCons.Tool.rpmutils
 
 _python_ = TestSCons._python_
 
 """ % locals())
 
 src_rpm = 'foo-1.2.3-0.src.rpm'
-machine_rpm = 'foo-1.2.3-0.*.rpm'
+machine_rpm = 'foo-1.2.3-0.%s.rpm' % SCons.Tool.rpmutils.defaultMachine()
 
 test.run(arguments='package PACKAGETYPE=rpm', stderr = None)
 
 test.must_exist( src_rpm )
-test.must_exist_one_of( [machine_rpm] )
+test.must_exist( machine_rpm )
 test.must_not_exist( 'bin/main.c' )
 test.must_not_exist( '/bin/main.c' )
 
 
 test.run(arguments='package --package-type=rpm', stderr = None)
 test.must_exist( src_rpm )
-test.must_exist_one_of( [machine_rpm] )
+test.must_exist( machine_rpm )
 test.must_not_exist( 'bin/main.c' )
 test.must_not_exist( '/bin/main.c' )
 

test/packaging/rpm/cleanup.py

 """
 
 import TestSCons
+import SCons.Tool.rpmutils
 
 _python_ = TestSCons._python_
 test = TestSCons.TestSCons()
 test.run( arguments='-c .' )
 
 src_rpm     = 'foo-1.2.3-0.src.rpm'
-machine_rpm = 'foo-1.2.3-0.*.rpm'
+machine_rpm = 'foo-1.2.3-0.%s.rpm' % SCons.Tool.rpmutils.defaultMachine()
 
-test.must_not_exist_any_of( [machine_rpm] )
+test.must_not_exist( machine_rpm )
 test.must_not_exist( src_rpm )
 test.must_not_exist( 'foo-1.2.3.tar.gz' )
 test.must_not_exist( 'foo-1.2.3.spec' )

test/packaging/rpm/internationalization.py

 """
 
 import os
-import glob
+import SCons.Tool.rpmutils
 
 import TestSCons
 
 test.run(arguments='', stderr = None)
 
 src_rpm = 'foo-1.2.3-0.src.rpm'
-machine_rpm = 'foo-1.2.3-0.*.rpm'
+machine_rpm = 'foo-1.2.3-0.%s.rpm' % SCons.Tool.rpmutils.defaultMachine()
 
 test.must_exist( src_rpm )
-test.must_exist_one_of( [machine_rpm] )
+test.must_exist( machine_rpm )
 
 test.must_not_exist( 'bin/main' )
 
-machine_rpm_path = glob.glob(machine_rpm)[0].lstrip('./')
 cmd = 'rpm -qp --queryformat \'%%{GROUP}-%%{SUMMARY}-%%{DESCRIPTION}\' %s'
 
 os.environ['LANGUAGE'] = 'de'
-out = os.popen( cmd % test.workpath(machine_rpm_path) ).read()
+out = os.popen( cmd % test.workpath(machine_rpm) ).read()
 test.fail_test( out != 'Applikation/büro-hallo-das sollte wirklich lang sein' )
 
 os.environ['LANGUAGE'] = 'fr'
-out = os.popen( cmd % test.workpath(machine_rpm_path) ).read()
+out = os.popen( cmd % test.workpath(machine_rpm) ).read()
 test.fail_test( out != 'Application/bureau-bonjour-ceci devrait être vraiment long' )
 
 os.environ['LANGUAGE'] = 'en'
-out = os.popen( cmd % test.workpath(machine_rpm_path) ).read()
+out = os.popen( cmd % test.workpath(machine_rpm) ).read()
 test.fail_test( out != 'Application/office-hello-this should be really long' )
 
 os.environ['LC_ALL'] = 'ae'
-out = os.popen( cmd % test.workpath(machine_rpm_path) ).read()
+out = os.popen( cmd % test.workpath(machine_rpm) ).read()
 test.fail_test( out != 'Application/office-hello-this should be really long' )
 
 #
 test.run(arguments='--install-sandbox=blubb install', stderr = None)
 
 test.must_exist( src_rpm )
-test.must_exist_one_of( [machine_rpm] )
+test.must_exist( machine_rpm )
 
 test.pass_test()
 

test/runtest/python.py

 head, python = os.path.split(TestRuntest.python)
 head, dir = os.path.split(head)
 
-mypython = os.path.join(head, dir, os.path.pardir, dir, python)
+# We have to normalize the python path here, because some installations don't like
+# getting called with "/bin/../bin/python" as first argument, e.g. Fedora 17 Desktop.
+mypython = os.path.normpath(os.path.join(head, dir, os.path.pardir, dir, python))
 
 def escape(s):
     return s.replace('\\', '\\\\')

test/sconsign/script/Configure.py

 test = TestSConsign.TestSConsign(match = TestSConsign.match_re,
                                  diff = TestSConsign.diff_re)
 
-CC = test.detect('CC', norm=1)
+# Note: Here we pass the full search PATH of our current system to
+# the detect() method. This way we try to ensure that we find the same
+# compiler executable as the SConstruct below, which uses
+# os.environ['PATH'] too.
+CC = test.detect('CC', ENV={'PATH' : os.environ.get('PATH','')}, norm=1)
 CC_dir, CC_file = os.path.split(CC)
 
 CC = re.escape(CC)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.