Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable failing casr-java native lib test #212

Merged
merged 1 commit into from
Mar 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 28 additions & 12 deletions casr/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4176,18 +4176,16 @@ fn test_casr_python() {
#[test]
#[cfg(target_arch = "x86_64")]
fn test_casr_java() {
let paths = [
abs_path("tests/casr_tests/java/Test1.java"),
abs_path("tests/casr_tests/java/Test2.java"),
abs_path("tests/casr_tests/java/Test2.cpp"),
abs_path("tests/tmp_tests_casr/libnative.so"),
abs_path("tests/tmp_tests_casr/"),
];
let paths = [abs_path("tests/casr_tests/java/Test1.java")];

let _ = fs::create_dir(abs_path("tests/tmp_tests_casr"));
// Test only java
let output = Command::new(*EXE_CASR_JAVA.read().unwrap())
.args(["--stdout", "--", "java", &paths[0]])
.args([
"--stdout",
"--",
"/usr/lib/jvm/java-17-openjdk-amd64/bin/java",
&paths[0],
])
.output()
.expect("failed to start casr-java");

Expand Down Expand Up @@ -4216,7 +4214,20 @@ fn test_casr_java() {
} else {
panic!("Couldn't parse json report file.");
}
}

#[test]
#[ignore]
#[cfg(target_arch = "x86_64")]
fn test_casr_java_native_lib() {
let paths = [
abs_path("tests/casr_tests/java/Test2.java"),
abs_path("tests/casr_tests/java/Test2.cpp"),
abs_path("tests/tmp_tests_casr/libnative.so"),
abs_path("tests/tmp_tests_casr/"),
];

let _ = fs::create_dir(abs_path("tests/tmp_tests_casr"));
// Test java with native lib
let clang = Command::new("bash")
.arg("-c")
Expand All @@ -4225,7 +4236,7 @@ fn test_casr_java() {
-I/usr/lib/jvm/java-17-openjdk-amd64/include \
-I/usr/lib/jvm/java-17-openjdk-amd64/include/linux \
-fPIC {} -o {}",
&paths[2], &paths[3]
&paths[1], &paths[2]
))
.output()
.expect("failed to execute clang++");
Expand Down Expand Up @@ -4258,9 +4269,14 @@ fn test_casr_java() {
.unwrap()
.to_string();
let output = Command::new(*EXE_CASR_JAVA.read().unwrap())
.args(["--stdout", "--", "java", &paths[1]])
.args([
"--stdout",
"--",
"/usr/lib/jvm/java-17-openjdk-amd64/bin/java",
&paths[0],
])
.env("LD_PRELOAD", clang_rt.trim())
.env("LD_LIBRARY_PATH", &paths[4])
.env("LD_LIBRARY_PATH", &paths[3])
.env("PATH", format!("{}:{}", env!("PATH"), cargo_target_dir))
.output()
.expect("failed to start casr-java");
Expand Down
Loading