From 90b3a3d6989c4803eb3643457b9e0d37a6ea24e1 Mon Sep 17 00:00:00 2001 From: Jan Civlin <30603832+jcivlin@users.noreply.github.com> Date: Thu, 24 Aug 2023 09:46:46 -0700 Subject: [PATCH] Small fixes (#301) --- language/tools/move-mv-llvm-compiler/src/main.rs | 3 +++ language/tools/move-mv-llvm-compiler/tests/cli-tests.rs | 2 ++ 2 files changed, 5 insertions(+) diff --git a/language/tools/move-mv-llvm-compiler/src/main.rs b/language/tools/move-mv-llvm-compiler/src/main.rs index eb55dbea8f..61692fdcb3 100644 --- a/language/tools/move-mv-llvm-compiler/src/main.rs +++ b/language/tools/move-mv-llvm-compiler/src/main.rs @@ -235,6 +235,9 @@ fn main() -> anyhow::Result<()> { // If '-c' option is set, then -o is the directory to output the compiled modules, // each module 'mod' will get file name 'mod.ll' if compilation { + if output_file_path.ends_with('/') { + output_file_path.pop(); + } let mut out_path = Path::new(&output_file_path).to_path_buf().join(modname); out_path.set_extension(&args.output_file_extension); output_file = out_path.to_str().unwrap().to_string(); diff --git a/language/tools/move-mv-llvm-compiler/tests/cli-tests.rs b/language/tools/move-mv-llvm-compiler/tests/cli-tests.rs index 6121179c71..0f862ae33c 100644 --- a/language/tools/move-mv-llvm-compiler/tests/cli-tests.rs +++ b/language/tools/move-mv-llvm-compiler/tests/cli-tests.rs @@ -99,6 +99,8 @@ fn run_test_inner(test_path: &Path) -> anyhow::Result<()> { let dst = &src.join("relative_path_results"); tc::store_results(src, dst)?; + tc::clean_results(src)?; + ///////////////////// // test absolute path tc::run_move_to_llvm_build(