You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
989 B
32 lines
989 B
From 7ba903ad760e27737807221e528380e474bc5b55 Mon Sep 17 00:00:00 2001
|
|
From: m4b <m4b.github.io@gmail.com>
|
|
Date: Sun, 3 Dec 2017 21:02:15 -0800
|
|
Subject: [PATCH] tests: use release directory if debug is missing. fixes #63
|
|
|
|
---
|
|
tests/archive.rs | 7 ++++++-
|
|
1 file changed, 6 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/tests/archive.rs b/tests/archive.rs
|
|
index c61b42c..144d0ae 100644
|
|
--- a/tests/archive.rs
|
|
+++ b/tests/archive.rs
|
|
@@ -54,8 +54,13 @@ fn parse_archive() {
|
|
|
|
#[test]
|
|
fn parse_self() {
|
|
+ use std::fs;
|
|
use std::io::Read;
|
|
- let path = Path::new("target").join("debug").join("libgoblin.rlib");
|
|
+ let mut path = Path::new("target").join("debug").join("libgoblin.rlib");
|
|
+ // https://github.com/m4b/goblin/issues/63
|
|
+ if !fs::metadata(&path).is_ok() {
|
|
+ path = Path::new("target").join("release").join("libgoblin.rlib");
|
|
+ }
|
|
let buffer = {
|
|
let mut fd = File::open(path).expect("open file");
|
|
let mut v = Vec::new();
|
|
--
|
|
2.15.1
|
|
|