Skip to content

Commit 5013021

Browse files
committed
Add skip_on_server. Provide a compiler for ninja tests.
1 parent 4a112e9 commit 5013021

11 files changed

Lines changed: 19 additions & 11 deletions

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ cppan_add_package(
154154
pvt.cppan.demo.giovannidicanio.winreg-master
155155
pvt.cppan.demo.mpark.variant-1
156156

157-
pvt.cppan.demo.philsquared.catch-1
157+
pvt.cppan.demo.catchorg.catch2-1
158158
)
159159
cppan_execute()
160160

src/common/checks.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ class Check
8787
using Value = int;
8888

8989
public:
90-
Check(const Information &i, const CheckParameters &parameters = CheckParameters());
91-
virtual ~Check() {}
90+
Check(Information i, const CheckParameters &parameters = CheckParameters());
91+
virtual ~Check() = default;
9292

9393
const Information &getInformation() const { return information; }
9494
String getVariable() const { return variable; }

src/common/project.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,8 @@ void Project::load(const yaml &root)
854854
YAML_EXTRACT_AUTO(export_all_symbols);
855855
YAML_EXTRACT_AUTO(export_if_static);
856856
YAML_EXTRACT_AUTO(rc_enabled);
857-
YAML_EXTRACT_AUTO(disabled);
857+
//YAML_EXTRACT_AUTO(disabled);
858+
YAML_EXTRACT_AUTO(skip_on_server);
858859
YAML_EXTRACT_AUTO(build_dependencies_with_same_config);
859860

860861
api_name = get_sequence_set<String>(root, "api_name");
@@ -1472,7 +1473,8 @@ yaml Project::save() const
14721473
ADD_IF_VAL_TRIPLE(export_all_symbols);
14731474
ADD_IF_VAL_TRIPLE(export_if_static);
14741475
ADD_IF_NOT_VAL_TRIPLE(rc_enabled);
1475-
ADD_IF_VAL_TRIPLE(disabled);
1476+
//ADD_IF_VAL_TRIPLE(disabled);
1477+
ADD_IF_VAL_TRIPLE(skip_on_server);
14761478
ADD_IF_VAL_TRIPLE(build_dependencies_with_same_config);
14771479

14781480
ADD_SET(api_name, api_name);

src/common/project.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ struct Project
240240
bool export_if_static = false;
241241
bool build_dependencies_with_same_config = false;
242242
bool rc_enabled = true;
243-
bool disabled = false;
243+
//bool disabled = false;
244+
bool skip_on_server = false;
244245

245246
StringSet api_name;
246247
String output_name; // file name

src/common/yaml.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ String dump_yaml_config(const yaml &root)
178178
"rc_enabled",
179179
"build_dependencies_with_same_config",
180180
"disabled",
181+
"skip_on_server",
181182

182183
"api_name",
183184

src/printers/cmake.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ add_custom_command(TARGET )" + target + R"( POST_BUILD
972972

973973
ScopedDependencyCondition sdc(ctx, p);
974974
ctx.addLine("get_target_property(imploc_" + p.variable_name + " " + p.target_name + " IMPORTED_LOCATION_${CMAKE_BUILD_TYPE_UPPER})");
975-
975+
976976
// FIXME: on apple some targets fail to find above var
977977
//ctx.if_("\"${imploc_" + p.variable_name + "}\" STREQUAL \"imploc_" + p.variable_name + "-NOTFOUND\"");
978978
//ctx.addLine("set(imploc_" + p.variable_name + ")");

test/run/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,20 @@ endmacro()
3434

3535
macro(cppan_add_test_bdir name type)
3636
cppan_add_test(${name} ${type} $<TARGET_FILE:client> -d ${bdir} ${ARGN})
37+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${name}.yml ${bdir}/cppan.yml)
3738
endmacro()
3839

3940
macro(cppan_add_test_simple name)
4041
set(type simple)
4142
set_bdir(${name} ${type})
4243
cppan_add_test_bdir(${name} ${type})
43-
44-
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${name}.yml ${bdir}/cppan.yml)
4544
endmacro()
4645

4746
macro(cppan_add_test_generate name)
4847
set(type generate)
4948
set_bdir(${name} ${type})
5049
cppan_add_test_bdir(${name} ${type} --generate .)
5150

52-
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${name}.yml ${bdir}/cppan.yml)
5351
file(WRITE ${bdir}/dummy.cpp "int main(){}")
5452
endmacro()
5553

@@ -58,7 +56,6 @@ macro(cppan_add_test_build name)
5856
set_bdir(${name} ${type})
5957
cppan_add_test_bdir(${name} ${type} --build .)
6058

61-
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${name}.yml ${bdir}/cppan.yml)
6259
file(WRITE ${bdir}/dummy.cpp "int main(){}")
6360
endmacro()
6461

@@ -77,6 +74,9 @@ cppan_add_test_suite(dep_in_dep_png_nanobp_no_cache)
7774
find_program(n ninja)
7875
find_program(nb ninja-build)
7976
if (NOT WIN32 AND NOT ("${n}" STREQUAL "n-NOTFOUND" AND "${nb}" STREQUAL "nb-NOTFOUND"))
77+
if (WIN32)
78+
set(test_compiler "compiler: \"${CMAKE_CXX_COMPILER}\"")
79+
endif()
8080
cppan_add_test_suite(dep_in_dep_png_nanobp_ninja)
8181
# FIXME:
8282
#cppan_add_test_suite(dep_in_dep_png_nanobp_ninja_strict)

test/run/dep_in_dep_png_nanobp_ninja.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
local_settings:
22
storage_dir: storage
33
build:
4+
${test_compiler}
45
generator: Ninja
56

67
projects:

test/run/dep_in_dep_png_nanobp_ninja_strict.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
local_settings:
22
storage_dir: storage
33
build:
4+
${test_compiler}
45
generator: Ninja
56
additional_build_args:
67
- -w

test/run/dep_in_dep_png_nanobp_no_cache_ninja.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ local_settings:
22
storage_dir: storage
33
use_cache: false
44
build:
5+
${test_compiler}
56
generator: Ninja
67

78
projects:

0 commit comments

Comments
 (0)