Skip to content

Commit 9810f5b

Browse files
committed
Add a missing header file and some extra links so that it builds on linux
1 parent f4fb79e commit 9810f5b

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

src/libcprover-rust/build.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ fn main() {
5050
println!("cargo:rustc-link-lib=static=solvers");
5151
println!("cargo:rustc-link-lib=static=assembler");
5252
println!("cargo:rustc-link-lib=static=xml");
53+
println!("cargo:rustc-link-lib=static=json");
54+
println!("cargo:rustc-link-lib=static=json-symtab-language");
55+
println!("cargo:rustc-link-lib=static=cpp");
56+
println!("cargo:rustc-link-lib=static=jsil");
57+
println!("cargo:rustc-link-lib=static=statement-list");
5358
println!("cargo:rustc-link-lib=static=goto-symex");
5459
println!("cargo:rustc-link-lib=static=pointer-analysis");
5560
println!("cargo:rustc-link-lib=static=minisat2-condensed");

src/libcprover-rust/include/c_api.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22

33
#include "rust/cxx.h"
4+
#include <memory>
45

56
struct api_sessiont;
67

src/libcprover-rust/src/lib.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,24 +60,24 @@ mod tests {
6060
assert_eq!(vect.len(), 2);
6161
}
6262

63-
// #[test]
64-
// fn it_can_load_model_from_file() {
65-
// let binding = ffi::new_api_session();
66-
// let client = match binding.as_ref() {
67-
// Some(api_ref) => api_ref,
68-
// None => panic!("Failed to acquire API session handle"),
69-
// };
63+
#[test]
64+
fn it_can_load_model_from_file() {
65+
let binding = ffi::new_api_session();
66+
let client = match binding.as_ref() {
67+
Some(api_ref) => api_ref,
68+
None => panic!("Failed to acquire API session handle"),
69+
};
7070

71-
// let vec: Vec<String> = vec![
72-
// "/tmp/example.c".to_owned()];
71+
let vec: Vec<String> = vec![
72+
"/tmp/example.c".to_owned()];
7373

74-
// let vect = ffi::translate_vector_of_string(vec);
75-
// assert_eq!(vect.len(), 1);
74+
let vect = ffi::translate_vector_of_string(vec);
75+
assert_eq!(vect.len(), 1);
7676

77-
// // Invoke load_model_from_files and see if the model
78-
// // has been loaded.
79-
// client.load_model_from_files(vect);
80-
// }
77+
// Invoke load_model_from_files and see if the model
78+
// has been loaded.
79+
client.load_model_from_files(vect);
80+
}
8181

8282
#[test]
8383
fn it_can_verify_the_loaded_model() {

0 commit comments

Comments
 (0)