Bug 1087567 - Add proper manifest for cppunit tests; r=ted

--HG--
extra : rebase_source : 622e454f491462d9d2c4125d1309a28854a92b0b
This commit is contained in:
Dan Minor 2014-10-28 09:38:21 -04:00
parent c05be96960
commit 32e352ad3c
7 changed files with 158 additions and 56 deletions

View File

@ -1,7 +0,0 @@
# This is just a list of tests to skip, one test per line
TestPlainTextSerializer # Bug 919599
TestNativeXMLHttpRequest # Bug 919642
mediapipeline_unittest # Bug 919646
TestStartupCache # Bug 929655
TestStartupCacheTelemetry.manifest # Bug 929655
TestStartupCacheTelemetry.js # Bug 929655

View File

@ -1,15 +0,0 @@
# This is just a list of tests to skip, one test per line
jsapi-tests # Bug 1068946
TestPLDHash # Bug 1038197
TestTXMgr # Bug 919595
TestPlainTextSerializer # Bug 919599
TestNativeXMLHttpRequest # Bug 919642
mediapipeline_unittest # Bug 919646
TestStartupCache # Bug 929655
TestStartupCacheTelemetry.manifest # Bug 929655
TestStartupCacheTelemetry.js # Bug 929655
TestCSPParser # Bug 1054246
TestDeadlockDetector # Bug 1054249
test_deadlock_detector # Bug 1054249
TestTArray # Bug 1054251
TestAudioBuffers # Bug 1062937

122
testing/cppunittest.ini Normal file
View File

@ -0,0 +1,122 @@
[ShowAlignments]
[ShowSSEConfig]
[TestAppShellSteadyState]
[TestArrayUtils]
[TestAtomics]
[TestAudioBuffers]
skip-if = os == 'b2g' # Bug 1062937
[TestAudioChannelService]
[TestAudioEventTimeline]
[TestAudioMixer]
[TestAutoPtr]
[TestAutoRef]
[TestBinarySearch]
[TestBind]
[TestBloomFilter]
[TestCOM]
run-if = os == 'win'
[TestCOMArray]
[TestCOMPtr]
[TestCOMPtrEq]
[TestCSPParser]
skip-if = os == 'b2g' # Bug 1054246
[TestCasting]
[TestCeilingFloor]
[TestCertDB]
[TestCheckedInt]
[TestCookie]
[TestCountPopulation]
[TestCountZeroes]
[TestDeadlockDetector]
skip-if = os == 'b2g' # Bug 1054249
[TestDeadlockDetectorScalability]
[TestDeque]
[TestDllInterceptor]
run-if = os == 'win'
[TestEndian]
[TestEnumSet]
[TestFile]
[TestFloatingPoint]
[TestGetURL]
[TestHashtables]
[TestID]
[TestIntegerPrintfMacros]
[TestJSONWriter]
[TestJemalloc]
[TestLineBreak]
[TestMacroArgs]
[TestMacroForEach]
[TestMaybe]
[TestNativeXMLHttpRequest]
skip-if = os == 'b2g' || os == 'android' #Bug 919642
[TestNsRefPtr]
[TestNtPathToDosPath]
run-if = os == 'win'
[TestObserverArray]
[TestObserverService]
[TestPLDHash]
skip-if = os == 'b2g' #Bug 1038197
[TestPair]
[TestPipe]
[TestPlainTextSerializer]
skip-if = os == 'b2g' || os == 'android' #Bug 919599
[TestPoisonArea]
[TestRefPtr]
[TestRollingMean]
[TestSHA1]
[TestSTSParser]
[TestSplayTree]
[TestStartupCache]
skip-if = os == 'b2g' || os == 'android' # Bug 929655
support-files = TestStartupCacheTelemetry.js TestStartupCacheTelemetry.manifest
[TestStringAPI]
[TestSyncRunnable]
[TestTArray]
skip-if = os == 'b2g' # Bug 1054251
[TestTXMgr]
skip-if = os == 'b2g' #Bug 919595
[TestTextFormatter]
[TestThreadUtils]
[TestTypeTraits]
[TestTypedEnum]
[TestUDPSocket]
[TestUniquePtr]
[TestVolatileBuffer]
[TestWeakPtr]
[TestWebGLElementArrayCache]
[buffered_stun_socket_unittest]
[ice_unittest]
[jsapi-tests]
skip-if = os == 'b2g' #Bug 1068946
[mediaconduit_unittests]
[mediapipeline_unittest]
skip-if = os == 'b2g' || os == 'android' # Bug 919646
[nrappkit_unittest]
[rlogringbuffer_unittest]
[runnable_utils_unittest]
[sctp_unittest]
[sdp_unittests]
[signaling_unittests]
[simpletokenbucket_unittest]
[sockettransportservice_unittest]
[test_AsXXX_helpers]
[test_IHistory]
[test_StatementCache]
[test_asyncStatementExecution_transaction]
[test_async_callbacks_with_spun_event_loops]
[test_audio]
[test_binding_params]
[test_deadlock_detector]
skip-if = os == 'b2g' # Bug 1054249
[test_file_perms]
[test_latency]
[test_mutex]
[test_sanity]
[test_service_init_background_thread]
[test_statement_scoper]
[test_tone]
[test_transaction_helper]
[test_true_async]
[test_unlock_notify]
[transport_unittests]
[turn_unittest]

