Skip to content

Commit 237df82

Browse files
authored
Add a placeholder example for generating tests app (project-chip#10193)
Add examples/placeholder with some default zap file that can be compiled with ./scripts/examples/gn_build_test_example.sh app1
1 parent dd4806b commit 237df82

File tree

9 files changed

+1425
-0
lines changed

9 files changed

+1425
-0
lines changed

examples/placeholder/linux/.gn

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright (c) 2021 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import("//build_overrides/build.gni")
16+
17+
# The location of the build configuration file.
18+
buildconfig = "${build_root}/config/BUILDCONFIG.gn"
19+
20+
# CHIP uses angle bracket includes.
21+
check_system_includes = true
22+
23+
default_args = {
24+
import("//args.gni")
25+
}

examples/placeholder/linux/BUILD.gn

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Copyright (c) 2021 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import("//build_overrides/build.gni")
16+
import("//build_overrides/chip.gni")
17+
18+
import("${chip_root}/src/app/chip_data_model.gni")
19+
20+
declare_args() {
21+
chip_tests_zap_config = "none"
22+
}
23+
24+
chip_data_model("configuration") {
25+
zap_file = "apps/${chip_tests_zap_config}/zap.config"
26+
27+
zap_pregenerated_dir = "${chip_root}/out/debug/placeholder/${chip_tests_zap_config}/zap-generated"
28+
is_server = true
29+
}
30+
31+
executable("chip-${chip_tests_zap_config}") {
32+
sources = [ "main.cpp" ]
33+
34+
deps = [
35+
":configuration",
36+
"${chip_root}/examples/platform/linux:app-main",
37+
"${chip_root}/src/lib",
38+
]
39+
40+
cflags = [ "-Wconversion" ]
41+
42+
output_dir = root_out_dir
43+
}
44+
45+
group("linux") {
46+
deps = [ ":chip-${chip_tests_zap_config}" ]
47+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
*
3+
* Copyright (c) 2020-2021 Project CHIP Authors
4+
* All rights reserved.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
/**
20+
* @file
21+
* Example project configuration file for CHIP.
22+
*
23+
* This is a place to put application or project-specific overrides
24+
* to the default configuration values for general CHIP features.
25+
*
26+
*/
27+
28+
#pragma once
29+
30+
// Use a default pairing code if one hasn't been provisioned in flash.
31+
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021
32+
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF02

0 commit comments

Comments
 (0)