From 562e611f6bef4618ee076e37a988d54320314f91 Mon Sep 17 00:00:00 2001 From: Jaroslav Tulach Date: Thu, 20 Jun 2024 19:04:00 +0200 Subject: [PATCH] Factorial sample program is no longer needed --- build/build/src/engine/context.rs | 14 -------------- docs/infrastructure/native-image.md | 11 +++++------ engine/runner/src/test/resources/Factorial.enso | 12 ------------ 3 files changed, 5 insertions(+), 32 deletions(-) delete mode 100644 engine/runner/src/test/resources/Factorial.enso diff --git a/build/build/src/engine/context.rs b/build/build/src/engine/context.rs index 7c670c1df94b..3bc0778196c9 100644 --- a/build/build/src/engine/context.rs +++ b/build/build/src/engine/context.rs @@ -635,20 +635,6 @@ pub async fn runner_sanity_test( let engine_package = repo_root.built_distribution.enso_engine_triple.engine_package.as_path(); // The engine package is necessary for running the native runner. ide_ci::fs::tokio::require_exist(engine_package).await?; - let output = Command::new(&repo_root.runner) - .args([ - "--run", - repo_root.engine.runner.src.test.resources.factorial_enso.as_str(), - factorial_input, - ]) - .set_env_opt(ENSO_JAVA, enso_java)? - .set_env(ENSO_DATA_DIRECTORY, engine_package)? - .run_stdout() - .await?; - ensure!( - output.contains(factorial_expected_output), - "Native runner output does not contain expected result '{factorial_expected_output}'. Output:\n{output}", - ); if enso_java.is_none() { let test_base = Command::new(&repo_root.runner) .args(["--run", repo_root.test.join("Base_Tests").as_str()]) diff --git a/docs/infrastructure/native-image.md b/docs/infrastructure/native-image.md index 3dd872d00a80..b1091285b21f 100644 --- a/docs/infrastructure/native-image.md +++ b/docs/infrastructure/native-image.md @@ -207,17 +207,16 @@ state. To generate the Native Image for runner simply execute sbt> engine-runner/buildNativeImage ``` -and execute the binary on a sample factorial test program +and execute any program with that binary - for example `test/Base_Tests` ```bash -> runner --run engine/runner/src/test/resources/Factorial.enso 6 +$ runner --run test/Base_Tests ``` The task that generates the Native Image, along with all the necessary -configuration, reside in a separate project due to a bug in the currently used -GraalVM version. As September 2023 it can execute all Enso code, but cannot -invoke `IO.println` or other library functions that require -[polyglot java import](../../docs/polyglot/java.md), but read on... +configuration, makes sure that `Standard.Base` library calls into Java via +[polyglot java import](../../docs/polyglot/java.md) are compiled into the binary +and ready to be used. ### Engine with Espresso diff --git a/engine/runner/src/test/resources/Factorial.enso b/engine/runner/src/test/resources/Factorial.enso deleted file mode 100644 index ef86800b699f..000000000000 --- a/engine/runner/src/test/resources/Factorial.enso +++ /dev/null @@ -1,12 +0,0 @@ -import Standard.Base.Data.Numbers -import Standard.Base.IO - -fac n = - facacc n v = if n <= 1 then v else @Tail_Call facacc n-1 n*v - - res = facacc n 1 - res - -main number=5 = - v = fac number - IO.println v