@@ -208,8 +208,6 @@ fn minimize_rpaths(rpaths: &[Path]) -> ~[Path] {
208
208
209
209
#[ cfg( unix) ]
210
210
mod test {
211
- #[ legacy_exports] ;
212
-
213
211
use core:: prelude:: * ;
214
212
215
213
use back:: rpath:: { get_absolute_rpath, get_install_prefix_rpath} ;
@@ -221,14 +219,14 @@ mod test {
221
219
use core:: str;
222
220
223
221
#[ test]
224
- fn test_rpaths_to_flags ( ) {
222
+ pub fn test_rpaths_to_flags ( ) {
225
223
let flags = rpaths_to_flags ( ~[ Path ( "path1" ) ,
226
224
Path ( "path2" ) ] ) ;
227
225
assert flags == ~[ ~"-Wl , -rpath, path1", ~"-Wl , -rpath, path2"] ;
228
226
}
229
227
230
228
#[ test]
231
- fn test_prefix_rpath ( ) {
229
+ pub fn test_prefix_rpath ( ) {
232
230
let res = get_install_prefix_rpath ( "triple" ) ;
233
231
let d = Path ( env ! ( "CFG_PREFIX" ) )
234
232
. push_rel ( & Path ( "lib/rustc/triple/lib" ) ) ;
@@ -239,21 +237,21 @@ mod test {
239
237
}
240
238
241
239
#[ test]
242
- fn test_prefix_rpath_abs ( ) {
240
+ pub fn test_prefix_rpath_abs ( ) {
243
241
let res = get_install_prefix_rpath ( "triple" ) ;
244
242
assert res. is_absolute ;
245
243
}
246
244
247
245
#[ test]
248
- fn test_minimize1 ( ) {
246
+ pub fn test_minimize1 ( ) {
249
247
let res = minimize_rpaths ( [ Path ( "rpath1" ) ,
250
248
Path ( "rpath2" ) ,
251
249
Path ( "rpath1" ) ] ) ;
252
250
assert res == ~[ Path ( "rpath1" ) , Path ( "rpath2" ) ] ;
253
251
}
254
252
255
253
#[ test]
256
- fn test_minimize2 ( ) {
254
+ pub fn test_minimize2 ( ) {
257
255
let res = minimize_rpaths ( ~[ Path ( "1a" ) , Path ( "2" ) , Path ( "2" ) ,
258
256
Path ( "1a" ) , Path ( "4a" ) , Path ( "1a" ) ,
259
257
Path ( "2" ) , Path ( "3" ) , Path ( "4a" ) ,
@@ -262,63 +260,63 @@ mod test {
262
260
}
263
261
264
262
#[ test]
265
- fn test_relative_to1 ( ) {
263
+ pub fn test_relative_to1 ( ) {
266
264
let p1 = Path ( "/usr/bin/rustc" ) ;
267
265
let p2 = Path ( "/usr/lib/mylib" ) ;
268
266
let res = get_relative_to ( & p1, & p2) ;
269
267
assert res == Path ( "../lib" ) ;
270
268
}
271
269
272
270
#[ test]
273
- fn test_relative_to2 ( ) {
271
+ pub fn test_relative_to2 ( ) {
274
272
let p1 = Path ( "/usr/bin/rustc" ) ;
275
273
let p2 = Path ( "/usr/bin/../lib/mylib" ) ;
276
274
let res = get_relative_to ( & p1, & p2) ;
277
275
assert res == Path ( "../lib" ) ;
278
276
}
279
277
280
278
#[ test]
281
- fn test_relative_to3 ( ) {
279
+ pub fn test_relative_to3 ( ) {
282
280
let p1 = Path ( "/usr/bin/whatever/rustc" ) ;
283
281
let p2 = Path ( "/usr/lib/whatever/mylib" ) ;
284
282
let res = get_relative_to ( & p1, & p2) ;
285
283
assert res == Path ( "../../lib/whatever" ) ;
286
284
}
287
285
288
286
#[ test]
289
- fn test_relative_to4 ( ) {
287
+ pub fn test_relative_to4 ( ) {
290
288
let p1 = Path ( "/usr/bin/whatever/../rustc" ) ;
291
289
let p2 = Path ( "/usr/lib/whatever/mylib" ) ;
292
290
let res = get_relative_to ( & p1, & p2) ;
293
291
assert res == Path ( "../lib/whatever" ) ;
294
292
}
295
293
296
294
#[ test]
297
- fn test_relative_to5 ( ) {
295
+ pub fn test_relative_to5 ( ) {
298
296
let p1 = Path ( "/usr/bin/whatever/../rustc" ) ;
299
297
let p2 = Path ( "/usr/lib/whatever/../mylib" ) ;
300
298
let res = get_relative_to ( & p1, & p2) ;
301
299
assert res == Path ( "../lib" ) ;
302
300
}
303
301
304
302
#[ test]
305
- fn test_relative_to6 ( ) {
303
+ pub fn test_relative_to6 ( ) {
306
304
let p1 = Path ( "/1" ) ;
307
305
let p2 = Path ( "/2/3" ) ;
308
306
let res = get_relative_to ( & p1, & p2) ;
309
307
assert res == Path ( "2" ) ;
310
308
}
311
309
312
310
#[ test]
313
- fn test_relative_to7 ( ) {
311
+ pub fn test_relative_to7 ( ) {
314
312
let p1 = Path ( "/1/2" ) ;
315
313
let p2 = Path ( "/3" ) ;
316
314
let res = get_relative_to ( & p1, & p2) ;
317
315
assert res == Path ( ".." ) ;
318
316
}
319
317
320
318
#[ test]
321
- fn test_relative_to8 ( ) {
319
+ pub fn test_relative_to8 ( ) {
322
320
let p1 = Path ( "/home/brian/Dev/rust/build/" ) . push_rel (
323
321
& Path ( "stage2/lib/rustc/i686-unknown-linux-gnu/lib/librustc.so" ) ) ;
324
322
let p2 = Path ( "/home/brian/Dev/rust/build/stage2/bin/.." ) . push_rel (
@@ -333,7 +331,7 @@ mod test {
333
331
#[ test]
334
332
#[ cfg( target_os = "linux" ) ]
335
333
#[ cfg( target_os = "andorid" ) ]
336
- fn test_rpath_relative ( ) {
334
+ pub fn test_rpath_relative ( ) {
337
335
let o = session:: os_linux;
338
336
let res = get_rpath_relative_to_output ( o,
339
337
& Path ( "bin/rustc" ) , & Path ( "lib/libstd.so" ) ) ;
@@ -342,7 +340,7 @@ mod test {
342
340
343
341
#[ test]
344
342
#[ cfg( target_os = "freebsd" ) ]
345
- fn test_rpath_relative ( ) {
343
+ pub fn test_rpath_relative ( ) {
346
344
let o = session:: os_freebsd;
347
345
let res = get_rpath_relative_to_output ( o,
348
346
& Path ( "bin/rustc" ) , & Path ( "lib/libstd.so" ) ) ;
@@ -351,7 +349,7 @@ mod test {
351
349
352
350
#[ test]
353
351
#[ cfg( target_os = "macos" ) ]
354
- fn test_rpath_relative ( ) {
352
+ pub fn test_rpath_relative ( ) {
355
353
// this is why refinements would be nice
356
354
let o = session:: os_macos;
357
355
let res = get_rpath_relative_to_output ( o,
@@ -361,7 +359,7 @@ mod test {
361
359
}
362
360
363
361
#[ test]
364
- fn test_get_absolute_rpath ( ) {
362
+ pub fn test_get_absolute_rpath ( ) {
365
363
let res = get_absolute_rpath ( & Path ( "lib/libstd.so" ) ) ;
366
364
debug ! ( "test_get_absolute_rpath: %s vs. %s" ,
367
365
res. to_str( ) ,
0 commit comments