View File

@ -253,6 +253,7 @@ class MachCommands(MachCommandBase):
'executed.')
def run_cppunit_test(self, **params):
import mozinfo
from mozlog.structured import commandline
import runcppunittests as cppunittests
@ -262,9 +263,9 @@ class MachCommands(MachCommandBase):
if len(params['test_files']) == 0:
testdir = os.path.join(self.distdir, 'cppunittests')
progs = cppunittests.extract_unittests_from_args([testdir], None)
tests = cppunittests.extract_unittests_from_args([testdir], mozinfo.info)
else:
progs = cppunittests.extract_unittests_from_args(params['test_files'], None)
tests = cppunittests.extract_unittests_from_args(params['test_files'], mozinfo.info)
# See if we have crash symbols
symbols_path = os.path.join(self.distdir, 'crashreporter-symbols')
@ -273,7 +274,7 @@ class MachCommands(MachCommandBase):
tester = cppunittests.CPPUnitTests()
try:
result = tester.run_tests(progs, self.bindir, symbols_path, interactive=True)
result = tester.run_tests(tests, self.bindir, symbols_path, interactive=True)
except Exception as e:
log.error("Caught exception running cpp unit tests: %s" % str(e))
result = False

View File

@ -254,7 +254,11 @@ def main():
options.xre_path = os.path.abspath(options.xre_path)
progs = cppunittests.extract_unittests_from_args(args, options.manifest_file)
if options.with_b2g_emulator:
environ = {'os': 'b2g'}
else:
environ = {'os': 'android'}
progs = cppunittests.extract_unittests_from_args(args, environ)
tester = RemoteCPPUnitTests(dm, options, progs)
try:
result = tester.run_tests(progs, options.xre_path, options.symbols_path)

View File

