Skip to content

Commit

Permalink
Add test_only attribute to integration test functions. (#525)
Browse files Browse the repository at this point in the history
Reset the version of the genesis file to match that of the main branch.
  • Loading branch information
steelgeek091 authored Jul 21, 2023
1 parent 8da0817 commit 6378874
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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),
Expand Down
1 change: 1 addition & 0 deletions examples/counter/sources/counter.move
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
Expand Down

0 comments on commit 6378874

Please sign in to comment.