build tests on make, but run on make check
This commit is contained in:
parent
350285caae
commit
c5431d4029
3 changed files with 31 additions and 26 deletions
|
@ -1,6 +1,9 @@
|
||||||
2010-01-12 BVK Chaitanya <bvk@dbook>
|
2010-01-12 BVK Chaitanya <bvk@dbook>
|
||||||
|
|
||||||
* include/grub/test.h: Removed EXPORT_* usage.
|
* conf/tests.rmk: Build tests on make.
|
||||||
|
* Makefile.in (check): Use new variables.
|
||||||
|
|
||||||
|
* include/grub/test.h: Remove EXPORT_* usage.
|
||||||
|
|
||||||
* tests/util/grub-shell-tester.in: Fix error message.
|
* tests/util/grub-shell-tester.in: Fix error message.
|
||||||
|
|
||||||
|
|
21
Makefile.in
21
Makefile.in
|
@ -460,15 +460,18 @@ distcheck: dist
|
||||||
@echo "$(distdir).tar.gz is ready for distribution" | \
|
@echo "$(distdir).tar.gz is ready for distribution" | \
|
||||||
sed 'h;s/./=/g;p;x;p;x'
|
sed 'h;s/./=/g;p;x;p;x'
|
||||||
|
|
||||||
TESTS = $(check_UTILITIES) $(check_SCRIPTS) $(check_MODULES)
|
check: all $(UNIT_TESTS) $(FUNCTIONAL_TESTS) $(SCRIPTED_TESTS)
|
||||||
$(TESTS): $(test_framework_SCRIPTS) $(test_framework_MODULES)
|
@list="$(UNIT_TESTS)"; \
|
||||||
|
|
||||||
check: all $(TESTS)
|
|
||||||
@list="$(check_UTILITIES)"; \
|
|
||||||
for file in $$list; do \
|
for file in $$list; do \
|
||||||
$(builddir)/$$file; \
|
$(builddir)/$$file; \
|
||||||
done
|
done
|
||||||
@list="$(check_SCRIPTS)"; \
|
@list="$(FUNCTIONAL_TESTS)"; \
|
||||||
|
for file in $$list; do \
|
||||||
|
mod=`basename $$file .mod`; \
|
||||||
|
echo "insmod functional_test; insmod $$mod; functional_test" \
|
||||||
|
| $(builddir)/grub-shell; \
|
||||||
|
done
|
||||||
|
@list="$(SCRIPTED_TESTS)"; \
|
||||||
for file in $$list; do \
|
for file in $$list; do \
|
||||||
echo "$$file:"; \
|
echo "$$file:"; \
|
||||||
if $(builddir)/$$file; then \
|
if $(builddir)/$$file; then \
|
||||||
|
@ -477,12 +480,6 @@ check: all $(TESTS)
|
||||||
echo "$$file: FAIL"; \
|
echo "$$file: FAIL"; \
|
||||||
fi; \
|
fi; \
|
||||||
done
|
done
|
||||||
@list="$(check_MODULES)"; \
|
|
||||||
for file in $$list; do \
|
|
||||||
mod=`basename $$file .mod`; \
|
|
||||||
echo "insmod functional_test; insmod $$mod; functional_test" \
|
|
||||||
| $(builddir)/grub-shell; \
|
|
||||||
done
|
|
||||||
|
|
||||||
.SUFFIX:
|
.SUFFIX:
|
||||||
.SUFFIX: .c .o .S .d
|
.SUFFIX: .c .o .S .d
|
||||||
|
|
|
@ -4,38 +4,43 @@
|
||||||
grub-shell: tests/util/grub-shell.in config.status
|
grub-shell: tests/util/grub-shell.in config.status
|
||||||
./config.status --file=$@:$<
|
./config.status --file=$@:$<
|
||||||
chmod +x $@
|
chmod +x $@
|
||||||
test_framework_SCRIPTS += grub-shell
|
bin_SCRIPTS += grub-shell
|
||||||
CLEANFILES += grub-shell
|
CLEANFILES += grub-shell
|
||||||
|
|
||||||
# For grub-shell-tester
|
# For grub-shell-tester
|
||||||
grub-shell-tester: tests/util/grub-shell-tester.in config.status
|
grub-shell-tester: tests/util/grub-shell-tester.in config.status
|
||||||
./config.status --file=$@:$<
|
./config.status --file=$@:$<
|
||||||
chmod +x $@
|
chmod +x $@
|
||||||
test_framework_SCRIPTS += grub-shell-tester
|
bin_SCRIPTS += grub-shell-tester
|
||||||
CLEANFILES += grub-shell-tester
|
CLEANFILES += grub-shell-tester
|
||||||
|
|
||||||
test_framework_MODULES += functional_test.mod
|
pkglib_MODULES += functional_test.mod
|
||||||
functional_test_mod_SOURCES = tests/lib/functional_test.c tests/lib/test.c
|
functional_test_mod_SOURCES = tests/lib/functional_test.c tests/lib/test.c
|
||||||
functional_test_mod_CFLAGS = $(COMMON_CFLAGS)
|
functional_test_mod_CFLAGS = $(COMMON_CFLAGS)
|
||||||
functional_test_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
functional_test_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
||||||
|
|
||||||
# Unit tests
|
# Rules for unit tests
|
||||||
|
bin_UTILITIES += example_unit_test
|
||||||
check_UTILITIES += example_unit_test
|
|
||||||
example_unit_test_SOURCES = tests/example_unit_test.c kern/list.c kern/misc.c tests/lib/test.c tests/lib/unit_test.c
|
example_unit_test_SOURCES = tests/example_unit_test.c kern/list.c kern/misc.c tests/lib/test.c tests/lib/unit_test.c
|
||||||
example_unit_test_CFLAGS = -Wno-format
|
example_unit_test_CFLAGS = -Wno-format
|
||||||
|
|
||||||
# Functional tests
|
# Rules for functional tests
|
||||||
|
pkglib_MODULES += example_functional_test.mod
|
||||||
check_MODULES += example_functional_test.mod
|
|
||||||
example_functional_test_mod_SOURCES = tests/example_functional_test.c
|
example_functional_test_mod_SOURCES = tests/example_functional_test.c
|
||||||
example_functional_test_mod_CFLAGS = -Wno-format $(COMMON_CFLAGS)
|
example_functional_test_mod_CFLAGS = -Wno-format $(COMMON_CFLAGS)
|
||||||
example_functional_test_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
example_functional_test_mod_LDFLAGS = $(COMMON_LDFLAGS)
|
||||||
|
|
||||||
# Scripted tests
|
# Rules for scripted tests
|
||||||
|
bin_SCRIPTS += example_scripted_test
|
||||||
check_SCRIPTS += example_scripted_test
|
|
||||||
example_scripted_test_SOURCES = tests/example_scripted_test.in
|
example_scripted_test_SOURCES = tests/example_scripted_test.in
|
||||||
|
|
||||||
check_SCRIPTS += example_grub_script_test
|
bin_SCRIPTS += example_grub_script_test
|
||||||
example_grub_script_test_SOURCES = tests/example_grub_script_test.in
|
example_grub_script_test_SOURCES = tests/example_grub_script_test.in
|
||||||
|
|
||||||
|
|
||||||
|
# List of tests to execute on "make check"
|
||||||
|
|
||||||
|
SCRIPTED_TESTS = example_scripted_test
|
||||||
|
SCRIPTED_TESTS += example_grub_script_test
|
||||||
|
UNIT_TESTS = example_unit_test
|
||||||
|
FUNCTIONAL_TESTS = example_functional_test.mod
|
||||||
|
|
Loading…
Reference in a new issue