- return (Test.UNSUPPORTED,
- "Test requires the following features: %s" % msg)
-
- isXFail = isExpectedFail(xfails, xtargets, test.suite.config.target_triple)
- return script,isXFail,tmpBase,execdir
-
-def formatTestOutput(status, out, err, exitCode, failDueToStderr, script):
- output = StringIO.StringIO()
- print >>output, "Script:"
- print >>output, "--"
- print >>output, '\n'.join(script)
- print >>output, "--"
- print >>output, "Exit Code: %r" % exitCode,
- if failDueToStderr:
- print >>output, "(but there was output on stderr)"
- else:
- print >>output
- if out:
- print >>output, "Command Output (stdout):"
- print >>output, "--"
- output.write(out)
- print >>output, "--"
- if err:
- print >>output, "Command Output (stderr):"
- print >>output, "--"
- output.write(err)
- print >>output, "--"
- return (status, output.getvalue())
-
-def executeTclTest(test, litConfig):
- if test.config.unsupported:
- return (Test.UNSUPPORTED, 'Test is unsupported')
-
- # Parse the test script, normalizing slashes in substitutions on Windows
- # (since otherwise Tcl style lexing will treat them as escapes).
- res = parseIntegratedTestScript(test, normalize_slashes=kIsWindows)
- if len(res) == 2:
- return res
-
- script, isXFail, tmpBase, execdir = res
-
- if litConfig.noExecute:
- return (Test.PASS, '')
-
+ return lit.Test.Result(Test.UNSUPPORTED,
+ "Test requires the following features: %s" % msg)
+ unsupported_features = [f for f in unsupported
+ if f in test.config.available_features]
+ if unsupported_features:
+ msg = ', '.join(unsupported_features)
+ return lit.Test.Result(Test.UNSUPPORTED,
+ "Test is unsupported with the following features: %s" % msg)
+
+ unsupported_targets = [f for f in unsupported
+ if f in test.suite.config.target_triple]
+ if unsupported_targets:
+ return lit.Test.Result(Test.UNSUPPORTED,
+ "Test is unsupported with the following triple: %s" % (
+ test.suite.config.target_triple,))
+
+ if test.config.limit_to_features:
+ # Check that we have one of the limit_to_features features in requires.
+ limit_to_features_tests = [f for f in test.config.limit_to_features
+ if f in requires]
+ if not limit_to_features_tests:
+ msg = ', '.join(test.config.limit_to_features)
+ return lit.Test.Result(Test.UNSUPPORTED,
+ "Test requires one of the limit_to_features features %s" % msg)
+
+ return script,tmpBase,execdir
+
+def _runShTest(test, litConfig, useExternalSh,
+ script, tmpBase, execdir):