Skip to content

Commit

Permalink
Move tests from prusti-tests back to prusti
Browse files Browse the repository at this point in the history
  • Loading branch information
fpoli committed Jul 19, 2019
1 parent e11e7aa commit 3fda824
Show file tree
Hide file tree
Showing 431 changed files with 48 additions and 83 deletions.
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ test:
- cargo --version
- cargo build --all
- cargo test --all --verbose -- --nocapture
- ./target/debug/prusti-rustc prusti-tests/tests/verify/pass/no-annotations/assert-true.rs
- ./target/debug/prusti-rustc prusti-tests/tests/verify/fail/no-annotations/assert-false.rs || if [ $? -eq 0 ]; then false; fi
- ./target/debug/prusti-rustc prusti/tests/verify/pass/no-annotations/assert-true.rs
- ./target/debug/prusti-rustc prusti/tests/verify/fail/no-annotations/assert-false.rs || if [ $? -eq 0 ]; then false; fi
16 changes: 2 additions & 14 deletions Cargo.lock

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

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ members = [
"jni-gen/systest",
"prusti-interface",
"prusti-filter",
"prusti-tools",
"prusti-tests",
]

[profile.release]
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ below or http://www.mozilla.org/MPL/2.0/), with the following
(see http://creativecommons.org/publicdomain/zero/1.0/):

jni-gen/systest
prusti-tests/tests
prusti/tests
viper/tests
viper/benches
viper-sys/tests
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ SHELL := /bin/bash
RUST_LOG ?= prusti=info
RUST_TEST_THREADS ?= 1
JAVA_HOME ?= /usr/lib/jvm/default-java
RUN_FILE ?= prusti-tests/tests/typecheck/pass/lint.rs
RUN_FILE ?= prusti/tests/typecheck/pass/lint.rs
RUN_FILE_FOLDER=$(shell dirname ${RUN_FILE})
JAVA_LIBJVM_DIR=$(shell dirname "$(shell find "$(shell readlink -f ${JAVA_HOME})" -name "libjvm.so")")
RUSTUP_TOOLCHAIN=$(shell cat rust-toolchain)
Expand Down Expand Up @@ -45,7 +45,7 @@ test: build

test-examples: build
$(SET_ENV_VARS) \
cargo test -p prusti-tests
cargo test -p prusti

build-profile:
$(SET_ENV_VARS) \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Overflow checking can be enabled with a configuration flag, otherwise all intege
In Prusti, the functional behaviour of a function can be specified by using preconditions, postconditions, and loop invariants.
The tool checks them, reporting error messages when the code does not adhere to the provided specification.

To see examples of programs annotated with specifications, look into the [`prusti-tests/tests/verify/pass/rosetta`](prusti-tests/tests/verify/pass/rosetta) and [`prusti-tests/tests/verify/pass-overflow/rosetta`](prusti-tests/tests/verify/pass-overflow/rosetta) folders.
To see examples of programs annotated with specifications, look into the [`prusti/tests/verify/pass/rosetta`](prusti/tests/verify/pass/rosetta) and [`prusti/tests/verify/pass-overflow/rosetta`](prusti/tests/verify/pass-overflow/rosetta) folders.


Build for local development
Expand Down
36 changes: 18 additions & 18 deletions evaluation/benchmark/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,24 @@
)

