Browse Source

Use pytest for our smoke tests

default_compile_flags
vector-of-bool 5 years ago
parent
commit
3e55042a45
2 changed files with 11 additions and 7 deletions
  1. +2
    -1
      .gitignore
  2. +9
    -6
      tools/ci.py

+ 2
- 1
.gitignore View File

.mypy_cache/ .mypy_cache/
*.dsd/ *.dsd/
_prebuilt/ _prebuilt/
.dds-repo-lock
.dds-repo-lock
.pytest_cache

+ 9
- 6
tools/ci.py View File

import argparse import argparse
import os import os
import sys import sys
import pytest
from pathlib import Path from pathlib import Path
from typing import Sequence, NamedTuple from typing import Sequence, NamedTuple
import subprocess import subprocess
'darwin': 'dds-macos-x64', 'darwin': 'dds-macos-x64',
}.get(sys.platform) }.get(sys.platform)
if filename is None: if filename is None:
raise RuntimeError(f'We do not have a prebuilt DDS binary for the "{sys.platform}" platform')
raise RuntimeError(f'We do not have a prebuilt DDS binary for '
f'the "{sys.platform}" platform')
url = f'https://github.com/vector-of-bool/dds/releases/download/bootstrap-p2/{filename}' url = f'https://github.com/vector-of-bool/dds/releases/download/bootstrap-p2/{filename}'


print(f'Downloading prebuilt DDS executable: {url}') print(f'Downloading prebuilt DDS executable: {url}')
parser.add_argument( parser.add_argument(
'-B', '-B',
'--bootstrap-with', '--bootstrap-with',
help=
'Skip the prebuild-bootstrap step. This requires a _prebuilt/dds to exist!',
choices=('download', 'build'),
help='How are we to obtain a bootstrapped DDS executable?',
choices=('download', 'build', 'skip'),
required=True, required=True,
) )
parser.add_argument( parser.add_argument(
_do_bootstrap_build(opts) _do_bootstrap_build(opts)
elif args.bootstrap_with == 'download': elif args.bootstrap_with == 'download':
_do_bootstrap_download() _do_bootstrap_download()
elif args.bootstrap_with == 'skip':
pass
else: else:
assert False, 'impossible' assert False, 'impossible'


subprocess.check_call([ subprocess.check_call([
sys.executable, sys.executable,
'-u', '-u',
str(TOOLS_DIR / 'test.py'),
str(TOOLS_DIR / 'self-test.py'),
f'--exe={PROJECT_ROOT / f"_build/dds{exe_suffix}"}', f'--exe={PROJECT_ROOT / f"_build/dds{exe_suffix}"}',
f'-T{opts.toolchain}', f'-T{opts.toolchain}',
]) ])


return 0
return pytest.main(['-v', '--durations=10'])




if __name__ == "__main__": if __name__ == "__main__":

Loading…
Cancel
Save