コード例 #1
0
def run_gtest_apptest(shell, shell_args, apptest_url, apptest_args, isolate):
  """Runs a gtest apptest.

  Args:
    shell: Wrapper around concrete Mojo shell, implementing devtools Shell
        interface.
    shell_args: The arguments for mojo_shell.
    apptest_url: Url of the apptest app to run.
    apptest_args: Parameters to be passed to the apptest app.
    isolate: Iff True, each test in the app will be run in a separate shell run.

  Returns:
    True iff the test succeeded, False otherwise.
  """

  if not isolate:
    return run_apptest(shell, shell_args, apptest_url, apptest_args,
                       _gtest_apptest_output_test)

  # List the apptest fixtures so they can be run independently for isolation.
  fixtures = get_fixtures(shell, shell_args, apptest_url)
  if not fixtures:
    print "No tests to run found in %s." % apptest_url
    return False

  apptest_result = True
  for fixture in fixtures:
    isolated_apptest_args = apptest_args + ["--gtest_filter=%s" % fixture]
    success = run_apptest(shell, shell_args, apptest_url, isolated_apptest_args,
                          _gtest_apptest_output_test)

    if not success:
      apptest_result = False

  return apptest_result
コード例 #2
0
ファイル: apptest_dart.py プロジェクト: willbittner/mojo
def run_dart_apptest(shell, shell_args, apptest_url, apptest_args, timeout):
    """Runs a dart apptest.

  Args:
    shell_args: The arguments for mojo_shell.
    apptest_url: Url of the apptest app to run.
    apptest_args: Parameters to be passed to the apptest app.

  Returns:
    True iff the test succeeded, False otherwise.
  """
    return run_apptest(shell, shell_args, apptest_url, apptest_args, timeout, _dart_apptest_output_test)
コード例 #3
0
ファイル: apptest_dart.py プロジェクト: scorelab/mojo
def run_dart_apptest(shell, shell_args, apptest_url, apptest_args, timeout):
    """Runs a dart apptest.

  Args:
    shell_args: The arguments for mojo_shell.
    apptest_url: Url of the apptest app to run.
    apptest_args: Parameters to be passed to the apptest app.

  Returns:
    True iff the test succeeded, False otherwise.
  """
    return run_apptest(shell, shell_args, apptest_url, apptest_args, timeout,
                       _dart_apptest_output_test)
コード例 #4
0
ファイル: apptest_gtest.py プロジェクト: freiling/mojo
def run_gtest_apptest(shell, shell_args, apptest_url, apptest_args, timeout,
                      isolate):
  """Runs a gtest apptest.

  Args:
    shell: Wrapper around concrete Mojo shell, implementing devtools Shell
        interface.
    shell_args: The arguments for mojo_shell.
    apptest_url: Url of the apptest app to run.
    apptest_args: Parameters to be passed to the apptest app.
    isolate: Iff True, each test in the app will be run in a separate shell run.

  Returns:
    True iff the test succeeded, False otherwise.
  """

  if not isolate:
    return run_apptest(shell, shell_args, apptest_url, apptest_args, timeout,
                       _gtest_apptest_output_test)

  # List the apptest fixtures so they can be run independently for isolation.
  fixtures = get_fixtures(shell, shell_args, apptest_url)
  if not fixtures:
    print "No tests to run found in %s." % apptest_url
    return False

  apptest_result = True
  for fixture in fixtures:
    isolated_apptest_args = apptest_args + ["--gtest_filter=%s" % fixture]
    success = run_apptest(shell, shell_args, apptest_url, isolated_apptest_args,
                          timeout, _gtest_apptest_output_test)

    if not success:
      apptest_result = False

  return apptest_result