Browse Source

test: add --no-single-source to check whether normal build process works

mcspr-patch-1
Maxim Prokhorov 4 years ago
committed by Max Prokhorov
parent
commit
8e49523710
2 changed files with 6 additions and 2 deletions
  1. +1
    -1
      code/scripts/pio_pre.py
  2. +5
    -1
      code/scripts/test_build.py

+ 1
- 1
code/scripts/pio_pre.py View File

@ -150,7 +150,7 @@ if len(ino) == 1 and ino[0].name == "espurna.ino":
env.AddMethod(ConvertInoToCpp) env.AddMethod(ConvertInoToCpp)
# merge every .cpp into a single file and **only** build that single file # 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 = [] cpp_files = []
for root, dirs, filenames in os.walk("espurna"): for root, dirs, filenames in os.walk("espurna"):
for name in filenames: for name in filenames:


+ 5
- 1
code/scripts/test_build.py View File

@ -80,7 +80,8 @@ def run_configurations(args, configurations):
os_env = os.environ.copy() os_env = os.environ.copy()
os_env["PLATFORMIO_SRC_BUILD_FLAGS"] = "-DUSE_CUSTOM_H" os_env["PLATFORMIO_SRC_BUILD_FLAGS"] = "-DUSE_CUSTOM_H"
os_env["PLATFORMIO_BUILD_CACHE_DIR"] = "test/pio_cache" 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() start = time.time()
subprocess.check_call(cmd, env=os_env) subprocess.check_call(cmd, env=os_env)
@ -171,5 +172,8 @@ if __name__ == "__main__":
parser.add_argument( parser.add_argument(
"--no-silent", action="store_true", help="Do not silence pio-run" "--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()) main(parser.parse_args())

Loading…
Cancel
Save