mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
fix test panic output formatting
This commit is contained in:
parent
0e56753bf1
commit
ccd8821acf
2 changed files with 18 additions and 13 deletions
|
@ -75,10 +75,10 @@ macro_rules! try_run_jit_function {
|
|||
try_run_jit_function!($lib, $main_fn_name, $ty, $transform, v)
|
||||
}};
|
||||
|
||||
($lib: expr, $main_fn_name: expr, $ty:ty, $transform:expr, $errors:expr) => {{
|
||||
try_run_jit_function!($lib, $main_fn_name, $ty, $transform, $errors, &[])
|
||||
($lib: expr, $main_fn_name: expr, $ty:ty, $transform:expr) => {{
|
||||
try_run_jit_function!($lib, $main_fn_name, $ty, $transform, &[])
|
||||
}};
|
||||
($lib: expr, $main_fn_name: expr, $ty:ty, $transform:expr, $errors:expr, $expect_failures:expr) => {{
|
||||
($lib: expr, $main_fn_name: expr, $ty:ty, $transform:expr, $expect_failures:expr) => {{
|
||||
use inkwell::context::Context;
|
||||
use roc_builtins::bitcode;
|
||||
use roc_gen_llvm::run_roc::RocCallResult;
|
||||
|
@ -110,14 +110,8 @@ macro_rules! run_jit_function {
|
|||
run_jit_function!($lib, $main_fn_name, $ty, $transform, $errors, &[])
|
||||
}};
|
||||
($lib: expr, $main_fn_name: expr, $ty:ty, $transform:expr, $errors:expr, $expect_failures:expr) => {{
|
||||
let result = $crate::try_run_jit_function!(
|
||||
$lib,
|
||||
$main_fn_name,
|
||||
$ty,
|
||||
$transform,
|
||||
$errors,
|
||||
$expect_failures
|
||||
);
|
||||
let result =
|
||||
$crate::try_run_jit_function!($lib, $main_fn_name, $ty, $transform, $expect_failures);
|
||||
|
||||
match result {
|
||||
Ok(success) => {
|
||||
|
|
|
@ -516,7 +516,7 @@ macro_rules! assert_llvm_evals_to {
|
|||
use bumpalo::Bump;
|
||||
use inkwell::context::Context;
|
||||
use roc_gen_llvm::llvm::build::LlvmBackendMode;
|
||||
use roc_gen_llvm::run_jit_function;
|
||||
use roc_gen_llvm::try_run_jit_function;
|
||||
|
||||
let arena = Bump::new();
|
||||
let context = Context::create();
|
||||
|
@ -537,7 +537,18 @@ macro_rules! assert_llvm_evals_to {
|
|||
let given = $transform(success);
|
||||
assert_eq!(&given, &expected, "LLVM test failed");
|
||||
};
|
||||
run_jit_function!(lib, main_fn_name, $ty, transform, errors)
|
||||
|
||||
let result = try_run_jit_function!(lib, main_fn_name, $ty, transform, errors);
|
||||
|
||||
match result {
|
||||
Ok(raw) => {
|
||||
// only if there are no exceptions thrown, check for errors
|
||||
assert!(errors.is_empty(), "Encountered errors:\n{}", errors);
|
||||
|
||||
transform(raw)
|
||||
}
|
||||
Err(msg) => panic!("Roc failed with message: \"{}\"", msg),
|
||||
}
|
||||
};
|
||||
|
||||
($src:expr, $expected:expr, $ty:ty) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue