Don't try to call unittest clean if objfile dir is non-existant (e.g.
when objfile submodule wasn't cloned). Another solution would be to make
clean target dependant on objdir but that would mean downloading a lot
of unneeded data for users who don't run unit-tests.
Fixes: #872
Signed-off-by: Artem Savkov <asavkov@redhat.com>
This fixes the following error with an older version of git
(1.8.3.1):
make -C test/unit
make[1]: Entering directory `/root/kpatch/test/unit'
git submodule update --init --rebase
You need to run this command from the toplevel of the working tree.
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Add a simple unittest framework for create-diff-object implemented in
GNU Make.
It will automatically scan the kpatch-unit-objs/$(uname -m) directory
for specifically named files running one of 3 tests:
- creating diff object with expected success
- creating diff object with expected failure
- creating diff object and running a shell script on it with expected
success
Signed-off-by: Artem Savkov <asavkov@redhat.com>