add some more checks and namespaces for benchmarks, docs

This commit is contained in:
gluax 2022-06-09 12:23:57 -07:00
parent 267ab16810
commit 4607f2955a
35 changed files with 174 additions and 129 deletions

1
Cargo.lock generated
View File

@ -1312,7 +1312,6 @@ dependencies = [
name = "leo-parser"
version = "1.5.3"
dependencies = [
"criterion",
"indexmap",
"lazy_static",
"leo-ast",

View File

@ -10,7 +10,7 @@ keywords = [
"cryptography",
"leo",
"programming-language",
"zero-knowledge"
"zero-knowledge",
]
categories = ["cryptography::cryptocurrencies", "web-programming"]
include = ["Cargo.toml", "src", "README.md", "LICENSE.md"]

View File

@ -240,5 +240,5 @@ impl Runner for TestRunner {
#[test]
pub fn compiler_tests() {
leo_test_framework::TestCases::run_tests(&TestRunner, "compiler");
leo_test_framework::run_tests(&TestRunner, "compiler");
}

View File

@ -18,11 +18,6 @@ license = "GPL-3.0"
edition = "2021"
rust-version = "1.56"
[[bench]]
name = "leo_ast"
path = "benches/leo_ast.rs"
harness = false
[dependencies.leo-ast]
path = "../ast"
version = "1.5.3"
@ -59,9 +54,6 @@ version = "0.1"
path = "../../tests/test-framework"
version = "1.4.0"
[dev-dependencies.criterion]
version = "0.3"
[dev-dependencies.serde_json]
version = "1.0"
features = [ "preserve_order" ]

View File

@ -1,96 +0,0 @@
// Copyright (C) 2019-2022 Aleo Systems Inc.
// This file is part of the Leo library.
// The Leo library is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// The Leo library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
use leo_ast::Ast;
use leo_errors::emitter::Handler;
use leo_span::{source_map::FileName, symbol::create_session_if_not_set_then};
use criterion::{criterion_group, criterion_main, Criterion};
use std::time::Duration;
fn parse_ast(path: &str, input: &str) -> Ast {
create_session_if_not_set_then(|s| {
let sf = s.source_map.new_source(input, FileName::Custom(path.into()));
leo_parser::parse_ast(&Handler::default(), &sf.src, sf.start_pos).expect("failed to parse benchmark")
})
}
macro_rules! bench {
($func_name:ident, $file_name:expr) => {
fn $func_name(c: &mut Criterion) {
let ast = parse_ast(
concat!("./", $file_name, ".leo"),
include_str!(concat!("./", $file_name, ".leo"),),
);
// TODO(Centril): This benchmark seems like it actually does nothing
// but take a reference to `&ast`, which should be optimized out?
c.bench_function(concat!("Ast::", $file_name), |b| b.iter(|| &ast));
}
};
}
bench!(bench_big_if_else, "big_if_else");
// TODO have to figure out why this causes `thread 'main' has overflowed it's stack'
// bench!(bench_big_ternary, "big_ternary");
bench!(bench_big_circuit, "big_circuit");
bench!(bench_long_expr, "long_expr");
bench!(bench_long_array, "long_array");
bench!(bench_many_foos, "many_foos");
bench!(bench_many_assigns, "many_assigns");
bench!(bench_small_1, "small_1");
bench!(bench_small_2, "small_2");
bench!(bench_small_3, "small_3");
bench!(bench_small_4, "small_4");
bench!(bench_small_5, "small_5");
bench!(bench_medium_1, "medium_1");
bench!(bench_medium_2, "medium_2");
bench!(bench_medium_3, "medium_3");
bench!(bench_medium_4, "medium_4");
bench!(bench_medium_5, "medium_5");
bench!(bench_large_1, "large_1");
bench!(bench_large_2, "large_2");
bench!(bench_large_3, "large_3");
bench!(bench_large_4, "large_4");
bench!(bench_large_5, "large_5");
bench!(bench_massive, "massive");
criterion_group!(
name = benches;
config = Criterion::default().sample_size(200).measurement_time(Duration::from_secs(10)).nresamples(200_000);
targets = bench_big_circuit,
bench_long_expr,
bench_big_if_else,
bench_long_array,
bench_many_assigns,
bench_many_foos,
bench_small_1,
bench_small_2,
bench_small_3,
bench_small_4,
bench_small_5,
bench_medium_1,
bench_medium_2,
bench_medium_3,
bench_medium_4,
bench_medium_5,
bench_large_1,
bench_large_2,
bench_large_3,
bench_large_4,
bench_large_5,
bench_massive
);
criterion_main!(benches);

View File

@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 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1;
return a + b + c + d + e;
}

View File

@ -236,5 +236,5 @@ impl Runner for TestRunner {
#[test]
pub fn parser_tests() {
leo_test_framework::TestCases::run_tests(&TestRunner, "parser");
leo_test_framework::run_tests(&TestRunner, "parser");
}

View File

@ -1,3 +1,8 @@
/*
namespace: Bench
expectation: Pass
*/
function hAgrPJzARlhWKDGNpe () -> i128 {
const NtoD9dCOP8: bool = false;
if 60367u16 < 59376u16 && 291621465261548374864687596926221274642u128 <= 158647603833518715931164380862541000072u128 - 92087114510286551502623665863269979099u128 - 6505284705764791705801152244952567434u128 + 141283471013642106073249086828215491558u128 / 178739495978647499334333189200118397544u128 * 0u128 / 69358574294733597814948265413698301968u128 || 32532971286371518024146524900992744351u128 / 73930302096579937058701857000560614114u128 * 0u128 + 219449183973603283961254860147322285177u128 > 72259425234692696526333349807208361947u128 || 94519913150306783765596349821018468848i128 == -145523637561949662187440225436346186585i128 {

View File

@ -1,3 +1,8 @@
/*
namespace: Bench
expectation: Skip
*/
function main() {
const foo = Foo { x0: 0, x1: 1, x2: 2, x3: 3, x4: 4, x5: 5, x6: 6, x7: 7, x8: 8, x9: 9, x10: 10, x11: 11, x12: 12, x13: 13, x14: 14, x15: 15, x16: 16, x17: 17, x18: 18, x19: 19, x20: 20, x21: 21, x22: 22, x23: 23, x24: 24, x25: 25, x26: 26, x27: 27, x28: 28, x29: 29, x30: 30, x31: 31, x32: 32, x33: 33, x34: 34, x35: 35, x36: 36, x37: 37, x38: 38, x39: 39, x40: 40, x41: 41, x42: 42, x43: 43, x44: 44, x45: 45, x46: 46, x47: 47, x48: 48, x49: 49, x50: 50, x51: 51, x52: 52, x53: 53, x54: 54, x55: 55, x56: 56, x57: 57, x58: 58, x59: 59, x60: 60, x61: 61, x62: 62, x63: 63, x64: 64, x65: 65, x66: 66, x67: 67, x68: 68, x69: 69, x70: 70, x71: 71, x72: 72, x73: 73, x74: 74, x75: 75, x76: 76, x77: 77, x78: 78, x79: 79, x80: 80, x81: 81, x82: 82, x83: 83, x84: 84, x85: 85, x86: 86, x87: 87, x88: 88, x89: 89, x90: 90, x91: 91, x92: 92, x93: 93, x94: 94, x95: 95, x96: 96, x97: 97, x98: 98, x99: 99, x100: 100, x101: 101, x102: 102, x103: 103, x104: 104, x105: 105, x106: 106, x107: 107, x108: 108, x109: 109, x110: 110, x111: 111, x112: 112, x113: 113, x114: 114, x115: 115, x116: 116, x117: 117, x118: 118, x119: 119, x120: 120, x121: 121, x122: 122, x123: 123, x124: 124, x125: 125, x126: 126, x127: 127, x128: 128, x129: 129, x130: 130, x131: 131, x132: 132, x133: 133, x134: 134, x135: 135, x136: 136, x137: 137, x138: 138, x139: 139, x140: 140, x141: 141, x142: 142, x143: 143, x144: 144, x145: 145, x146: 146, x147: 147, x148: 148, x149: 149, x150: 150, x151: 151, x152: 152, x153: 153, x154: 154, x155: 155, x156: 156, x157: 157, x158: 158, x159: 159, x160: 160, x161: 161, x162: 162, x163: 163, x164: 164, x165: 165, x166: 166, x167: 167, x168: 168, x169: 169, x170: 170, x171: 171, x172: 172, x173: 173, x174: 174, x175: 175, x176: 176, x177: 177, x178: 178, x179: 179, x180: 180, x181: 181, x182: 182, x183: 183, x184: 184, x185: 185, x186: 186, x187: 187, x188: 188, x189: 189, x190: 190, x191: 191, x192: 192, x193: 193, x194: 194, x195: 195, x196: 196, x197: 197, x198: 198, x199: 199, x200: 200, x201: 201, x202: 202, x203: 203, x204: 204, x205: 205, x206: 206, x207: 207, x208: 208, x209: 209, x210: 210, x211: 211, x212: 212, x213: 213, x214: 214, x215: 215, x216: 216, x217: 217, x218: 218, x219: 219, x220: 220, x221: 221, x222: 222, x223: 223, x224: 224, x225: 225, x226: 226, x227: 227, x228: 228, x229: 229, x230: 230, x231: 231, x232: 232, x233: 233, x234: 234, x235: 235, x236: 236, x237: 237, x238: 238, x239: 239, x240: 240, x241: 241, x242: 242, x243: 243, x244: 244, x245: 245, x246: 246, x247: 247, x248: 248, x249: 249, x250: 250, x251: 251, x252: 252, x253: 253, x254: 254, x255: 255 };
const bar = Foo { x0: 0, x1: 1, x2: 2, x3: 3, x4: 4, x5: 5, x6: 6, x7: 7, x8: 8, x9: 9, x10: 10, x11: 11, x12: 12, x13: 13, x14: 14, x15: 15, x16: 16, x17: 17, x18: 18, x19: 19, x20: 20, x21: 21, x22: 22, x23: 23, x24: 24, x25: 25, x26: 26, x27: 27, x28: 28, x29: 29, x30: 30, x31: 31, x32: 32, x33: 33, x34: 34, x35: 35, x36: 36, x37: 37, x38: 38, x39: 39, x40: 40, x41: 41, x42: 42, x43: 43, x44: 44, x45: 45, x46: 46, x47: 47, x48: 48, x49: 49, x50: 50, x51: 51, x52: 52, x53: 53, x54: 54, x55: 55, x56: 56, x57: 57, x58: 58, x59: 59, x60: 60, x61: 61, x62: 62, x63: 63, x64: 64, x65: 65, x66: 66, x67: 67, x68: 68, x69: 69, x70: 70, x71: 71, x72: 72, x73: 73, x74: 74, x75: 75, x76: 76, x77: 77, x78: 78, x79: 79, x80: 80, x81: 81, x82: 82, x83: 83, x84: 84, x85: 85, x86: 86, x87: 87, x88: 88, x89: 89, x90: 90, x91: 91, x92: 92, x93: 93, x94: 94, x95: 95, x96: 96, x97: 97, x98: 98, x99: 99, x100: 100, x101: 101, x102: 102, x103: 103, x104: 104, x105: 105, x106: 106, x107: 107, x108: 108, x109: 109, x110: 110, x111: 111, x112: 112, x113: 113, x114: 114, x115: 115, x116: 116, x117: 117, x118: 118, x119: 119, x120: 120, x121: 121, x122: 122, x123: 123, x124: 124, x125: 125, x126: 126, x127: 127, x128: 128, x129: 129, x130: 130, x131: 131, x132: 132, x133: 133, x134: 134, x135: 135, x136: 136, x137: 137, x138: 138, x139: 139, x140: 140, x141: 141, x142: 142, x143: 143, x144: 144, x145: 145, x146: 146, x147: 147, x148: 148, x149: 149, x150: 150, x151: 151, x152: 152, x153: 153, x154: 154, x155: 155, x156: 156, x157: 157, x158: 158, x159: 159, x160: 160, x161: 161, x162: 162, x163: 163, x164: 164, x165: 165, x166: 166, x167: 167, x168: 168, x169: 169, x170: 170, x171: 171, x172: 172, x173: 173, x174: 174, x175: 175, x176: 176, x177: 177, x178: 178, x179: 179, x180: 180, x181: 181, x182: 182, x183: 183, x184: 184, x185: 185, x186: 186, x187: 187, x188: 188, x189: 189, x190: 190, x191: 191, x192: 192, x193: 193, x194: 194, x195: 195, x196: 196, x197: 197, x198: 198, x199: 199, x200: 200, x201: 201, x202: 202, x203: 203, x204: 204, x205: 205, x206: 206, x207: 207, x208: 208, x209: 209, x210: 210, x211: 211, x212: 212, x213: 213, x214: 214, x215: 215, x216: 216, x217: 217, x218: 218, x219: 219, x220: 220, x221: 221, x222: 222, x223: 223, x224: 224, x225: 225, x226: 226, x227: 227, x228: 228, x229: 229, x230: 230, x231: 231, x232: 232, x233: 233, x234: 234, x235: 235, x236: 236, x237: 237, x238: 238, x239: 239, x240: 240, x241: 241, x242: 242, x243: 243, x244: 244, x245: 245, x246: 246, x247: 247, x248: 248, x249: 249, x250: 250, x251: 251, x252: 252, x253: 253, x254: 254, x255: 255 };

View File

@ -1,4 +1,9 @@
function main() {
/*
namespace: Bench
expectation: Skip
*/
function main() -> u8 {
const x: u8 = 191;
if x == 0 {

View File

@ -1,4 +1,9 @@
function main() {
/*
namespace: Bench
expectation: Skip
*/
function main() -> u8 {
const x: u8 = 255;
return x == 0 ? x : (x == 1 ? x : (x == 2 ? x : (x == 3 ? x : (x == 4 ? x : (x == 5 ? x : (x == 6 ? x : (x == 7 ? x : (x == 8 ? x : (x == 9 ? x : (x == 10 ? x : (x == 11 ? x : (x == 12 ? x : (x == 13 ? x : (x == 14 ? x : (x == 15 ? x : (x == 16 ? x : (x == 17 ? x : (x == 18 ? x : (x == 19 ? x : (x == 20 ? x : (x == 21 ? x : (x == 22 ? x : (x == 23 ? x : (x == 24 ? x : (x == 25 ? x : (x == 26 ? x : (x == 27 ? x : (x == 28 ? x : (x == 29 ? x : (x == 30 ? x : (x == 31 ? x : (x == 32 ? x : (x == 33 ? x : (x == 34 ? x : (x == 35 ? x : (x == 36 ? x : (x == 37 ? x : (x == 38 ? x : (x == 39 ? x : (x == 40 ? x : (x == 41 ? x : (x == 42 ? x : (x == 43 ? x : (x == 44 ? x : (x == 45 ? x : (x == 46 ? x : (x == 47 ? x : (x == 48 ? x : (x == 49 ? x : (x == 50 ? x : (x == 51 ? x : (x == 52 ? x : (x == 53 ? x : (x == 54 ? x : (x == 55 ? x : (x == 56 ? x : (x == 57 ? x : (x == 58 ? x : (x == 59 ? x : (x == 60 ? x : (x == 61 ? x : (x == 62 ? x : (x == 63 ? x : (x == 64 ? x : (x == 65 ? x : (x == 66 ? x : (x == 67 ? x : (x == 68 ? x : (x == 69 ? x : (x == 70 ? x : (x == 71 ? x : (x == 72 ? x : (x == 73 ? x : (x == 74 ? x : (x == 75 ? x : (x == 76 ? x : (x == 77 ? x : (x == 78 ? x : (x == 79 ? x : (x == 80 ? x : (x == 81 ? x : (x == 82 ? x : (x == 83 ? x : (x == 84 ? x : (x == 85 ? x : (x == 86 ? x : (x == 87 ? x : (x == 88 ? x : (x == 89 ? x : (x == 90 ? x : (x == 91 ? x : (x == 92 ? x : (x == 93 ? x : (x == 94 ? x : (x == 95 ? x : (x == 96 ? x : (x == 97 ? x : (x == 98 ? x : (x == 99 ? x : (x == 100 ? x : (x == 101 ? x : (x == 102 ? x : (x == 103 ? x : (x == 104 ? x : (x == 105 ? x : (x == 106 ? x : (x == 107 ? x : (x == 108 ? x : (x == 109 ? x : (x == 110 ? x : (x == 111 ? x : (x == 112 ? x : (x == 113 ? x : (x == 114 ? x : (x == 115 ? x : (x == 116 ? x : (x == 117 ? x : (x == 118 ? x : (x == 119 ? x : (x == 120 ? x : (x == 121 ? x : (x == 122 ? x : (x == 123 ? x : (x == 124 ? x : (x == 125 ? x : (x == 126 ? x : (x == 127 ? x : (x == 128 ? x : (x == 129 ? x : (x == 130 ? x : (x == 131 ? x : (x == 132 ? x : (x == 133 ? x : (x == 134 ? x : (x == 135 ? x : (x == 136 ? x : (x == 137 ? x : (x == 138 ? x : (x == 139 ? x : (x == 140 ? x : (x == 141 ? x : (x == 142 ? x : (x == 143 ? x : (x == 144 ? x : (x == 145 ? x : (x == 146 ? x : (x == 147 ? x : (x == 148 ? x : (x == 149 ? x : (x == 150 ? x : (x == 151 ? x : (x == 152 ? x : (x == 153 ? x : (x == 154 ? x : (x == 155 ? x : (x == 156 ? x : (x == 157 ? x : (x == 158 ? x : (x == 159 ? x : (x == 160 ? x : (x == 161 ? x : (x == 162 ? x : (x == 163 ? x : (x == 164 ? x : (x == 165 ? x : (x == 166 ? x : (x == 167 ? x : (x == 168 ? x : (x == 169 ? x : (x == 170 ? x : (x == 171 ? x : (x == 172 ? x : (x == 173 ? x : (x == 174 ? x : (x == 175 ? x : (x == 176 ? x : (x == 177 ? x : (x == 178 ? x : (x == 179 ? x : (x == 180 ? x : (x == 181 ? x : (x == 182 ? x : (x == 183 ? x : (x == 184 ? x : (x == 185 ? x : (x == 186 ? x : (x == 187 ? x : (x == 188 ? x : (x == 189 ? x : (x == 190 ? x : (x == 191 ? x : (x == 192 ? x : (x == 193 ? x : (x == 194 ? x : (x == 195 ? x : (x == 196 ? x : (x == 197 ? x : (x == 198 ? x : (x == 199 ? x : (x == 200 ? x : (x == 201 ? x : (x == 202 ? x : (x == 203 ? x : (x == 204 ? x : (x == 205 ? x : (x == 206 ? x : (x == 207 ? x : (x == 208 ? x : (x == 209 ? x : (x == 210 ? x : (x == 211 ? x : (x == 212 ? x : (x == 213 ? x : (x == 214 ? x : (x == 215 ? x : (x == 216 ? x : (x == 217 ? x : (x == 218 ? x : (x == 219 ? x : (x == 220 ? x : (x == 221 ? x : (x == 222 ? x : (x == 223 ? x : (x == 224 ? x : (x == 225 ? x : (x == 226 ? x : (x == 227 ? x : (x == 228 ? x : (x == 229 ? x : (x == 230 ? x : (x == 231 ? x : (x == 232 ? x : (x == 233 ? x : (x == 234 ? x : (x == 235 ? x : (x == 236 ? x : (x == 237 ? x : (x == 238 ? x : (x == 239 ? x : (x == 240 ? x : (x == 241 ? x : (x == 242 ? x : (x == 243 ? x : (x == 244 ? x : (x == 245 ? x : (x == 246 ? x : (x == 247 ? x : (x == 248 ? x : (x == 249 ? x : (x == 250 ? x : (x == 251 ? x : (x == 252 ? x : (x == 253 ? x : (x == 254 ? x : (x == 255 ? x : 0)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))));

View File

@ -1,3 +1,8 @@
/*
namespace: Bench
expectation: Skip
*/
type g8SH = u8;
type V8fkp = u128;

View File

@ -1,3 +1,8 @@
/*
namespace: Bench
expectation: Skip
*/
type JzT3X = t5RQ;
type RaEnk = JzT3X;

View File

@ -1,3 +1,8 @@
/*
namespace: Bench
expectation: Skip
*/
type f7emM = i32;
type D7DUI = field;

View File

@ -1,3 +1,8 @@
/*
namespace: Bench
expectation: Skip
*/
type TESjC = u8;
type XgJbM = ud9u;

View File

@ -1,3 +1,8 @@
/*
namespace: Bench
expectation: Skip
*/
type NmYjQ = i32;
const K_baB = [85i8; 3];

View File

@ -1,3 +1,8 @@
/*
namespace: Bench
expectation: Skip
*/
function main() {
const arr1: [u8; (32, 32)] = [
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 31],

View File

@ -0,0 +1,14 @@
/*
namespace: Bench
expectation: Pass
*/
function main() -> u32 {
const a = 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32;
const b = 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32;
const c = 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32;
const d = 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32;
const e = 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32 + 1u32;
return a + b + c + d + e;
}

View File

@ -1,3 +1,8 @@
/*
namespace: Bench
expectation: Skip
*/
function main() {
const x0: u8 = 0;
const x1: u8 = x0;

View File

@ -1,4 +1,9 @@
function main() {
/*
namespace: Bench
expectation: Pass
*/
function main() -> u8 {
return x191(0u32);
}

View File

@ -1,3 +1,8 @@
/*
namespace: Bench
expectation: Skip
*/
type ipD5 = i8;
type g52FJ = (field, u128);

View File

@ -1,3 +1,8 @@
/*
namespace: Bench
expectation: Skip
*/
const Hqyz7: address = aleo1nr8us4x0p4yyd99qa878e06jwddqr79gavznpxc6degn2gcv8syseq4dqu;

View File

@ -1,3 +1,8 @@
/*
namespace: Bench
expectation: Skip
*/
type xs1w = i8;
type Z5tB = field;

View File

@ -1,3 +1,8 @@
/*
namespace: Bench
expectation: Skip
*/
type HGvc = char;
type gOJKD = u64;

View File

@ -1,3 +1,8 @@
/*
namespace: Bench
expectation: Skip
*/
type LWClh = u128;
type IWJoY = i64;

View File

@ -1,3 +1,8 @@
/*
namespace: Bench
expectation: Skip
*/
type pD0X5 = i8;
type XKaI = i16;

View File

@ -1,3 +1,8 @@
/*
namespace: Bench
expectation: Skip
*/
type Ol3w = field;
type Ahe2 = bool;

View File

@ -1,3 +1,8 @@
/*
namespace: Bench
expectation: Skip
*/
type uxXY = (u32, char);
type gzOiV = bool;

View File

@ -1,3 +1,8 @@
/*
namespace: Bench
expectation: Skip
*/
type RoqL = i64;
type AaPhh = u8;

View File

@ -1,3 +1,8 @@
/*
namespace: Bench
expectation: Skip
*/
type km8Fr = u32;
type kzW6 = i32;

View File

@ -1,3 +1,8 @@
/*
namespace: Bench
expectation: Skip
*/
type Rx6fk = u8;
type Sq9N = i8;

View File

@ -74,9 +74,32 @@ To do so you can simply remove the corresponding `.out` file in the `tests/expec
To make several aspects of the test framework easier to work with there are several environment variables:
- `TEST_FILTER` - runs all tests that contain the specified name.
- `CLEAR_LEO_TEST_EXPECTATIONS` - which if set clears all current expectations and regenerates them all.
- `TEST_FILTER` - Now runs all tests in the given directory, or the exact given test.
- `TEST_FILTER="address" cargo test -p leo-compiler` will run all tests in the located in `tests/compiler/address`.
- `TEST_FILTER="address/branch.leo" cargo test -p leo-compiler` will run the test located in `tests/compiler/address/branch.leo`.
- `CLEAR_LEO_TEST_EXPECTATIONS` - which if set clears all current expectations for the tests being run and regenerates them all.
To set environment variables please look at your Shell(bash/powershell/cmd/fish/etc) specific implementation for doing so
**NOTE**: Don't forget to clear the environment variable after running it with that setting, or set a temporary env variable if your shell supports it.
### Benchmarking
The test-framework is now used to easily benchmark Leo, by running on all compiler tests that have the `Pass` expectation.
Additionally, you can create additional benchmark tests by adding them in the test directory by giving them the namespace of `Bench`.
#### Running
There are currently four different kinds of benchmarks to run:
- parse - benchmarks parsing of Leo files.
- symbol - benchmarks the symbol table generation pass.
- type - benchmarks the type checking pass.
- full - benchmarks all aspects of compilation.
To run the benchmarks the command is `cargo bench -p leo-test-framework`.
This by default runs all the above-mentioned benchmark suites.
To specify a specific one you would do `cargo bench -p leo-test-framework parse` or any of the above-listed benchmark suites.
**NOTE** Benchmarks are affected by the `TEST_FILTER` environment variable.
They are also machine dependent on your pc and are impacted by other open applications.

View File

@ -177,5 +177,6 @@ pub fn emit_errors(
}
None
}
(Ok(_), TestExpectationMode::Skip) => None,
}
}

View File

@ -93,7 +93,7 @@ impl TestCases {
path_prefix.push("../../tests/");
path_prefix.push(expectation_category);
if let Ok(p) = std::env::var("TEST_FILTER") {
path_prefix.push(p)
path_prefix.push(p);
}
let mut expectation_dir = path_prefix.clone();
@ -281,7 +281,12 @@ pub fn run_tests<T: Runner>(runner: &T, expectation_category: &str) {
/// returns (name, content) for all benchmark samples
pub fn get_benches() -> Vec<(String, String)> {
let (mut cases, configs) = TestCases::new("compiler", |config| config.expectation != TestExpectationMode::Fail);
let (mut cases, configs) = TestCases::new("compiler", |config| {
(&config.namespace == "Bench" && config.expectation == TestExpectationMode::Pass)
|| (&config.namespace == "Compile"
&& config.expectation != TestExpectationMode::Fail
&& config.expectation != TestExpectationMode::Skip)
});
cases.process_tests(configs, |_, (_, content, test_name, _)| {
(test_name.to_string(), content.to_string())

View File

@ -20,6 +20,7 @@ use std::collections::BTreeMap;
pub enum TestExpectationMode {
Pass,
Fail,
Skip,
}
#[derive(Debug, serde::Serialize, serde::Deserialize)]