File tree 1 file changed +24
-7
lines changed
src/LibObjectFile.Tests/Elf
1 file changed +24
-7
lines changed Original file line number Diff line number Diff line change @@ -18,24 +18,41 @@ public class ElfSimpleTests : ElfTestBase
18
18
public TestContext TestContext { get ; set ; }
19
19
20
20
[ DataTestMethod ]
21
+ [ Ignore ]
21
22
[ DynamicData ( nameof ( GetLinuxBins ) , DynamicDataSourceType . Method ) ]
22
23
public void TestLinuxFile ( string file )
23
24
{
25
+ if ( ! OperatingSystem . IsLinux ( ) )
26
+ {
27
+ Assert . Inconclusive ( "This test can only run on Linux" ) ;
28
+ return ;
29
+ }
30
+
24
31
using var stream = File . OpenRead ( file ) ;
25
32
if ( ! ElfFile . IsElf ( stream ) ) return ;
26
33
var elf = ElfFile . Read ( stream ) ;
27
- var writer = new StringWriter ( ) ;
28
- writer . WriteLine ( "---------------------------------------------------------------------------------------" ) ;
29
- writer . WriteLine ( $ "{ file } ") ;
30
- elf . Print ( writer ) ;
31
- writer . WriteLine ( ) ;
34
+
35
+ // TODO: check for errors
36
+
37
+ //var writer = new StringWriter();
38
+ //writer.WriteLine("---------------------------------------------------------------------------------------");
39
+ //writer.WriteLine($"{file}");
40
+ //elf.Print(writer);
41
+ //writer.WriteLine();
32
42
}
33
43
34
44
public static IEnumerable < object [ ] > GetLinuxBins ( )
35
45
{
36
- foreach ( var file in Directory . EnumerateFiles ( @"C:\code\LibObjectFile\tmp\linux_bins" ) )
46
+ if ( OperatingSystem . IsLinux ( ) )
47
+ {
48
+ foreach ( var file in Directory . EnumerateFiles ( @"/usr/bin" ) )
49
+ {
50
+ yield return new object [ ] { file } ;
51
+ }
52
+ }
53
+ else
37
54
{
38
- yield return new object [ ] { file } ;
55
+ yield return new object [ ] { string . Empty } ;
39
56
}
40
57
}
41
58
You can’t perform that action at this time.
0 commit comments