Skip to content

Commit

Permalink
Merge pull request #88 from sealne/test-clean
Browse files Browse the repository at this point in the history
Add test in travis to check if make clean actually removes all generated files
  • Loading branch information
mithro committed Oct 6, 2015
2 parents 153afba + bc57915 commit f13c17a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
22 changes: 19 additions & 3 deletions .travis/run.sh
Expand Up @@ -18,6 +18,9 @@ else
BOARDS="$BOARD"
fi

# Create "clean" file list before build
find | sort > /tmp/filelist.before

for BOARD in $BOARDS; do
if [ -z "$TARGET" ]; then
TARGETS="base hdmi2usb"
Expand Down Expand Up @@ -83,16 +86,29 @@ for BOARD in $BOARDS; do
done
fi

# FIXME(https://github.com/timvideos/HDMI2USB-misoc-firmware/issues/83):
# Check after a "make clean" that only the initial files
# remain.
echo ""
echo ""
echo ""
echo "- make clean ($BOARD $TARGET)"
echo "---------------------------------------------"
BOARD=$BOARD TARGET=$TARGET make clean
echo "============================================="

# Check that make clean didn't leave anything behind
find | sort > /tmp/filelist.after
echo ""
echo ""
echo ""
if ! diff -u /tmp/filelist.before /tmp/filelist.after > /tmp/filelist.diff; then
echo "- make clean did not leave any generated files behind"
else
echo "- make clean left these files behind"
echo "============================================="
cat /tmp/filelist.diff | grep "^+"
echo "============================================="
exit 1
fi

done
)
done
2 changes: 2 additions & 0 deletions Makefile
Expand Up @@ -107,6 +107,8 @@ clean:
rm -rf $(MSCDIR)/software/include/generated && ( \
mkdir $(MSCDIR)/software/include/generated && \
touch $(MSCDIR)/software/include/generated/.keep_me)
# Cleanup Python3's __pycache__ directories
find . -name __pycache__ -type d -exec rm -r {} +

.DEFAULT_GOAL := help
.PHONY: all load-gateware load flash gateware firmware third_party/*
1 change: 1 addition & 0 deletions firmware/fx2/Makefile
Expand Up @@ -129,6 +129,7 @@ check: check_int2jt
clean:
$(Q_RM)$(RM) *.iic *.asm *.lnk *.lst *.map *.mem *.rel *.rst *.sym \
*.lk progOffsets.h firmware.hex date.inc
cd $(FX2LIBDIR) && make clean

distclean: clean
$(RM) -r $(FX2LIBDIR)

0 comments on commit f13c17a

Please sign in to comment.