Skip to content

Commit 204326c

Browse files
zhangchao53xiaoxiang781216
authored andcommitted
porting fake function framework
1 parent f841ca1 commit 204326c

File tree

5 files changed

+124
-0
lines changed

5 files changed

+124
-0
lines changed

testing/fff/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/fff
2+
/*.zip

testing/fff/CMakeLists.txt

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# ##############################################################################
2+
# apps/testing/fff/CMakeLists.txt
3+
#
4+
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
5+
# license agreements. See the NOTICE file distributed with this work for
6+
# additional information regarding copyright ownership. The ASF licenses this
7+
# file to you under the Apache License, Version 2.0 (the "License"); you may not
8+
# use this file except in compliance with the License. You may obtain a copy of
9+
# the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16+
# License for the specific language governing permissions and limitations under
17+
# the License.
18+
#
19+
# ##############################################################################
20+
21+
if(CONFIG_TESTING_FFF)
22+
23+
set(FFF_UNPACK ${CMAKE_CURRENT_LIST_DIR}/fff)
24+
set(FFF_URL https://github.com/meekrosoft/fff/archive/refs/heads/master.zip)
25+
26+
if(NOT EXISTS ${FFF_UNPACK})
27+
28+
FetchContent_Declare(
29+
fff_fetch
30+
URL ${FFF_URL} SOURCE_DIR ${FFF_UNPACK} BINARY_DIR
31+
${CMAKE_BINARY_DIR}/apps/testing/fff/fff
32+
DOWNLOAD_NO_PROGRESS true
33+
TIMEOUT 30)
34+
35+
FetchContent_GetProperties(fff_fetch)
36+
if(NOT fff_fetch_POPULATED)
37+
FetchContent_Populate(fff_fetch)
38+
endif()
39+
40+
endif()
41+
42+
set(INCDIR ${FFF_UNPACK})
43+
44+
set_property(
45+
TARGET nuttx
46+
APPEND
47+
PROPERTY NUTTX_INCLUDE_DIRECTORIES ${INCDIR})
48+
49+
endif()

testing/fff/Kconfig

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#
2+
# For a description of the syntax of this configuration file,
3+
# see the file kconfig-language.txt in the NuttX tools repository.
4+
#
5+
6+
config TESTING_FFF
7+
tristate "Enable FakeFunctionFramework"
8+
default n
9+
---help---
10+
Enable FakeFunctionFramework

testing/fff/Make.defs

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
############################################################################
2+
# apps/testing/fff/Make.defs
3+
#
4+
# Licensed to the Apache Software Foundation (ASF) under one or more
5+
# contributor license agreements. See the NOTICE file distributed with
6+
# this work for additional information regarding copyright ownership. The
7+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance with the
9+
# License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16+
# License for the specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
############################################################################
20+
21+
ifneq ($(CONFIG_TESTING_FFF),)
22+
CONFIGURED_APPS += $(APPDIR)/testing/fff
23+
CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/testing/fff/fff
24+
CXXFLAGS += ${INCDIR_PREFIX}$(APPDIR)/testing/fff/fff
25+
endif

testing/fff/Makefile

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
############################################################################
2+
# apps/testing/fff/Makefile
3+
#
4+
# Licensed to the Apache Software Foundation (ASF) under one or more
5+
# contributor license agreements. See the NOTICE file distributed with
6+
# this work for additional information regarding copyright ownership. The
7+
# ASF licenses this file to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance with the
9+
# License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16+
# License for the specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
############################################################################
20+
21+
include $(APPDIR)/Make.defs
22+
23+
# Download and unpack tarball if no git repo found
24+
ifeq ($(wildcard fff/.git),)
25+
fff.zip:
26+
$(Q) curl -L https://github.com/meekrosoft/fff/archive/refs/heads/master.zip -o fff.zip
27+
$(Q) unzip -o fff.zip
28+
$(Q) mv fff-master fff
29+
30+
context:: fff.zip
31+
32+
distclean::
33+
$(call DELDIR, fff)
34+
$(call DELFILE, fff.zip)
35+
36+
endif
37+
38+
include $(APPDIR)/Application.mk

0 commit comments

Comments
 (0)