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
+9 -2
View File
@@ -11,10 +11,17 @@ members = [
] ]
[profile.release] [profile.release]
# This is useful for profiling and, to some extent, debug. strip = "debuginfo"
# Besides, debug info should not affect the performance.
[profile.perf]
inherits = "release"
debug = true debug = true
[profile.release-coverage]
inherits = "release"
overflow-checks = true
debug-assertions = true
# This is only needed for proxy's tests. # This is only needed for proxy's tests.
# TODO: we should probably fork `tokio-postgres-rustls` instead. # TODO: we should probably fork `tokio-postgres-rustls` instead.
[patch.crates-io] [patch.crates-io]
+4 -4
View File
@@ -94,9 +94,9 @@ class Cargo:
'test', 'test',
'--no-run', '--no-run',
'--message-format=json', '--message-format=json',
f'--profile={profile}',
] ]
env = dict(os.environ, PROFILE=profile) output = subprocess.check_output(cmd, cwd=self.cwd, text=True)
output = subprocess.check_output(cmd, cwd=self.cwd, env=env, text=True)
for line in output.splitlines(keepends=False): for line in output.splitlines(keepends=False):
meta = json.loads(line) meta = json.loads(line)
@@ -210,7 +210,8 @@ class ProfDir:
@property @property
def files(self) -> List[Path]: 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 @property
def file_names_hash(self) -> str: 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 = commands.add_parser('report', help='generate a coverage report')
p_report.add_argument('--profile', p_report.add_argument('--profile',
default='debug', default='debug',
choices=('debug', 'release'),
help='cargo build profile') help='cargo build profile')
p_report.add_argument('--format', p_report.add_argument('--format',
default='html', default='html',