Ver código fonte

Test that downloads a remote package and uses it in an executable

default_compile_flags
vector-of-bool 5 anos atrás
pai
commit
8aaa7d8f91
5 arquivos alterados com 28 adições e 1 exclusões
  1. +12
    -1
      tests/deps/do_test.py
  2. +3
    -0
      tests/deps/use-remote/library.dds
  3. +4
    -0
      tests/deps/use-remote/package.dds
  4. +1
    -0
      tests/deps/use-remote/remote.dds
  5. +8
    -0
      tests/deps/use-remote/src/app.main.cpp

+ 12
- 1
tests/deps/do_test.py Ver arquivo

@@ -1,7 +1,7 @@
import pytest
import subprocess

from tests import DDS, DDSFixtureParams, dds_fixture_conf
from tests import DDS, DDSFixtureParams, dds_fixture_conf, dds_fixture_conf_1

dds_conf = dds_fixture_conf(
DDSFixtureParams(ident='git-remote', subdir='git-remote'),
@@ -23,3 +23,14 @@ def test_deps_build(dds: DDS):
assert not dds.lmi_path.exists()
dds.deps_build()
assert dds.lmi_path.exists(), '`deps build` did not generate the build dir'


@dds_fixture_conf_1('use-remote')
def test_use_nlohmann_json_remote(dds: DDS):
dds.deps_get()
dds.deps_build()
dds.build(apps=True)

app_exe = dds.build_dir / f'app{dds.exe_suffix}'
assert app_exe.is_file()
subprocess.check_call([str(app_exe)])

+ 3
- 0
tests/deps/use-remote/library.dds Ver arquivo

@@ -0,0 +1,3 @@
Name: dummy

Uses: nlohmann/json

+ 4
- 0
tests/deps/use-remote/package.dds Ver arquivo

@@ -0,0 +1,4 @@
Name: json-test
Version: 0.0.0

Depends: nlohmann-json 3.7.1

+ 1
- 0
tests/deps/use-remote/remote.dds Ver arquivo

@@ -0,0 +1 @@
Remote-Package: nlohmann-json 3.7.1; git url=https://github.com/vector-of-bool/json.git ref=dds/3.7.1

+ 8
- 0
tests/deps/use-remote/src/app.main.cpp Ver arquivo

@@ -0,0 +1,8 @@
#include <nlohmann/json.hpp>

int main() {
nlohmann::json j = {
{"foo", "bar"},
};
return j.size() == 1 ? 0 : 12;
}

Carregando…
Cancelar
Salvar