Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Commit

Permalink
Use tempfile in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
EPashkin committed Nov 15, 2019
1 parent 82fcc9e commit 7790815
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gir
2 changes: 1 addition & 1 deletion sourceview-sys/Cargo.toml
Expand Up @@ -29,7 +29,7 @@ git = "https://github.com/gtk-rs/sys"

[dev-dependencies]
shell-words = "0.1.0"
tempdir = "0.3"
tempfile = "3"

[features]
v3_4 = []
Expand Down
13 changes: 10 additions & 3 deletions sourceview-sys/tests/abi.rs
Expand Up @@ -4,14 +4,15 @@

extern crate gtk_source_sys;
extern crate shell_words;
extern crate tempdir;
extern crate tempfile;
use gtk_source_sys::*;
use std::env;
use std::error::Error;
use std::mem::{align_of, size_of};
use std::path::Path;
use std::process::Command;
use std::str;
use tempfile::Builder;

static PACKAGES: &[&str] = &["gtksourceview-3.0"];

Expand Down Expand Up @@ -126,7 +127,10 @@ impl Results {

#[test]
fn cross_validate_constants_with_c() {
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
let tmpdir = Builder::new()
.prefix("abi")
.tempdir()
.expect("temporary directory");
let cc = Compiler::new().expect("configured compiler");

assert_eq!(
Expand Down Expand Up @@ -163,7 +167,10 @@ fn cross_validate_constants_with_c() {

#[test]
fn cross_validate_layout_with_c() {
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
let tmpdir = Builder::new()
.prefix("abi")
.tempdir()
.expect("temporary directory");
let cc = Compiler::new().expect("configured compiler");

assert_eq!(
Expand Down
2 changes: 1 addition & 1 deletion sourceview-sys/versions.txt
@@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ 6c8c7c4)
Generated by gir (https://github.com/gtk-rs/gir @ 1ee9edf)
from gir-files (https://github.com/gtk-rs/gir-files @ 22748fa)

0 comments on commit 7790815

Please sign in to comment.