Browse Source

Add cppcheck preaction to extra_scripts.py (disabled atm)

rfm69
Xose Pérez 6 years ago
parent
commit
cdf7254acc
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      code/extra_scripts.py

+ 9
- 0
code/extra_scripts.py View File

@ -1,5 +1,8 @@
#!/usr/bin/env python #!/usr/bin/env python
from subprocess import call
import os
import time import time
Import("env") Import("env")
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@ -31,6 +34,11 @@ def clr(color, text):
# Callbacks # 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): def check_size(source, target, env):
time.sleep(2) time.sleep(2)
size = target[0].get_size() size = target[0].get_size()
@ -55,5 +63,6 @@ def add_build_flags(source, target, env):
# Hooks # Hooks
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
#env.AddPreAction("buildprog", cpp_check)
env.AddPreAction("$BUILD_DIR/src/espurna.ino.o", add_build_flags) env.AddPreAction("$BUILD_DIR/src/espurna.ino.o", add_build_flags)
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", check_size) env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", check_size)

Loading…
Cancel
Save