mirror of
https://github.com/clearlinux/clr-boot-manager.git
synced 2026-08-25 15:36:09 +00:00
Add the skeleton MstTemplate test
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
This commit is contained in:
@@ -20,6 +20,7 @@ GRTAGS
|
||||
# test suite junk
|
||||
check_core
|
||||
check_files
|
||||
check_template
|
||||
check_updates
|
||||
|
||||
*.log
|
||||
|
||||
+20
-3
@@ -153,9 +153,10 @@ manpages_DATA = \
|
||||
distclean-local:
|
||||
rm -rf ${top_builddir}/tests/update_playground
|
||||
|
||||
TESTS = \
|
||||
check_core \
|
||||
check_files \
|
||||
TESTS = \
|
||||
check_core \
|
||||
check_files \
|
||||
check_template \
|
||||
check_updates
|
||||
|
||||
check_PROGRAMS = $(TESTS)
|
||||
@@ -194,6 +195,22 @@ check_files_LDADD = \
|
||||
$(BLKID_LIBS) \
|
||||
$(CHECK_LIBS)
|
||||
|
||||
check_template_SOURCES = \
|
||||
tests/check-template.c
|
||||
|
||||
check_template_CFLAGS = \
|
||||
$(CRYPTO_CFLAGS) \
|
||||
$(BLKID_CFLAGS) \
|
||||
$(CHECK_CFLAGS) \
|
||||
$(AM_CFLAGS)
|
||||
|
||||
check_template_LDADD = \
|
||||
libcbm.la \
|
||||
libnica.la \
|
||||
$(CRYPTO_LIBS) \
|
||||
$(BLKID_LIBS) \
|
||||
$(CHECK_LIBS)
|
||||
|
||||
check_updates_SOURCES = \
|
||||
tests/check-updates.c \
|
||||
tests/harness.h \
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* This file is part of clr-boot-manager.
|
||||
*
|
||||
* Copyright © 2016 Intel Corporation
|
||||
*
|
||||
* clr-boot-manager is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License as
|
||||
* published by the Free Software Foundation; either version 2.1
|
||||
* of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include <check.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
#include "template.h"
|
||||
|
||||
START_TEST(bootman_template_test_simple_new)
|
||||
{
|
||||
MstTemplateParser *parser = NULL;
|
||||
|
||||
parser = mst_template_parser_new();
|
||||
fail_if(!parser, "Failed to construct new MstTemplateParser");
|
||||
mst_template_parser_free(parser);
|
||||
}
|
||||
END_TEST
|
||||
|
||||
static Suite *core_suite(void)
|
||||
{
|
||||
Suite *s = NULL;
|
||||
TCase *tc = NULL;
|
||||
|
||||
s = suite_create("bootman_template");
|
||||
tc = tcase_create("bootman_template_simple");
|
||||
tcase_add_test(tc, bootman_template_test_simple_new);
|
||||
suite_add_tcase(s, tc);
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
Suite *s;
|
||||
SRunner *sr;
|
||||
int fail;
|
||||
|
||||
s = core_suite();
|
||||
sr = srunner_create(s);
|
||||
srunner_run_all(sr, CK_VERBOSE);
|
||||
fail = srunner_ntests_failed(sr);
|
||||
srunner_free(sr);
|
||||
|
||||
if (fail > 0) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Editor modelines - https://www.wireshark.org/tools/modelines.html
|
||||
*
|
||||
* Local variables:
|
||||
* c-basic-offset: 8
|
||||
* tab-width: 8
|
||||
* indent-tabs-mode: nil
|
||||
* End:
|
||||
*
|
||||
* vi: set shiftwidth=8 tabstop=8 expandtab:
|
||||
* :indentSize=8:tabSize=8:noTabs=true:
|
||||
*/
|
||||
Reference in New Issue
Block a user