From 85f42b176dab012b6d2dfefa53e59b41ae19e5ec Mon Sep 17 00:00:00 2001 From: chen828 Date: Mon, 10 Jul 2023 06:06:59 +0000 Subject: [PATCH 01/12] update test.gni. Signed-off-by: chen828 --- test.gni | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/test.gni b/test.gni index 5ca121bd2b..5625f53d4b 100755 --- a/test.gni +++ b/test.gni @@ -819,4 +819,41 @@ template("ohos_rust_systemtest") { "--edition=${edition}", ] } + template("ohos_rust_fuzztest") { + _target_name = target_name + ohos_fuzztest("$_target_name") { + forward_variables_from(invoker, "*") + if (!defined(invoker.crate_name)) { + crate_name = _target_name + } + crate_type = "bin" + if (defined(invoker.crate_type)) { + assert(invoker.crate_type == crate_type, + "crate_type should be $crate_type or use default value.") + } + + if (!defined(rustflags)) { + rustflags = [] + } + rustflags += [ + "-C", + "instrument-coverage", + "--cfg=coverage_nightly", + "-Cllvm-args=-sanitizer-coverage-stack-depth", + "-Cdebug-assertions", + "-Cllvm-args=-sanitizer-coverage-inline-8bit-counters", + "-Cllvm-args=-sanitizer-coverage-pc-table", + "-Cllvm-args=-sanitizer-coverage-trace-compares", + "-Cpasses=sancov-module", + "-Clink-dead-code", + "-Cdebug-assertions", + "-C", + "codegen-units=1", + "-C", + "sanitizer=address", + "-Cllvm-args=-sanitizer-coverage-level=4", + "--cfg", + "feature=\"fuzzing\"", + ] + } } -- Gitee From df4dea45bf31eb623870fcb83b72066fe406882b Mon Sep 17 00:00:00 2001 From: chen828 Date: Mon, 10 Jul 2023 06:10:10 +0000 Subject: [PATCH 02/12] update templates/rust/rust_template.gni. Signed-off-by: chen828 --- templates/rust/rust_template.gni | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/templates/rust/rust_template.gni b/templates/rust/rust_template.gni index efe36e9e6e..c0c589c9f9 100644 --- a/templates/rust/rust_template.gni +++ b/templates/rust/rust_template.gni @@ -142,6 +142,28 @@ template("rust_target") { if (!defined(output_name) || output_name == "") { output_name = crate_name } + if (defined(coverage) && coverage == true) { + cflags_cc = ["-DRUSTC_BOOTSTRAP=1"] + rustflags += [ + "-C", + "instrument-coverage", + "--cfg=coverage_nightly", + "-Cllvm-args=-sanitizer-coverage-stack-depth", + "-Cdebug-assertions", + "-Cllvm-args=-sanitizer-coverage-inline-8bit-counters", + "-Cllvm-args=-sanitizer-coverage-pc-table", + "-Cllvm-args=-sanitizer-coverage-trace-compares", + "-Cpasses=sancov-module", + "-Clink-dead-code", + "-Cdebug-assertions", + "-Zprofile", + "-C", + "codegen-units=1", + "-Copt-level=0", + "-Coverflow-checks=off", + "-Zpanic_abort_tests", + ] + } } } -- Gitee From 4f5bda724efb54dc974bbcdb94a9f9ac7d85112a Mon Sep 17 00:00:00 2001 From: chen828 Date: Mon, 10 Jul 2023 19:26:06 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E5=A2=9E=E5=8A=A0rust=20fuzz=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E6=A8=A1=E6=9D=BF=E5=92=8C=E8=A6=86=E7=9B=96=E7=8E=87?= =?UTF-8?q?=E6=8F=92=E8=A3=85=E6=A8=A1=E6=9D=BF=EF=BC=8C=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9st=E3=80=81ut=E7=A4=BA=E4=BE=8B=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E5=A5=97=E5=90=8D=E7=A7=B0=E9=80=82=E9=85=8D=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E6=A1=86=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chen828 --- rust/tests/BUILD.gn | 8 ++++---- rust/tests/rust_test_st/BUILD.gn | 28 ++++++++++++++++++++++++++++ rust/tests/rust_test_st/src/lib.rs | 20 ++++++++++++++++++++ rust/tests/rust_test_st/test/test.rs | 19 +++++++++++++++++++ test.gni | 4 +++- 5 files changed, 74 insertions(+), 5 deletions(-) create mode 100644 rust/tests/rust_test_st/BUILD.gn create mode 100644 rust/tests/rust_test_st/src/lib.rs create mode 100644 rust/tests/rust_test_st/test/test.rs diff --git a/rust/tests/BUILD.gn b/rust/tests/BUILD.gn index 133e473279..d9dc365b0e 100644 --- a/rust/tests/BUILD.gn +++ b/rust/tests/BUILD.gn @@ -41,11 +41,11 @@ group("tests") { group("ohos_rust_xxxtest_tests") { testonly = true deps = [ - "test_rust_st:test_rust_st(${host_toolchain})", - "test_rust_ut:test_rust_ut(${host_toolchain})", + "rust_test_st:rust_test_st(${host_toolchain})", + "rust_test_ut:rust_test_ut(${host_toolchain})", "//build/rust/tests/test_proc_macro_crate/test_derive_macro:test_derive_macro(${host_toolchain})", - "//build/rust/tests/test_rust_st", - "//build/rust/tests/test_rust_ut", + "//build/rust/tests/rust_test_st", + "//build/rust/tests/rust_test_ut", ] } diff --git a/rust/tests/rust_test_st/BUILD.gn b/rust/tests/rust_test_st/BUILD.gn new file mode 100644 index 0000000000..1599853829 --- /dev/null +++ b/rust/tests/rust_test_st/BUILD.gn @@ -0,0 +1,28 @@ +# Copyright (c) 2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/ohos.gni") +import("//build/test.gni") + +ohos_rust_systemtest("rust_test_st") { + module_out_path = "rust_build_test/rust_test_st" + sources = [ "test/test.rs" ] + deps = [ ":test_rust_st_add" ] +} + +ohos_rust_shared_library("test_rust_st_add") { + sources = [ "src/lib.rs" ] + crate_name = "test_rust_st_add" + crate_type = "dylib" + coverage = true +} diff --git a/rust/tests/rust_test_st/src/lib.rs b/rust/tests/rust_test_st/src/lib.rs new file mode 100644 index 0000000000..109d97c9af --- /dev/null +++ b/rust/tests/rust_test_st/src/lib.rs @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +//! rust systemtest build + +/// pub add +pub fn add(a: i32, b: i32) -> i32 { + a + b +} diff --git a/rust/tests/rust_test_st/test/test.rs b/rust/tests/rust_test_st/test/test.rs new file mode 100644 index 0000000000..10c816cbe2 --- /dev/null +++ b/rust/tests/rust_test_st/test/test.rs @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#[test] +fn test_add() { + assert_eq!(test_rust_st_add::add(3, 2), 5); +} diff --git a/test.gni b/test.gni index 5625f53d4b..f31fbcec00 100755 --- a/test.gni +++ b/test.gni @@ -819,7 +819,8 @@ template("ohos_rust_systemtest") { "--edition=${edition}", ] } - template("ohos_rust_fuzztest") { +} +template("ohos_rust_fuzztest") { _target_name = target_name ohos_fuzztest("$_target_name") { forward_variables_from(invoker, "*") @@ -857,3 +858,4 @@ template("ohos_rust_systemtest") { ] } } + -- Gitee From 89b3ceca9d034a6c442aa63d1048adba56cea91a Mon Sep 17 00:00:00 2001 From: chen828 Date: Mon, 10 Jul 2023 20:04:22 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E5=A2=9E=E5=8A=A0rust=20fuzz=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E6=A8=A1=E6=9D=BF=E5=92=8C=E8=A6=86=E7=9B=96=E7=8E=87?= =?UTF-8?q?=E6=8F=92=E8=A3=85=E6=A8=A1=E6=9D=BF=EF=BC=8C=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9st=E3=80=81ut=E7=A4=BA=E4=BE=8B=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E5=A5=97=E5=90=8D=E7=A7=B0=E9=80=82=E9=85=8D=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E6=A1=86=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chen828 --- rust/tests/BUILD.gn | 2 +- .../{test_rust_ut => rust_test_ut}/BUILD.gn | 4 +-- .../src/main.rs | 0 rust/tests/test_rust_st/BUILD.gn | 27 ------------------- rust/tests/test_rust_st/src/lib.rs | 20 -------------- rust/tests/test_rust_st/test/test.rs | 19 ------------- 6 files changed, 3 insertions(+), 69 deletions(-) rename rust/tests/{test_rust_ut => rust_test_ut}/BUILD.gn (90%) rename rust/tests/{test_rust_ut => rust_test_ut}/src/main.rs (100%) delete mode 100644 rust/tests/test_rust_st/BUILD.gn delete mode 100644 rust/tests/test_rust_st/src/lib.rs delete mode 100644 rust/tests/test_rust_st/test/test.rs diff --git a/rust/tests/BUILD.gn b/rust/tests/BUILD.gn index d9dc365b0e..857cad2848 100644 --- a/rust/tests/BUILD.gn +++ b/rust/tests/BUILD.gn @@ -43,9 +43,9 @@ group("ohos_rust_xxxtest_tests") { deps = [ "rust_test_st:rust_test_st(${host_toolchain})", "rust_test_ut:rust_test_ut(${host_toolchain})", - "//build/rust/tests/test_proc_macro_crate/test_derive_macro:test_derive_macro(${host_toolchain})", "//build/rust/tests/rust_test_st", "//build/rust/tests/rust_test_ut", + "//build/rust/tests/test_proc_macro_crate/test_derive_macro:test_derive_macro(${host_toolchain})", ] } diff --git a/rust/tests/test_rust_ut/BUILD.gn b/rust/tests/rust_test_ut/BUILD.gn similarity index 90% rename from rust/tests/test_rust_ut/BUILD.gn rename to rust/tests/rust_test_ut/BUILD.gn index 69c5ceef5f..2e762ef77b 100644 --- a/rust/tests/test_rust_ut/BUILD.gn +++ b/rust/tests/rust_test_ut/BUILD.gn @@ -14,8 +14,8 @@ import("//build/ohos.gni") import("//build/test.gni") -ohos_rust_unittest("test_rust_ut") { - module_out_path = "rust_build_test/test_rust_ut" +ohos_rust_unittest("rust_test_ut") { + module_out_path = "rust_build_test/rust_test_ut" sources = [ "src/main.rs" ] deps = [ ":test_rust_ut_add" ] } diff --git a/rust/tests/test_rust_ut/src/main.rs b/rust/tests/rust_test_ut/src/main.rs similarity index 100% rename from rust/tests/test_rust_ut/src/main.rs rename to rust/tests/rust_test_ut/src/main.rs diff --git a/rust/tests/test_rust_st/BUILD.gn b/rust/tests/test_rust_st/BUILD.gn deleted file mode 100644 index 84c0c1b6ab..0000000000 --- a/rust/tests/test_rust_st/BUILD.gn +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build/ohos.gni") -import("//build/test.gni") - -ohos_rust_systemtest("test_rust_st") { - module_out_path = "rust_build_test/test_rust_st" - sources = [ "test/test.rs" ] - deps = [ ":test_rust_st_add" ] -} - -ohos_rust_shared_library("test_rust_st_add") { - sources = [ "src/lib.rs" ] - crate_name = "test_rust_st_add" - crate_type = "dylib" -} diff --git a/rust/tests/test_rust_st/src/lib.rs b/rust/tests/test_rust_st/src/lib.rs deleted file mode 100644 index 109d97c9af..0000000000 --- a/rust/tests/test_rust_st/src/lib.rs +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -//! rust systemtest build - -/// pub add -pub fn add(a: i32, b: i32) -> i32 { - a + b -} diff --git a/rust/tests/test_rust_st/test/test.rs b/rust/tests/test_rust_st/test/test.rs deleted file mode 100644 index 10c816cbe2..0000000000 --- a/rust/tests/test_rust_st/test/test.rs +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#[test] -fn test_add() { - assert_eq!(test_rust_st_add::add(3, 2), 5); -} -- Gitee From f48bace0e746f42fdb5f40c8f1585b81c709a60a Mon Sep 17 00:00:00 2001 From: chen828 Date: Mon, 10 Jul 2023 20:26:04 +0800 Subject: [PATCH 05/12] gn format Signed-off-by: chen828 --- templates/rust/rust_template.gni | 6 +++--- test.gni | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/templates/rust/rust_template.gni b/templates/rust/rust_template.gni index c0c589c9f9..4185ce1723 100644 --- a/templates/rust/rust_template.gni +++ b/templates/rust/rust_template.gni @@ -143,8 +143,8 @@ template("rust_target") { output_name = crate_name } if (defined(coverage) && coverage == true) { - cflags_cc = ["-DRUSTC_BOOTSTRAP=1"] - rustflags += [ + cflags_cc = [ "-DRUSTC_BOOTSTRAP=1" ] + rustflags += [ "-C", "instrument-coverage", "--cfg=coverage_nightly", @@ -162,7 +162,7 @@ template("rust_target") { "-Copt-level=0", "-Coverflow-checks=off", "-Zpanic_abort_tests", - ] + ] } } } diff --git a/test.gni b/test.gni index f31fbcec00..e73b515fab 100755 --- a/test.gni +++ b/test.gni @@ -851,11 +851,10 @@ template("ohos_rust_fuzztest") { "-C", "codegen-units=1", "-C", - "sanitizer=address", + "sanitizer=address", "-Cllvm-args=-sanitizer-coverage-level=4", "--cfg", "feature=\"fuzzing\"", ] } } - -- Gitee From 3f7d08065b3e5f3590a3449597179b7d23cf8a04 Mon Sep 17 00:00:00 2001 From: chen828 Date: Tue, 25 Jul 2023 18:13:35 +0800 Subject: [PATCH 06/12] remove flag Signed-off-by: chen828 --- templates/rust/rust_template.gni | 2 -- 1 file changed, 2 deletions(-) diff --git a/templates/rust/rust_template.gni b/templates/rust/rust_template.gni index 4185ce1723..a6b914272c 100644 --- a/templates/rust/rust_template.gni +++ b/templates/rust/rust_template.gni @@ -159,8 +159,6 @@ template("rust_target") { "-Zprofile", "-C", "codegen-units=1", - "-Copt-level=0", - "-Coverflow-checks=off", "-Zpanic_abort_tests", ] } -- Gitee From f72f40764c5b30ee96a8e8f2d6c994d992ed902a Mon Sep 17 00:00:00 2001 From: chen828 Date: Tue, 10 Oct 2023 14:27:41 +0800 Subject: [PATCH 07/12] update templates Signed-off-by: chen828 --- templates/rust/rust_template.gni | 2 +- test.gni | 53 ++++++++++++++++++++++---------- 2 files changed, 37 insertions(+), 18 deletions(-) mode change 100644 => 100755 templates/rust/rust_template.gni diff --git a/templates/rust/rust_template.gni b/templates/rust/rust_template.gni old mode 100644 new mode 100755 index a6b914272c..ba5b59f535 --- a/templates/rust/rust_template.gni +++ b/templates/rust/rust_template.gni @@ -142,7 +142,7 @@ template("rust_target") { if (!defined(output_name) || output_name == "") { output_name = crate_name } - if (defined(coverage) && coverage == true) { + if (use_clang_coverage == true) { cflags_cc = [ "-DRUSTC_BOOTSTRAP=1" ] rustflags += [ "-C", diff --git a/test.gni b/test.gni index e73b515fab..f9dacfedd9 100755 --- a/test.gni +++ b/test.gni @@ -832,29 +832,48 @@ template("ohos_rust_fuzztest") { assert(invoker.crate_type == crate_type, "crate_type should be $crate_type or use default value.") } - if (!defined(rustflags)) { rustflags = [] } + if (!defined(cflags)) { + cflags = [] + } + cflags += ["-DRUSTC_BOOTSTRAP=1"] rustflags += [ - "-C", - "instrument-coverage", - "--cfg=coverage_nightly", - "-Cllvm-args=-sanitizer-coverage-stack-depth", - "-Cdebug-assertions", - "-Cllvm-args=-sanitizer-coverage-inline-8bit-counters", - "-Cllvm-args=-sanitizer-coverage-pc-table", - "-Cllvm-args=-sanitizer-coverage-trace-compares", - "-Cpasses=sancov-module", - "-Clink-dead-code", - "-Cdebug-assertions", - "-C", - "codegen-units=1", - "-C", - "sanitizer=address", - "-Cllvm-args=-sanitizer-coverage-level=4", "--cfg", "feature=\"fuzzing\"", ] + if (use_clang_coverage == true) { + rustflags += [ + "-C", + "instrument-coverage", + "--cfg=coverage_nightly", + "-Cllvm-args=-sanitizer-coverage-stack-depth", + "-Cdebug-assertions", + "-Cllvm-args=-sanitizer-coverage-inline-8bit-counters", + "-Cllvm-args=-sanitizer-coverage-pc-table", + "-Cllvm-args=-sanitizer-coverage-trace-compares", + "-Cllvm-args=-sanitizer-coverage-level=4", + "-Cpasses=sancov-module", + "-Clink-dead-code", + "-Cdebug-assertions", + "-C", + "codegen-units=1", + "-Zpanic_abort_tests", + ] + } + if (is_asan) { + rustflags += [ + "-C", + "sanitizer=address", + ] + } + if (use_libfuzzer) { + if (!defined(invoker.deps)) { + deps = [] + } else { + deps += ["//third_party/rust/crates/libfuzzer:lib"] + } + } } } -- Gitee From 3e5efe8844fe1ed2e164cf7042c39a07407221b5 Mon Sep 17 00:00:00 2001 From: chen828 Date: Tue, 24 Oct 2023 15:23:27 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chen828 --- rust/tests/rust_test_st/BUILD.gn | 6 +++++- templates/rust/rust_template.gni | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) mode change 100644 => 100755 rust/tests/rust_test_st/BUILD.gn diff --git a/rust/tests/rust_test_st/BUILD.gn b/rust/tests/rust_test_st/BUILD.gn old mode 100644 new mode 100755 index 1599853829..577980117a --- a/rust/tests/rust_test_st/BUILD.gn +++ b/rust/tests/rust_test_st/BUILD.gn @@ -24,5 +24,9 @@ ohos_rust_shared_library("test_rust_st_add") { sources = [ "src/lib.rs" ] crate_name = "test_rust_st_add" crate_type = "dylib" - coverage = true } + +ohos_rust_fuzztest("rust_test_add_fuzz") { + source = ["fuzz/fuzz_target_1.rs"] + crate_name = "test_rust_add_fuzz" +} \ No newline at end of file diff --git a/templates/rust/rust_template.gni b/templates/rust/rust_template.gni index ba5b59f535..da0eed3c1f 100755 --- a/templates/rust/rust_template.gni +++ b/templates/rust/rust_template.gni @@ -142,8 +142,11 @@ template("rust_target") { if (!defined(output_name) || output_name == "") { output_name = crate_name } + if (!defined(cflags_cc)) { + cflags_cc = [] + } if (use_clang_coverage == true) { - cflags_cc = [ "-DRUSTC_BOOTSTRAP=1" ] + cflags_cc += [ "-DRUSTC_BOOTSTRAP=1" ] rustflags += [ "-C", "instrument-coverage", -- Gitee From 2603099310fb3df8d762f8afb0079738a7a0f6a9 Mon Sep 17 00:00:00 2001 From: chen828 Date: Tue, 24 Oct 2023 16:22:46 +0800 Subject: [PATCH 09/12] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chen828 --- rust/tests/rust_test_st/BUILD.gn | 5 ----- 1 file changed, 5 deletions(-) diff --git a/rust/tests/rust_test_st/BUILD.gn b/rust/tests/rust_test_st/BUILD.gn index 577980117a..93915738cf 100755 --- a/rust/tests/rust_test_st/BUILD.gn +++ b/rust/tests/rust_test_st/BUILD.gn @@ -25,8 +25,3 @@ ohos_rust_shared_library("test_rust_st_add") { crate_name = "test_rust_st_add" crate_type = "dylib" } - -ohos_rust_fuzztest("rust_test_add_fuzz") { - source = ["fuzz/fuzz_target_1.rs"] - crate_name = "test_rust_add_fuzz" -} \ No newline at end of file -- Gitee From 101519f1511dce9d493acc6120b6171c96f80396 Mon Sep 17 00:00:00 2001 From: chen828 Date: Tue, 24 Oct 2023 17:50:59 +0800 Subject: [PATCH 10/12] gn format Signed-off-by: chen828 --- templates/rust/rust_template.gni | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/rust/rust_template.gni b/templates/rust/rust_template.gni index da0eed3c1f..2a58d21bfb 100755 --- a/templates/rust/rust_template.gni +++ b/templates/rust/rust_template.gni @@ -143,8 +143,8 @@ template("rust_target") { output_name = crate_name } if (!defined(cflags_cc)) { - cflags_cc = [] - } + cflags_cc = [] + } if (use_clang_coverage == true) { cflags_cc += [ "-DRUSTC_BOOTSTRAP=1" ] rustflags += [ -- Gitee From d213fb3cbe88925aedc2ffeb415626d1155581bd Mon Sep 17 00:00:00 2001 From: chen828 Date: Tue, 24 Oct 2023 20:37:21 +0800 Subject: [PATCH 11/12] gn format Signed-off-by: chen828 --- test.gni | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test.gni b/test.gni index f9dacfedd9..01a983642b 100755 --- a/test.gni +++ b/test.gni @@ -838,7 +838,7 @@ template("ohos_rust_fuzztest") { if (!defined(cflags)) { cflags = [] } - cflags += ["-DRUSTC_BOOTSTRAP=1"] + cflags += [ "-DRUSTC_BOOTSTRAP=1" ] rustflags += [ "--cfg", "feature=\"fuzzing\"", @@ -872,7 +872,7 @@ template("ohos_rust_fuzztest") { if (!defined(invoker.deps)) { deps = [] } else { - deps += ["//third_party/rust/crates/libfuzzer:lib"] + deps += [ "//third_party/rust/crates/libfuzzer:lib" ] } } } -- Gitee From 88119fb7e5e4729f68c0a2970447b5fdb45ddc37 Mon Sep 17 00:00:00 2001 From: chen828 Date: Sat, 28 Oct 2023 11:05:09 +0800 Subject: [PATCH 12/12] gn format Signed-off-by: chen828 --- test.gni | 1 + 1 file changed, 1 insertion(+) diff --git a/test.gni b/test.gni index 01a983642b..32ef5867a3 100755 --- a/test.gni +++ b/test.gni @@ -820,6 +820,7 @@ template("ohos_rust_systemtest") { ] } } + template("ohos_rust_fuzztest") { _target_name = target_name ohos_fuzztest("$_target_name") { -- Gitee