2016-05-26 16:06:52 +03:00
|
|
|
// Copyright 2012 Xamarin Inc. All rights reserved.
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.IO;
|
|
|
|
using System.IO.Compression;
|
|
|
|
using System.Reflection;
|
2019-07-08 18:21:38 +03:00
|
|
|
using Foundation;
|
|
|
|
using AppKit;
|
|
|
|
using ObjCRuntime;
|
2016-05-26 16:06:52 +03:00
|
|
|
|
|
|
|
// Test
|
|
|
|
// * application does not reference assembly Mono.Posix.dll
|
|
|
|
// * application call method which pinvoke into libMonoPosixHelper.dylib
|
|
|
|
// * linker includes libMonoPosixHelper.dylib in the application bundle
|
|
|
|
//
|
|
|
|
// Requirement
|
|
|
|
// * Link SDK or Link All must be enabled
|
|
|
|
|
|
|
|
namespace Xamarin.Mac.Linker.Test {
|
2022-12-05 10:23:34 +03:00
|
|
|
|
2016-05-26 16:06:52 +03:00
|
|
|
class Posix1 {
|
|
|
|
|
2022-12-05 10:23:34 +03:00
|
|
|
static void Main (string [] args)
|
2016-05-26 16:06:52 +03:00
|
|
|
{
|
|
|
|
NSApplication.Init ();
|
2022-12-05 10:23:34 +03:00
|
|
|
|
2016-05-26 16:06:52 +03:00
|
|
|
Test.EnsureLinker (true);
|
2022-12-05 10:23:34 +03:00
|
|
|
|
2016-05-26 16:06:52 +03:00
|
|
|
bool gzip = false;
|
|
|
|
try {
|
|
|
|
GZipStream gz = new GZipStream (Stream.Null, CompressionMode.Compress);
|
|
|
|
gz.WriteByte (0);
|
|
|
|
gz.Close ();
|
|
|
|
gzip = true;
|
2022-12-05 10:23:34 +03:00
|
|
|
} catch {
|
2016-05-26 16:06:52 +03:00
|
|
|
}
|
|
|
|
Test.Log.WriteLine ("{0}\t{1}", gzip ? "[PASS]" : "[FAIL]", "GZipStream support");
|
|
|
|
|
|
|
|
string path = Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location);
|
|
|
|
bool bundled = File.Exists (Path.Combine (path, "libMonoPosixHelper.dylib"));
|
|
|
|
Test.Log.WriteLine ("{0}\t{1}", bundled ? "[PASS]" : "[FAIL]", "MonoPosixHelper present in bundle");
|
|
|
|
|
|
|
|
Test.Terminate ();
|
|
|
|
}
|
|
|
|
}
|
2019-07-08 18:21:38 +03:00
|
|
|
}
|