Skip to content

Commit a3e914e

Browse files
committed
using Conan machinery to test
1 parent 3ac405e commit a3e914e

File tree

6 files changed

+31
-20
lines changed

6 files changed

+31
-20
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ test/bin
2626

2727
# Conan artificats
2828
/tmp
29+
test/build

conanfile.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import os
21
from conans import (
32
ConanFile,
43
python_requires,
54
)
65

76

8-
b2 = python_requires("b2-helper/0.2.0@grisumbras/dev")
7+
b2 = python_requires("b2-helper/0.2.0@grisumbras/testing")
98

109

1110
class EnumFlagsConan(b2.B2.Mixin, ConanFile):
@@ -18,19 +17,13 @@ class EnumFlagsConan(b2.B2.Mixin, ConanFile):
1817
url = "https://github.com/grisumbras/enum-flags"
1918
homepage = url
2019

21-
settings = "os", "compiler", "build_type", "arch", "cppstd"
20+
exports_sources = "jamroot.jam", "build.jam", "*.hpp", "*.cpp", "LICENSE*",
2221
no_copy_source = True
22+
build_requires = "boost_build/[>=1.68]@bincrafters/stable"
2323

24-
def config_options(self):
25-
if not self.develop:
26-
del self.settings.os
27-
del self.settings.compiler
28-
del self.settings.build_type
29-
del self.settings.arch
30-
31-
def build_requirements(self):
32-
if self.develop:
33-
self.build_requires("boost_core/[>1.60]@bincrafters/stable")
24+
def b2_setup_builder(self, builder):
25+
print(self.source_folder, self.build_folder)
26+
return builder
3427

3528
def package_info(self):
3629
self.info.header_only()

jamroot.jam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import path ;
55
project enum-flags ;
66

77

8-
alias enum-flags : usage-requirements <include>include ;
8+
alias libs : usage-requirements <include>include ;
99

1010

1111
package.install headers enum-flags

test/build.jam

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
import testing ;
22

33

4-
project flags_tests
4+
project
55
: requirements <warnings>all
66
<warnings-as-errors>on
77
: default-build <variant>release
88
;
99

1010

11-
unit-test main-test
12-
: main-test.cpp
13-
/enum-flags//enum-flags
11+
run main-test.cpp
12+
/enum-flags//libs
1413
/boost_config//libs
1514
/boost_core//libs
1615
/boost_assert//libs
1716
;
1817

1918

20-
compile should-compile.cpp /enum-flags//enum-flags ;
19+
compile should-compile.cpp /enum-flags//libs ;
2120

2221

2322
for src in [ glob shouldnt-compile/*.cpp ] {
24-
compile-fail $(src) /enum-flags//enum-flags ;
23+
compile-fail $(src) /enum-flags//libs ;
2524
}

test/conanfile.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from conans import (
2+
ConanFile,
3+
python_requires,
4+
)
5+
6+
7+
b2 = python_requires("b2-helper/0.2.0@grisumbras/dev")
8+
9+
10+
class EnumFlagsTestConan(b2.B2.Mixin, ConanFile):
11+
settings = "os", "compiler", "build_type", "arch", "cppstd",
12+
build_requires = (
13+
"boost_build/[>=1.68]@bincrafters/stable",
14+
"boost_core/[>1.60]@bincrafters/stable",
15+
)
16+
17+
def test(self):
18+
pass

test/jamroot.jam

Whitespace-only changes.

0 commit comments

Comments
 (0)