MANUAL_EVALUATION="""
prusti-tests/tests/verify/pass-overflow/rosetta/100_doors_generic.rs
prusti-tests/tests/verify/pass-overflow/rosetta/Binary_search_shared.rs
prusti-tests/tests/verify/pass-overflow/rosetta/Heapsort_generic.rs
prusti-tests/tests/verify/pass-overflow/rosetta/Knights_tour_generic.rs
prusti-tests/tests/verify/pass-overflow/rosetta/Knuth_shuffle.rs
prusti-tests/tests/verify/pass-overflow/rosetta/Langtons_ant.rs
prusti-tests/tests/verify/pass-overflow/rosetta/Selection_sort_generic.rs
prusti-tests/tests/verify/pass/rosetta/Ackermann_function.rs
prusti-tests/tests/verify/pass-overflow/rosetta/Binary_search_shared_monomorphised.rs
prusti-tests/tests/verify/pass/rosetta/Fibonacci_sequence.rs
prusti-tests/tests/verify/pass/rosetta/Knapsack_Problem.rs
prusti-tests/tests/verify/pass/larger/first-final.rs
prusti-tests/tests/verify/pass-overflow/rosetta/Selection_sort.rs
prusti-tests/tests/verify/pass-overflow/rosetta/Towers_of_Hanoi_spec.rs
prusti-tests/tests/verify/pass-overflow/nll-rfc/borrow_first.rs
prusti-tests/tests/verify/fail/nll-rfc/message.rs
prusti/tests/verify/pass-overflow/rosetta/100_doors_generic.rs
prusti/tests/verify/pass-overflow/rosetta/Binary_search_shared.rs
prusti/tests/verify/pass-overflow/rosetta/Heapsort_generic.rs
prusti/tests/verify/pass-overflow/rosetta/Knights_tour_generic.rs
prusti/tests/verify/pass-overflow/rosetta/Knuth_shuffle.rs
prusti/tests/verify/pass-overflow/rosetta/Langtons_ant.rs
prusti/tests/verify/pass-overflow/rosetta/Selection_sort_generic.rs
prusti/tests/verify/pass/rosetta/Ackermann_function.rs
prusti/tests/verify/pass-overflow/rosetta/Binary_search_shared_monomorphised.rs
prusti/tests/verify/pass/rosetta/Fibonacci_sequence.rs
prusti/tests/verify/pass/rosetta/Knapsack_Problem.rs
prusti/tests/verify/pass/larger/first-final.rs
prusti/tests/verify/pass-overflow/rosetta/Selection_sort.rs
prusti/tests/verify/pass-overflow/rosetta/Towers_of_Hanoi_spec.rs
prusti/tests/verify/pass-overflow/nll-rfc/borrow_first.rs
prusti/tests/verify/fail/nll-rfc/message.rs
""".strip().split()


Expand Down
4 changes: 2 additions & 2 deletions evaluation/script/prepare-artefact-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ cp "$DIR/../crates/successful-fine-grained.csv" "$ARTEFACT_DIR/evaluation-2/succ

cp -r "$DIR/../artifact/examples/"*.orig "$ARTEFACT_DIR/evaluation-3/originals"

cat "$DIR/../benchmark/benchmark.py" | grep "prusti-tests/tests/verify" | grep -v "overflow" | while read file
cat "$DIR/../benchmark/benchmark.py" | grep "prusti/tests/verify" | grep -v "overflow" | while read file
do
echo === $file ===
cp -r "$DIR/../../$file" "$ARTEFACT_DIR/evaluation-3/without-overflow-checks/"
done

cat "$DIR/../benchmark/benchmark.py" | grep "prusti-tests/tests/verify" | grep "overflow" | while read file
cat "$DIR/../benchmark/benchmark.py" | grep "prusti/tests/verify" | grep "overflow" | while read file
do
echo === $file ===
cp -r "$DIR/../../$file" "$ARTEFACT_DIR/evaluation-3/with-overflow-checks/"
Expand Down
9 changes: 0 additions & 9 deletions prusti-tests/Cargo.toml

This file was deleted.

3 changes: 0 additions & 3 deletions prusti-tests/README.md

This file was deleted.

19 changes: 0 additions & 19 deletions prusti-tools/Cargo.toml

This file was deleted.

3 changes: 0 additions & 3 deletions prusti-tools/README.md

This file was deleted.

6 changes: 0 additions & 6 deletions prusti-tools/build.rs

This file was deleted.

14 changes: 14 additions & 0 deletions prusti/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,27 @@ name = "prusti-driver"
test = false
path = "src/driver.rs"

[[bin]]
name = "prusti-rustc"
test = false
path = "src/prusti_rustc.rs"

[[bin]]
name = "cargo-prusti"
test = false
path = "src/cargo_prusti.rs"

[dependencies]
log = { version = "0.4", features = ["release_max_level_info"] }
env_logger = "0.5.13"
regex = "1.0.5"
prusti-contracts = { path = "../prusti-contracts" }
prusti-interface = { path = "../prusti-interface" }
prusti-viper = { path = "../prusti-viper" }
walkdir = "2"

[build-dependencies]
chrono = "0.4"

[dev-dependencies]
compiletest_rs = { git = "https://github.com/fpoli/compiletest-rs.git", branch="with-exit-code-101" }
2 changes: 1 addition & 1 deletion prusti/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Prusti

This crate provides the `prusti-driver` binary.
This crate provides the Prusti binaries that can be used to verify a single Rust file or an entire crate.
5 changes: 5 additions & 0 deletions prusti/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ use chrono::prelude::Utc;
use std::process::Command;

fn main() {
println!(
"cargo:rustc-env=TARGET={}",
std::env::var("TARGET").unwrap()
);

if let Some(git_hash) = Command::new("git")
.args(&["rev-parse", "--short=19", "HEAD"])
.output()
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 3fda824

Please sign in to comment.