Compare commits

...

2 Commits

Author SHA1 Message Date
Dmitry Ivanov
0ce4538e67 Rework build profiles in root Cargo.toml 2022-07-08 02:08:53 +03:00
Dmitry Ivanov
7042f9d12d Minor fixes to scripts/coverage 2022-07-08 02:08:28 +03:00
2 changed files with 13 additions and 6 deletions

View File

@@ -11,10 +11,17 @@ members = [
]
[profile.release]
# This is useful for profiling and, to some extent, debug.
# Besides, debug info should not affect the performance.
strip = "debuginfo"
[profile.perf]
inherits = "release"
debug = true
[profile.release-coverage]
inherits = "release"
overflow-checks = true
debug-assertions = true
# This is only needed for proxy's tests.
# TODO: we should probably fork `tokio-postgres-rustls` instead.
[patch.crates-io]

View File

@@ -94,9 +94,9 @@ class Cargo:
'test',
'--no-run',
'--message-format=json',
f'--profile={profile}',
]
env = dict(os.environ, PROFILE=profile)
output = subprocess.check_output(cmd, cwd=self.cwd, env=env, text=True)
output = subprocess.check_output(cmd, cwd=self.cwd, text=True)
for line in output.splitlines(keepends=False):
meta = json.loads(line)
@@ -210,7 +210,8 @@ class ProfDir:
@property
def files(self) -> List[Path]:
return [f for f in self.cwd.iterdir() if f.suffix in ('.profraw', '.profdata')]
exts = ('.profraw', '.profdata')
return sorted([f for f in self.cwd.iterdir() if f.suffix in exts])
@property
def file_names_hash(self) -> str:
@@ -546,7 +547,6 @@ self-contained example:
p_report = commands.add_parser('report', help='generate a coverage report')
p_report.add_argument('--profile',
default='debug',
choices=('debug', 'release'),
help='cargo build profile')
p_report.add_argument('--format',
default='html',