File tree 3 files changed +29
-3
lines changed
3 files changed +29
-3
lines changed Original file line number Diff line number Diff line change 1
1
# -*- coding: utf-8 -*-
2
2
3
- __version__ = '0.18.0 '
3
+ __version__ = '0.18.1 '
Original file line number Diff line number Diff line change 10
10
11
11
12
12
def get_recipe_path (cwd = None ):
13
+ conanfile = os .getenv ("CONAN_CONANFILE" , "conanfile.py" )
13
14
if cwd is None :
14
- return " conanfile.py"
15
+ return conanfile
15
16
else :
16
- return os .path .join (cwd , " conanfile.py" )
17
+ return os .path .join (cwd , conanfile )
17
18
18
19
19
20
def get_bool_from_env (var_name , default = "1" ):
Original file line number Diff line number Diff line change
1
+ # -*- coding: utf-8 -*-
2
+
3
+ import os
4
+ import pytest
5
+
6
+ from bincrafters .build_shared import get_recipe_path
7
+
8
+
9
+ @pytest .fixture ()
10
+ def set_conanfile_path ():
11
+ os .environ ["CONAN_CONANFILE" ] = "foobar.py"
12
+ yield
13
+ del os .environ ["CONAN_CONANFILE" ]
14
+
15
+
16
+ def test_get_recipe_path_default ():
17
+ assert "conanfile.py" == get_recipe_path ()
18
+
19
+
20
+ def test_get_recipe_path_conanfile (set_conanfile_path ):
21
+ assert "foobar.py" == get_recipe_path ()
22
+
23
+
24
+ def test_get_recipe_path_custom ():
25
+ assert os .path .join ("tmp" , "conanfile.py" ) == get_recipe_path (cwd = "tmp" )
You can’t perform that action at this time.
0 commit comments