@@ -24,12 +24,16 @@ const test = (suite, buildConfig = config.defaultBuildConfig, options) => {
   config.update(options)
 
   const braveArgs = [
-    '--enable-logging'
+    '--enable-logging=stderr'
   ]
 
   // Android doesn't support --v
   if (config.targetOS !== 'android') {
     braveArgs.push('--v=' + options.v)
+
+    if (options.vmodule) {
+      braveArgs.push('--vmodule=' + options.vmodule)
+    } 
   }
 
   if (options.filter) {
const path = require('path')

const config = require('../lib/config')
const util = require('../lib/util')

const getTestBinary = (suite) => {
  return (process.platform === 'win32') ? `${suite}.exe` : suite
}

const getTestsToRun = (config, suite) => {
  testsToRun = [suite]
  if (suite === 'brave_unit_tests') {
    if (config.targetOS !== 'android') {
      testsToRun.push('brave_installer_unittests')
    } else {
      testsToRun.push('bin/run_brave_public_test_apk')
    }
  }
  return testsToRun
}

const test = (suite, buildConfig = config.defaultBuildConfig, options) => {
  config.buildConfig = buildConfig
  config.update(options)

  const braveArgs = [
    '--enable-logging'
  ]

  // Android doesn't support --v
  if (config.targetOS !== 'android') {
    braveArgs.push('--v=' + options.v)
  }

  if (options.filter) {
    braveArgs.push('--gtest_filter=' + options.filter)
  }

  if (options.output) {
    braveArgs.push('--gtest_output=xml:' + options.output)
  }

  if (options.disable_brave_extension) {
    braveArgs.push('--disable-brave-extension')
  }

  if (options.single_process) {
    braveArgs.push('--single_process')
  }

  if (options.test_launcher_jobs) {
    braveArgs.push('--test-launcher-jobs=' + options.test_launcher_jobs)
  }

  // Build the tests
  util.run('ninja', ['-C', config.outputDir, suite], config.defaultOptions)

  if (config.targetOS === 'ios') {
    util.run(path.join(config.outputDir, "iossim"), [
      path.join(config.outputDir, `${suite}.app`),
      path.join(config.outputDir, `${suite}.app/PlugIns/${suite}_module.xctest`)
    ], config.defaultOptions)
  } else {
    // Fix the tests
    util.run('ninja', ['-C', config.outputDir, "fix_brave_test_install_name"], config.defaultOptions)
    util.run('ninja', ['-C', config.outputDir, "fix_brave_test_install_name_adblock"], config.defaultOptions)
    util.run('ninja', ['-C', config.outputDir, "fix_brave_test_install_name_speedreader"], config.defaultOptions)
    // Run the tests
    getTestsToRun(config, suite).forEach((testSuite) => {
      if (options.output) {
        braveArgs.splice(braveArgs.indexOf('--gtest_output=xml:' + options.output, 1))
        braveArgs.push(`--gtest_output=xml:${testSuite}.xml`)
      }
      util.run(path.join(config.outputDir, getTestBinary(testSuite)), braveArgs, config.defaultOptions)
    })
  }
}

module.exports = test

logs are only exposed if test fails