Parcourir la source

Cleaner smoke test output

default_compile_flags
vector-of-bool il y a 5 ans
Parent
révision
b61b65df2a
4 fichiers modifiés avec 27 ajouts et 20 suppressions
  1. +2
    -0
      build.py
  2. +2
    -1
      manifest.dds
  3. +1
    -1
      src/dds/manifest.cpp
  4. +22
    -18
      test.py

+ 2
- 0
build.py Voir le fichier

@@ -52,6 +52,7 @@ def _create_compile_command(opts: BuildOptions, cpp_file: Path,
'-Wshadow',
'-Wconversion',
'-fdiagnostics-color',
'-DFMT_HEADER_ONLY=1',
'-pthread',
'-c',
str(cpp_file),
@@ -75,6 +76,7 @@ def _create_compile_command(opts: BuildOptions, cpp_file: Path,
'/nologo',
'/EHsc',
'/std:c++latest',
'/DFMT_HEADER_ONLY=1',
f'/I{HERE_DIR / "src"}',
str(cpp_file),
'/c',

+ 2
- 1
manifest.dds Voir le fichier

@@ -1,2 +1,3 @@
Private-Include: external/spdlog/include
Private-Include: external/wil/include
Private-Include: external/wil/include
Private-Define: FMT_HEADER_ONLY=1

+ 1
- 1
src/dds/manifest.cpp Voir le fichier

@@ -12,7 +12,7 @@ library_manifest library_manifest::load_from_file(const fs::path& fpath) {
for (auto& pair : kvs.items()) {
if (pair.key() == "Private-Include") {
ret.private_includes.emplace_back(pair.value());
} else if (pair.key() == "Private-Defines") {
} else if (pair.key() == "Private-Define") {
ret.private_defines.emplace_back(pair.value());
} else {
throw std::runtime_error(

+ 22
- 18
test.py Voir le fichier

@@ -2,6 +2,7 @@
import argparse
from pathlib import Path
from typing import List, NamedTuple
import shutil
import subprocess
import sys

@@ -12,24 +13,27 @@ class TestOptions(NamedTuple):


def run_test_dir(dir: Path, opts: TestOptions) -> bool:
try:
subprocess.check_call(
[
str(opts.exe),
'build',
'--export',
'--warnings',
'--tests',
'--toolchain',
opts.toolchain,
],
cwd=dir,
)
except subprocess.CalledProcessError:
import traceback
traceback.print_exc()
return False
return True
print(f'Running test: {dir.name} ...')
out_dir = dir / '_build'
if out_dir.exists():
shutil.rmtree(out_dir)
res = subprocess.run(
[
str(opts.exe),
'build',
'--export',
'--warnings',
'--tests',
f'--toolchain={opts.toolchain}',
f'--out-dir={out_dir}',
],
cwd=dir,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
)
if res.returncode != 0:
print(f'Test failed with exit code [{res.returncode}]:\n{res.stdout}')
return res.returncode == 0


def run_tests(opts: TestOptions) -> int:

Chargement…
Annuler
Enregistrer