Instead of having this be a local test, have a format target for the
Makefile and use a github action for clang-format to avoid differences
between developer systems clang-format and runner clang-format
versions.
Signed-off-by: William Douglas <william.douglas@intel.com>
clang-format changing output between versions is painful so might need
to be reconsidered at some point.
Signed-off-by: William Douglas <william.douglas@intel.com>
Create another github job to check if the API has been changed in this
PR, so it will be easier to notice that a broken test is just an API
broken test
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Porting code to better way on interacting with system commands using the
run_command function. As run_command don't support multi-thread for
performance reasons, we are now using a file instead of a pipe. As tar|tar
is now a fallback, this won't have any performance impacts on any case
where with no problems and errors.
Fixes#640 and #671
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
We have added more dependencies in verifytime, but this was harder to
keep as it looks like, so making it completely independent from swupd
libs.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
On several points on swupd we need to free a pointer and then set it to
NULL. This is made in some areas using the free_and_clear_pointer(). But
most places free_and_clear_pointer() is used, this is not really necessary.
On the other hand it's hard to make sure that we are really setting to NULL
every pointer that we need, so we're adding a more conservative approach on
setting every pointer to NULL after free using a wrapper.
The greatest advantage of this wrapper over free_and_clear_pointer() is that
it's not type dependent and we don't need to call it with a pointer of a pointer,
so calls look more to calls to a standard free.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
We are aiming to provide a stable --quiet output, so forcing "make
compliant" to fail if there are changes in the test/functional/api
tests, which cover these scenarios will prevent us from unadvertedly
changing those tests.
Closes#1501
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
There are some functions we decided to avoid using, so add a test to make
sure we won't add them by accident.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Now make check is only running unit tests and a new target,
functional-check is used for bat tests. The major win on that
was that now we can use find to look for all bat tests in the
functional library and we don't need to keep the BATS list
updated.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>