Commit Graph

5 Commits

Author SHA1 Message Date
Josh Poimboeuf
20b7ab02c4 test/unit: Don't automatically rebase submodule
"make unit" automatically rebases the submodule, which causes a lot of
surprises.  Instead, just print a warning if it's out of date.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
2019-07-15 18:49:00 -05:00
Artem Savkov
b10e0b7d82 unittests: skip clean if objdir is not present
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>
2018-06-04 13:14:28 +02:00
Josh Poimboeuf
5736f18d83 test/unit: run submodule command from base git directory
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>
2018-05-30 10:54:24 -05:00
Artem Savkov
ffc4122efb Add kpatch-unit-objs submodule
Add a submodule containing object files for unittests.

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2018-04-26 18:49:29 +02:00
Artem Savkov
a05c644c7b Add create-diff-object unittest framework
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>
2018-04-13 18:09:37 +02:00