@ -7,6 +7,7 @@
from __future__ import with_statement
import sys, os, tempfile, shutil
from optparse import OptionParser
import manifestparser
import mozprocess
import mozinfo
import mozcrash
@ -174,29 +175,30 @@ class CPPUnittestOptions(OptionParser):
default = None,
help = "absolute path to a manifest file")
def extract_unittests_from_args(args, manifest_file):
def extract_unittests_from_args(args, environ):
"""Extract unittests from args, expanding directories as needed"""
progs = []
# Known files commonly packaged with the cppunittests that are not tests
skipped_progs = set(['.mkdir.done', 'remotecppunittests.py', 'runcppunittests.py', 'runcppunittests.pyc'])
if manifest_file:
skipped_progs.add(os.path.basename(manifest_file))
with open(manifest_file) as f:
for line in f:
# strip out comment, if any
prog = line.split('#')[0]
if prog:
skipped_progs.add(prog.strip())
mp = manifestparser.TestManifest(strict=True)
tests = []
for p in args:
if os.path.isdir(p):
progs.extend([os.path.abspath(os.path.join(p, x)) for x in os.listdir(p) if not x in skipped_progs])
elif p not in skipped_progs:
progs.append(os.path.abspath(p))
try:
mp.read(os.path.join(p, 'cppunittest.ini'))
except IOError:
tests.extend([os.path.abspath(os.path.join(p, x)) for x in os.listdir(p)])
else:
tests.append(os.path.abspath(p))
return progs
# we skip the existence check here because not all tests are built
# for all platforms (and it will fail on Windows anyway)
if mozinfo.isWin:
tests.extend([test['path'] + '.exe' for test in mp.active_tests(exists=False, disabled=False, **environ)])
else:
tests.extend([test['path'] for test in mp.active_tests(exists=False, disabled=False, **environ)])
# skip non-existing tests
tests = [test for test in tests if os.path.isfile(test)]
return tests
def main():
parser = CPPUnittestOptions()
@ -213,7 +215,7 @@ def main():
options,
{"tbpl": sys.stdout})
progs = extract_unittests_from_args(args, options.manifest_file)
progs = extract_unittests_from_args(args, mozinfo.info)
options.xre_path = os.path.abspath(options.xre_path)
if mozinfo.isMac:
options.xre_path = os.path.join(os.path.dirname(options.xre_path), 'Resources')

View File

@ -505,17 +505,12 @@ ifdef STRIP_CPP_TESTS
else
cp -RL $(DIST)/cppunittests $(PKG_STAGE)
endif
$(NSINSTALL) $(topsrcdir)/testing/runcppunittests.py $(PKG_STAGE)/cppunittests
$(NSINSTALL) $(topsrcdir)/testing/remotecppunittests.py $(PKG_STAGE)/cppunittests
ifeq ($(MOZ_WIDGET_TOOLKIT),android)
$(NSINSTALL) $(topsrcdir)/testing/android_cppunittest_manifest.txt $(PKG_STAGE)/cppunittests
endif
ifeq ($(MOZ_WIDGET_TOOLKIT),gonk)
$(NSINSTALL) $(topsrcdir)/testing/b2g_cppunittest_manifest.txt $(PKG_STAGE)/cppunittests
endif
cp $(topsrcdir)/testing/runcppunittests.py $(PKG_STAGE)/cppunittests
cp $(topsrcdir)/testing/remotecppunittests.py $(PKG_STAGE)/cppunittests
cp $(topsrcdir)/testing/cppunittest.ini $(PKG_STAGE)/cppunittests
ifeq ($(MOZ_DISABLE_STARTUPCACHE),)
$(NSINSTALL) $(topsrcdir)/startupcache/test/TestStartupCacheTelemetry.js $(PKG_STAGE)/cppunittests
$(NSINSTALL) $(topsrcdir)/startupcache/test/TestStartupCacheTelemetry.manifest $(PKG_STAGE)/cppunittests
cp $(topsrcdir)/startupcache/test/TestStartupCacheTelemetry.js $(PKG_STAGE)/cppunittests
cp $(topsrcdir)/startupcache/test/TestStartupCacheTelemetry.manifest $(PKG_STAGE)/cppunittests
endif
ifdef STRIP_CPP_TESTS
$(OBJCOPY) $(or $(STRIP_FLAGS),--strip-unneeded) $(DIST)/bin/jsapi-tests$(BIN_SUFFIX) $(PKG_STAGE)/cppunittests/jsapi-tests$(BIN_SUFFIX)