|
6 | 6 |
|
7 | 7 | WIDTH = 80 |
8 | 8 | VAR_CUSTOM_INIT_SCRIPT = "CUSTOM_INIT_SCRIPT".freeze |
| 9 | +VAR_USE_SUBDIR = "USE_SUBDIR".freeze |
9 | 10 | VAR_EXPECT_EXAMPLES = "EXPECT_EXAMPLES".freeze |
10 | 11 | VAR_EXPECT_UNITTESTS = "EXPECT_UNITTESTS".freeze |
11 | 12 |
|
@@ -54,6 +55,7 @@ def self.parse(options) |
54 | 55 | puts "Additionally, the following environment variables control the script:" |
55 | 56 | puts " - #{VAR_CUSTOM_INIT_SCRIPT} - if set, this script will be run from the Arduino/libraries directory" |
56 | 57 | puts " prior to any automated library installation or testing (e.g. to install unoffical libraries)" |
| 58 | + puts " - #{VAR_USE_SUBDIR} - if set, the script will install the library from this subdirectory of the cwd" |
57 | 59 | puts " - #{VAR_EXPECT_EXAMPLES} - if set, testing will fail if no example sketches are present" |
58 | 60 | puts " - #{VAR_EXPECT_UNITTESTS} - if set, testing will fail if no unit tests are present" |
59 | 61 | exit |
@@ -424,8 +426,10 @@ def perform_example_compilation_tests(cpp_library, config) |
424 | 426 | # run any library init scripts from the library itself. |
425 | 427 | perform_custom_initialization(config) |
426 | 428 |
|
| 429 | + |
427 | 430 | # initialize library under test |
428 | | -cpp_library_path = Pathname.new(".") |
| 431 | +inform("Environment variable #{VAR_USE_SUBDIR}") { "'#{ENV[VAR_USE_SUBDIR]}'" } |
| 432 | +cpp_library_path = Pathname.new(ENV[VAR_USE_SUBDIR].nil? ? "." : ENV[VAR_USE_SUBDIR]) |
429 | 433 | cpp_library = assure("Installing library under test") do |
430 | 434 | @backend.install_local_library(cpp_library_path) |
431 | 435 | end |
|
0 commit comments