Skip to content

Commit 30f22d4

Browse files
committed
Add basic infrastrucure for building full tests
1 parent 621ae42 commit 30f22d4

File tree

7 files changed

+75
-1
lines changed

7 files changed

+75
-1
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ define BUILD_TEST
419419
MAKE_TARGET := $2
420420
COMMAND := $1
421421
MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_test.mk $$(MAKE_TARGET)
422-
MAKE_VARS := TEST=$$(TEST_NAME)
422+
MAKE_VARS := TEST=$$(TEST_NAME) FULL_TESTS=$$(FULL_TESTS)
423423
MAKE_MSG := $$(MSG_MAKE_TEST)
424424
$$(eval $$(call BUILD))
425425
ifneq ($$(MAKE_TARGET),clean)

build_full_test.mk

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright 2017 Fred Sundvik
2+
#
3+
# This program is free software: you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License as published by
5+
# the Free Software Foundation, either version 2 of the License, or
6+
# (at your option) any later version.
7+
#
8+
# This program is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
# GNU General Public License for more details.
12+
#
13+
# You should have received a copy of the GNU General Public License
14+
# along with this program. If not, see <http://www.gnu.org/licenses/>.

build_test.mk

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ VPATH += $(COMMON_VPATH)
4343

4444
include $(TMK_PATH)/common.mk
4545
include $(QUANTUM_PATH)/serial_link/tests/rules.mk
46+
ifneq ($(filter $(FULL_TESTS),$(TEST)),)
47+
include build_full_test.mk
48+
endif
4649

4750
$(TEST_OBJ)/$(TEST)_SRC := $($(TEST)_SRC)
4851
$(TEST_OBJ)/$(TEST)_INC := $($(TEST)_INC) $(VPATH) $(GTEST_INC)

testlist.mk

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
TEST_LIST = $(notdir $(patsubst %/rules.mk,%,$(wildcard $(ROOT_DIR)/tests/*/rules.mk)))
2+
FULL_TESTS := $(TEST_LIST)
3+
14
include $(ROOT_DIR)/quantum/serial_link/tests/testlist.mk
25

36
define VALIDATE_TEST_LIST
@@ -10,4 +13,5 @@ define VALIDATE_TEST_LIST
1013
endif
1114
endef
1215

16+
1317
$(eval $(call VALIDATE_TEST_LIST,$(firstword $(TEST_LIST)),$(wordlist 2,9999,$(TEST_LIST))))

tests/basic/config.h

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/* Copyright 2017 Fred Sundvik
2+
*
3+
* This program is free software: you can redistribute it and/or modify
4+
* it under the terms of the GNU General Public License as published by
5+
* the Free Software Foundation, either version 2 of the License, or
6+
* (at your option) any later version.
7+
*
8+
* This program is distributed in the hope that it will be useful,
9+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
* GNU General Public License for more details.
12+
*
13+
* You should have received a copy of the GNU General Public License
14+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15+
*/
16+
17+
#ifndef TESTS_BASIC_CONFIG_H_
18+
#define TESTS_BASIC_CONFIG_H_
19+
20+
21+
22+
#endif /* TESTS_BASIC_CONFIG_H_ */

tests/basic/rules.mk

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright 2017 Fred Sundvik
2+
#
3+
# This program is free software: you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License as published by
5+
# the Free Software Foundation, either version 2 of the License, or
6+
# (at your option) any later version.
7+
#
8+
# This program is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
# GNU General Public License for more details.
12+
#
13+
# You should have received a copy of the GNU General Public License
14+
# along with this program. If not, see <http://www.gnu.org/licenses/>.

tests/basic/test.c

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* Copyright 2017 Fred Sundvik
2+
*
3+
* This program is free software: you can redistribute it and/or modify
4+
* it under the terms of the GNU General Public License as published by
5+
* the Free Software Foundation, either version 2 of the License, or
6+
* (at your option) any later version.
7+
*
8+
* This program is distributed in the hope that it will be useful,
9+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
* GNU General Public License for more details.
12+
*
13+
* You should have received a copy of the GNU General Public License
14+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15+
*/
16+
17+

0 commit comments

Comments
 (0)