Skip to content

Commit

Permalink
Added a simple test
Browse files Browse the repository at this point in the history
Should prevent further issues with erroneous build results. This was based on the Dockerfile's test; running `cargo test`, as well as more complex tests (possibly relying on `test-crates`) should also be added
  • Loading branch information
jmc-figueira authored and vakaras committed Apr 27, 2021
1 parent 1b6b59c commit 3e39f97
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 15 deletions.
30 changes: 15 additions & 15 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,53 @@
};
};

checks = {
# prusti-test = naersk-lib.buildPackage {
# name = "prusti-test";
# version = "${prusti-version}";
# root = ./.;
# checkInputs = [
# pkgs.pkg-config
# pkgs.wget
# pkgs.gcc
# pkgs.openssl
# pkgs.jdk11
# packages.viper
# packages.ow2_asm
# ];

# doCheck = true;

# override = _: {
# preBuild = ''
# export LD_LIBRARY_PATH="${pkgs.jdk11}/lib/openjdk/lib/server"
# export VIPER_HOME="${packages.viper}/backends"
# export Z3_EXE="${packages.viper}/z3/bin/z3"
# export ASM_JAR="${packages.ow2_asm}/asm.jar"
# '';
# preCheck = ''
# export RUST_SYSROOT="${rust}"
# export JAVA_HOME="${pkgs.jdk11}/lib/openjdk"
# export LD_LIBRARY_PATH="${pkgs.jdk11}/lib/openjdk/lib/server"
# export VIPER_HOME="${packages.viper}/backends"
# export Z3_EXE="${packages.viper}/z3/bin/z3"
# '';
# };
# };

prusti-simple-test = pkgs.runCommand "prusti-simple-test" {
buildInputs = [
defaultPackage
rust
];
}
''
cargo new --name example $out/example
sed -i '1s/^/use prusti_contracts::*;\n/;s/println.*$/assert!(true);/' $out/example/src/main.rs
cargo-prusti --manifest-path=$out/example/Cargo.toml
'';
};

defaultPackage = packages.prusti;
}
);
Expand Down

0 comments on commit 3e39f97

Please sign in to comment.