From 63788745dfbdc484c4533b4eb71bd5a0e31262be Mon Sep 17 00:00:00 2001 From: steelgeek091 <130330379+steelgeek091@users.noreply.github.com> Date: Fri, 21 Jul 2023 15:24:42 +0800 Subject: [PATCH] Add test_only attribute to integration test functions. (#525) Reset the version of the genesis file to match that of the main branch. --- .../rooch/src/commands/move_cli/commands/integration_test.rs | 4 +++- examples/counter/sources/counter.move | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/rooch/src/commands/move_cli/commands/integration_test.rs b/crates/rooch/src/commands/move_cli/commands/integration_test.rs index 966556108c..56900a23ab 100644 --- a/crates/rooch/src/commands/move_cli/commands/integration_test.rs +++ b/crates/rooch/src/commands/move_cli/commands/integration_test.rs @@ -10,7 +10,7 @@ use move_compiler::diagnostics::report_diagnostics; use move_compiler::shared::unique_map::UniqueMap; use move_compiler::shared::{NamedAddressMapIndex, NamedAddressMaps}; use move_compiler::{ - cfgir, expansion, hlir, naming, parser, typing, Compiler, FullyCompiledProgram, + cfgir, expansion, hlir, naming, parser, typing, Compiler, Flags, FullyCompiledProgram, }; use move_package::compilation::build_plan::BuildPlan; use move_package::source_package::layout::SourcePackageLayout; @@ -196,6 +196,8 @@ impl IntegrationTest { &mut std::io::stdout(), Some(6), |compiler: Compiler| { + let compiler = + compiler.set_flags(Flags::empty().set_keep_testing_functions(true)); let full_program = match construct_pre_compiled_lib_from_compiler(compiler)? { Ok(full_program) => full_program, Err((file, s)) => report_diagnostics(&file, s), diff --git a/examples/counter/sources/counter.move b/examples/counter/sources/counter.move index 0ed4b38f6d..465c41d0e0 100644 --- a/examples/counter/sources/counter.move +++ b/examples/counter/sources/counter.move @@ -6,6 +6,7 @@ module rooch_examples::counter { value:u64, } + #[test_only] public fun init_for_test(ctx: &mut StorageContext, account: &signer) { account_storage::global_move_to(ctx, account, Counter { value: 0 }); }