Skip to content
Snippets Groups Projects
Commit 67e40a93 authored by Henrik Tjäder's avatar Henrik Tjäder
Browse files

Separated tested functions into a separate crate with modules

parent 3d592a89
No related branches found
No related tags found
No related merge requests found
Pipeline #
**/*.rs.bk **/*.rs.bk
.#* .#*
target target
\ No newline at end of file *.swp
tags
#.cargo_test_template: &cargo_test
#stage: test
#script:
#- ./run-cargo.sh
#- ls -lR
#- ./klee.sh
#nightly:cargo:
#image: afoht/llvm4-klee-rust
#<<: *cargo_test
stages:
- deploy
#- test
# Setup the rust environment
#before_script:
#- pacman -Sy tree
#- apt-get update -yqq
#- apt-get install -yqq --no-install-recommends build-essential
## Must be outside the project folder
#- cd /
#- cargo install cargo
## Return
#- cd -
##- rustup toolchain remove nightly
##- rustup toolchain install nightly
#- rustup default nightly
#- rustup target add arm-unknown-linux-gnueabihf
#- rustup target add arm-unknown-linux-gnueabi
#- rustup target add armv7-unknown-linux-gnueabihf
#- rustup component add rust-src
#- rustup update
# Generate documentation
pages:
image: rustdocker/rust:nightly
stage: deploy
only:
- master
script:
- rm -rf public
- mkdir public
- cd cargo-klee
- cargo doc --no-deps
# The content inside the target doc folder, but index even deeper down
- cp -R target/doc/* ../public
artifacts:
paths:
- public
...@@ -5,6 +5,7 @@ authors = ["Jorge Aparicio <jorge@japaric.io>"] ...@@ -5,6 +5,7 @@ authors = ["Jorge Aparicio <jorge@japaric.io>"]
[dependencies] [dependencies]
klee = {path="../klee"} klee = {path="../klee"}
testfunction = {path="../testfunction"}
[profile.release] [profile.release]
debug = true debug = true
\ No newline at end of file
#![no_std]
#[macro_use]
extern crate klee;
extern crate testfunction;
use core::ptr;
use testfunction::m1::*;
use testfunction::m2::*;
fn main() {
let u = ksymbol!("u");
unsafe {
ptr::read_volatile(&f2(f1(u)));
}
}
// add 1 wrapping
//mod m1;
//mod m2;
//use m1::*;
//use m2::*;
[package]
name = "testfunction"
version = "0.1.0"
authors = ["Henrik Tjäder <henrik@tjaders.com>"]
[dependencies]
#![no_std]
pub mod m1;
pub mod m2;
use m1::*;
use m2::*;
pub fn f1(u: u8) -> u8 {
u.wrapping_add(1)
}
pub fn f2(u: u8) -> u8 {
100 / u
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment