Skip to content

Commit

Permalink
add aptos config for aptos-level tests
Browse files Browse the repository at this point in the history
  • Loading branch information
brmataptos committed Jul 23, 2023
1 parent 4ff7c4a commit 662c86a
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion aptos-move/framework/tests/move_unit_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Parts of the project are originally copyright © Meta Platforms, Inc.
// SPDX-License-Identifier: Apache-2.0

use aptos_framework::path_in_crate;
use aptos_framework::{extended_checks, path_in_crate};
use aptos_gas::{AbstractValueSizeGasParameters, NativeGasParameters, LATEST_GAS_FEATURE_VERSION};
use aptos_types::on_chain_config::{Features, TimedFeatures};
use aptos_vm::natives;
Expand All @@ -19,6 +19,7 @@ fn run_tests_for_pkg(path_to_pkg: impl Into<String>) {
move_package::BuildConfig {
test_mode: true,
install_dir: Some(tempdir().unwrap().path().to_path_buf()),
known_attributes: extended_checks::get_all_attribute_names_set().clone(),
..Default::default()
},
// TODO(Gas): double check if this is correct
Expand Down
1 change: 1 addition & 0 deletions aptos-move/move-examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ repository = { workspace = true }
rust-version = { workspace = true }

[dependencies]
aptos-framework = { workspace = true }
aptos-gas = { workspace = true }
aptos-types = { workspace = true }
aptos-vm ={ workspace = true, features = ["testing"] }
Expand Down
2 changes: 2 additions & 0 deletions aptos-move/move-examples/tests/move_prover_tests.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright © Aptos Foundation
// SPDX-License-Identifier: Apache-2.0

use aptos_framework::extended_checks;
use aptos_types::account_address::AccountAddress;
use move_cli::base::prove::run_move_prover;
use std::{collections::BTreeMap, path::PathBuf};
Expand All @@ -24,6 +25,7 @@ pub fn run_prover_for_pkg(
additional_named_addresses: named_addr,
test_mode: true,
install_dir: Some(tempdir().unwrap().path().to_path_buf()),
known_attributes: extended_checks::get_all_attribute_names_set().clone(),
..Default::default()
};
run_move_prover(
Expand Down
2 changes: 2 additions & 0 deletions aptos-move/move-examples/tests/move_unit_tests.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright © Aptos Foundation
// SPDX-License-Identifier: Apache-2.0

use aptos_framework::extended_checks;
use aptos_gas::{AbstractValueSizeGasParameters, NativeGasParameters, LATEST_GAS_FEATURE_VERSION};
use aptos_types::{
account_address::{create_resource_address, AccountAddress},
Expand Down Expand Up @@ -33,6 +34,7 @@ pub fn run_tests_for_pkg(
test_mode: true,
install_dir: Some(tempdir().unwrap().path().to_path_buf()),
additional_named_addresses: named_addr,
known_attributes: extended_checks::get_all_attribute_names_set().clone(),
..Default::default()
},
UnitTestingConfig::default_with_bound(Some(100_000)),
Expand Down
2 changes: 2 additions & 0 deletions crates/aptos/src/move_tool/coverage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

use crate::common::types::{CliCommand, CliError, CliResult, CliTypedResult, MovePackageDir};
use aptos_framework::extended_checks;
use async_trait::async_trait;
use clap::{Parser, Subcommand};
use move_compiler::compiled_unit::{CompiledUnit, NamedCompiledModule};
Expand Down Expand Up @@ -149,6 +150,7 @@ fn compile_coverage(
additional_named_addresses: move_options.named_addresses(),
test_mode: false,
install_dir: move_options.output_dir.clone(),
known_attributes: extended_checks::get_all_attribute_names_set().clone(),
..Default::default()
};
let path = move_options.get_package_path()?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::{
};

use aptos_api_test_context::current_function_name;
use aptos_framework::extended_checks;
use aptos_protos::extractor::v1::{
transaction::{TransactionType, TxnData},
transaction_payload::{Payload, Type as PayloadType},
Expand Down Expand Up @@ -245,6 +246,7 @@ async fn build_test_module(account: AccountAddress) -> Vec<u8> {
generate_docs: false,
install_dir: Some(package_dir.clone()),
additional_named_addresses: [("TestAccount".to_string(), account)].into(),
known_attributes: extended_checks::get_all_attribute_names_set().clone(),
..Default::default()
};
let package = build_config
Expand Down

0 comments on commit 662c86a

Please sign in to comment.