mirror of
https://github.com/xoseperez/espurna.git
synced 2026-03-06 16:27:12 +01:00
Add cppcheck preaction to extra_scripts.py (disabled atm)
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
#!/usr/bin/env python
|
||||
from subprocess import call
|
||||
import os
|
||||
import time
|
||||
|
||||
Import("env")
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
@@ -31,6 +34,11 @@ def clr(color, text):
|
||||
# Callbacks
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
def cpp_check(source, target, env):
|
||||
print("Started cppcheck...\n")
|
||||
call(["cppcheck", os.getcwd()+"/espurna", "--force", "--enable=all"])
|
||||
print("Finished cppcheck...\n")
|
||||
|
||||
def check_size(source, target, env):
|
||||
time.sleep(2)
|
||||
size = target[0].get_size()
|
||||
@@ -55,5 +63,6 @@ def add_build_flags(source, target, env):
|
||||
# Hooks
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
#env.AddPreAction("buildprog", cpp_check)
|
||||
env.AddPreAction("$BUILD_DIR/src/espurna.ino.o", add_build_flags)
|
||||
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", check_size)
|
||||
|
||||
Reference in New Issue
Block a user