From 8e495237108650aa656a2cfadad51713e7e849a1 Mon Sep 17 00:00:00 2001 From: Maxim Prokhorov Date: Thu, 16 Jul 2020 04:56:09 +0300 Subject: [PATCH] test: add --no-single-source to check whether normal build process works --- code/scripts/pio_pre.py | 2 +- code/scripts/test_build.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/code/scripts/pio_pre.py b/code/scripts/pio_pre.py index 723390d7..495f67e0 100644 --- a/code/scripts/pio_pre.py +++ b/code/scripts/pio_pre.py @@ -150,7 +150,7 @@ if len(ino) == 1 and ino[0].name == "espurna.ino": env.AddMethod(ConvertInoToCpp) # merge every .cpp into a single file and **only** build that single file -if os.environ.get("ESPURNA_BUILD_SINGLE_SOURCE"): +if "1" == os.environ.get("ESPURNA_BUILD_SINGLE_SOURCE", "0"): cpp_files = [] for root, dirs, filenames in os.walk("espurna"): for name in filenames: diff --git a/code/scripts/test_build.py b/code/scripts/test_build.py index 1587efe3..b3606af8 100755 --- a/code/scripts/test_build.py +++ b/code/scripts/test_build.py @@ -80,7 +80,8 @@ def run_configurations(args, configurations): os_env = os.environ.copy() os_env["PLATFORMIO_SRC_BUILD_FLAGS"] = "-DUSE_CUSTOM_H" os_env["PLATFORMIO_BUILD_CACHE_DIR"] = "test/pio_cache" - os_env["ESPURNA_BUILD_SINGLE_SOURCE"] = "1" + if not args.no_single_source: + os_env["ESPURNA_BUILD_SINGLE_SOURCE"] = "1" start = time.time() subprocess.check_call(cmd, env=os_env) @@ -171,5 +172,8 @@ if __name__ == "__main__": parser.add_argument( "--no-silent", action="store_true", help="Do not silence pio-run" ) + parser.add_argument( + "--no-single-source", action="store_true", help="Disable 'unity' build" + ) main(parser.parse_args())