Skip to content

Commit

Permalink
Add basic infrastrucure for building full tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fredizzimo committed Jun 18, 2017
1 parent 621ae42 commit 30f22d4
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ define BUILD_TEST
MAKE_TARGET := $2
COMMAND := $1
MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_test.mk $$(MAKE_TARGET)
MAKE_VARS := TEST=$$(TEST_NAME)
MAKE_VARS := TEST=$$(TEST_NAME) FULL_TESTS=$$(FULL_TESTS)
MAKE_MSG := $$(MSG_MAKE_TEST)
$$(eval $$(call BUILD))
ifneq ($$(MAKE_TARGET),clean)
Expand Down
14 changes: 14 additions & 0 deletions build_full_test.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2017 Fred Sundvik
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http:https://www.gnu.org/licenses/>.
3 changes: 3 additions & 0 deletions build_test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ VPATH += $(COMMON_VPATH)

include $(TMK_PATH)/common.mk
include $(QUANTUM_PATH)/serial_link/tests/rules.mk
ifneq ($(filter $(FULL_TESTS),$(TEST)),)
include build_full_test.mk
endif

$(TEST_OBJ)/$(TEST)_SRC := $($(TEST)_SRC)
$(TEST_OBJ)/$(TEST)_INC := $($(TEST)_INC) $(VPATH) $(GTEST_INC)
Expand Down
4 changes: 4 additions & 0 deletions testlist.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
TEST_LIST = $(notdir $(patsubst %/rules.mk,%,$(wildcard $(ROOT_DIR)/tests/*/rules.mk)))
FULL_TESTS := $(TEST_LIST)

include $(ROOT_DIR)/quantum/serial_link/tests/testlist.mk

define VALIDATE_TEST_LIST
Expand All @@ -10,4 +13,5 @@ define VALIDATE_TEST_LIST
endif
endef


$(eval $(call VALIDATE_TEST_LIST,$(firstword $(TEST_LIST)),$(wordlist 2,9999,$(TEST_LIST))))
22 changes: 22 additions & 0 deletions tests/basic/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* Copyright 2017 Fred Sundvik
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http:https://www.gnu.org/licenses/>.
*/

#ifndef TESTS_BASIC_CONFIG_H_
#define TESTS_BASIC_CONFIG_H_



#endif /* TESTS_BASIC_CONFIG_H_ */
14 changes: 14 additions & 0 deletions tests/basic/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2017 Fred Sundvik
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http:https://www.gnu.org/licenses/>.
17 changes: 17 additions & 0 deletions tests/basic/test.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* Copyright 2017 Fred Sundvik
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http:https://www.gnu.org/licenses/>.
*/


0 comments on commit 30f22d4

Please sign in to comment.