Skip to content

Commit 88d3368

Browse files
authored
Fix test_requires placement and gtest version (#195)
* fix test_requires placement and gtest version * wip * wip * relaunch ci * wip * fix * wip * fix
1 parent 2357410 commit 88d3368

File tree

11 files changed

+27
-15
lines changed

11 files changed

+27
-15
lines changed

tutorial/creating_packages/build_method/ci_test_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
print("- Building and running tests in the build() method -")
55

6-
out = run(f"conan create . --build=missing --build=hello*")
6+
out = run(f"conan create . -s compiler.cppstd=17 --build=missing --build=hello*")
77

88
assert "Running 1 test from 1 test suite." in out
99

10-
out = run(f"conan create . --build=missing --build=hello* -c tools.build:skip_test=True")
10+
out = run(f"conan create . -s compiler.cppstd=17 --build=missing --build=hello* -c tools.build:skip_test=True")
1111

1212
assert "Running 1 test from 1 test suite." not in out

tutorial/creating_packages/build_method/conanfile.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ def source(self):
5252
def requirements(self):
5353
if self.options.with_fmt:
5454
self.requires("fmt/8.1.1")
55-
self.test_requires("gtest/1.11.0")
55+
56+
def build_requirements(self):
57+
self.test_requires("gtest/1.17.0")
5658

5759
def layout(self):
5860
cmake_layout(self)

tutorial/creating_packages/other_packages/header_only_gtest/ci_test_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from test.examples_tools import run
44

5-
cmd_out = run("conan create . -s compiler.cppstd=14 --build missing")
5+
cmd_out = run("conan create . -s compiler.cppstd=17 --build missing")
66
assert "[ PASSED ] 1 test." in cmd_out
77
assert "sum/0.1: Package 'da39a3ee5e6b4b0d3255bfef95601890afd80709' built"
88

tutorial/creating_packages/other_packages/header_only_gtest/conanfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ class SumConan(ConanFile):
1818
def validate(self):
1919
check_min_cppstd(self, 11)
2020

21-
def requirements(self):
22-
self.test_requires("gtest/1.11.0")
21+
def build_requirements(self):
22+
self.test_requires("gtest/1.17.0")
2323

2424
def layout(self):
2525
cmake_layout(self)

tutorial/creating_packages/package_information/ci_test_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
print("- Define information for consumers depending on settings or options -")
77

8-
out = run(f"conan create . --build=missing")
8+
out = run(f"conan create . --build=missing -s compiler.cppstd=17")
99

1010
assertion = "Packaged 1 '.lib' file: hello-static.lib" if platform.system()=="Windows" else "Packaged 1 '.a' file: libhello-static.a"
1111

@@ -19,6 +19,6 @@
1919
os.rename(os.path.join("test_package", "CMakeLists.txt"), os.path.join("test_package", "CMakeLists_.txt"))
2020
os.rename(os.path.join("test_package", "CMakeLists_properties.txt"), os.path.join("test_package", "CMakeLists.txt"))
2121

22-
out = run(f"conan create . --build=missing")
22+
out = run(f"conan create . --build=missing -s compiler.cppstd=17")
2323

2424
assert "Target declared 'hello::myhello'" in out

tutorial/creating_packages/package_information/conanfile.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ def source(self):
5252
def requirements(self):
5353
if self.options.with_fmt:
5454
self.requires("fmt/8.1.1")
55-
self.test_requires("gtest/1.11.0")
55+
56+
def build_requirements(self):
57+
self.test_requires("gtest/1.17.0")
5658

5759
def layout(self):
5860
cmake_layout(self)

tutorial/creating_packages/package_information/conanfile_properties.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ def source(self):
5252
def requirements(self):
5353
if self.options.with_fmt:
5454
self.requires("fmt/8.1.1")
55-
self.test_requires("gtest/1.11.0")
55+
56+
def build_requirements(self):
57+
self.test_requires("gtest/1.17.0")
5658

5759
def layout(self):
5860
cmake_layout(self)

tutorial/creating_packages/package_method/ci_test_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
print("- Package method with cmake.install() -")
55

6-
out = run(f"conan create . --build=missing")
6+
out = run(f"conan create . --build=missing -s compiler.cppstd=17")
77

88
print("- Package method with copy() -")
99

10-
out = run(f"conan create manual_install.py --build=missing")
10+
out = run(f"conan create manual_install.py -s compiler.cppstd=17 --build=missing")

tutorial/creating_packages/package_method/conanfile.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ def source(self):
5252
def requirements(self):
5353
if self.options.with_fmt:
5454
self.requires("fmt/8.1.1")
55-
self.test_requires("gtest/1.11.0")
55+
56+
def build_requirements(self):
57+
self.test_requires("gtest/1.17.0")
5658

5759
def layout(self):
5860
cmake_layout(self)

tutorial/creating_packages/package_method/manual_install.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ def source(self):
5353
def requirements(self):
5454
if self.options.with_fmt:
5555
self.requires("fmt/8.1.1")
56-
self.test_requires("gtest/1.11.0")
56+
57+
def build_requirements(self):
58+
self.test_requires("gtest/1.17.0")
5759

5860
def layout(self):
5961
cmake_layout(self)

0 commit comments

Comments
 (0)