mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-02 18:11:04 +08:00
This significantly speeds up Karma execution times to about 12 seconds on an unchanged build folder. It uses the Ninja build output to find the unittest files. You can run the new script with: npm run unittest npm run unittest -- --target=Release To make sure you perform a minimal build and run tests right after it, run: npm run auto-unittest npm run auto-unittest -- --target=Release If no ninja-build-name is set, it assumes that `out/Default` exists. The `auto-unittest` command will run autoninja for you on the output folder. R=jacktfranklin@chromium.org,aerotwist@chromium.org No-Presubmit: true Bug: 1061125 Change-Id: I45edd11e422c5cdc8a4fc0bbb6bc43e386519aa9 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2102717 Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org> Reviewed-by: Brandon Goddard <brgoddar@microsoft.com> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org> Reviewed-by: Paul Lewis <aerotwist@chromium.org>
25 lines
721 B
Python
25 lines
721 B
Python
#!/usr/bin/env python
|
|
#
|
|
# Copyright 2019 The Chromium Authors. All rights reserved.
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
"""
|
|
Run unit tests on a pinned version of chrome after automatically compiling the required files
|
|
"""
|
|
|
|
import argparse
|
|
import subprocess
|
|
import sys
|
|
from os import path
|
|
|
|
ROOT_DIRECTORY = path.join(path.dirname(path.abspath(__file__)), '..', '..')
|
|
|
|
|
|
def recompile(ninja_build_name, ninja_target_name):
|
|
ninja_proc = subprocess.Popen(['autoninja', '-C', 'out/{}'.format(ninja_build_name), ninja_target_name], cwd=ROOT_DIRECTORY)
|
|
|
|
ninja_proc.communicate()
|
|
|
|
if ninja_proc.returncode != 0:
|
|
sys.exit(ninja_proc.returncode)
|