blob: 045cbb00608f821c3cf401b0cc1aefcc5303ce4f [file] [log] [blame]
#!/usr/bin/env python3
import os
import subprocess
def call(*cmd):
print()
print('$', *cmd)
subprocess.check_call(cmd)
def gn_test():
"""Test with gn."""
out = '.presubmit/gn'
call('gn', 'gen', out)
with open(os.path.join(out, 'args.gn'), 'a') as outs:
print('pw_unit_test_create_run_targets = true', file=outs)
call('ninja', '-C', out)
def bazel_test():
"""Test with bazel."""
prefix = '.presubmit/bazel-'
call('bazel', 'build', '//...', '--symlink_prefix', prefix)
call('bazel', 'test', '//...', '--symlink_prefix', prefix)
if __name__ == '__main__':
bazel_test()
gn_test()