public void ShouldStripUserFramework(bool?strip, bool debugStrips, bool releaseStrips)
        {
            MMPTests.RunMMPTest(tmpDir =>
            {
                var frameworkPath         = FrameworkBuilder.CreateFatFramework(tmpDir);
                TI.UnifiedTestConfig test = CreateStripTestConfig(strip, tmpDir, $"--native-reference={frameworkPath}");

                StripTestCore(test, debugStrips, releaseStrips, "Contents/Frameworks/Foo.framework/Foo", shouldWarn: true);
            });
        }
Пример #2
0
        public void ThirdPartyLibrary_WithIncorrectBitness_ShouldWarnOnRelease(bool sixtyFourBits)
        {
            MMPTests.RunMMPTest(tmpDir =>
            {
                var frameworkPath = FrameworkBuilder.CreateFatFramework(tmpDir);

                TI.UnifiedTestConfig test = CreateStripTestConfig(null, tmpDir, $" --native-reference=\"{frameworkPath}\"");

                // Should always skip lipo/warning in Debug
                string buildOutput = TI.TestUnifiedExecutable(test).BuildOutput;
                AssertNoLipoOrWarning(buildOutput, "Debug");

                // Should always lipo/warn in Release
                test.Release = true;
                buildOutput  = TI.TestUnifiedExecutable(test).BuildOutput;
                Assert.True(DidAnyLipoStrip(buildOutput), $"lipo did not run in release");
                Assert.True(buildOutput.Contains("MM2108"), $"MM2108 not given in release");
            });
        }
        public void ThirdPartyLibrary_WithIncorrectBitness_ShouldWarnOnRelease(bool sixtyFourBits)
        {
            MMPTests.RunMMPTest(tmpDir =>
            {
                var frameworkPath = FrameworkBuilder.CreateFatFramework(tmpDir);

                TI.UnifiedTestConfig test = CreateStripTestConfig(null, tmpDir, $" --native-reference=\"{frameworkPath}\"");

                // Should always skip lipo/warning in Debug
                var testResult = TI.TestUnifiedExecutable(test);
                AssertNoLipoOrWarning(testResult.BuildResult, "Debug");

                // Should always lipo/warn in Release
                test.Release = true;
                testResult   = TI.TestUnifiedExecutable(test);
                Assert.True(DidAnyLipoStrip(testResult.BuildResult), $"lipo did not run in release");
                testResult.BuildResult.Messages.AssertError(2108, $"{frameworkPath} was stripped of architectures except x86_64 to comply with App Store restrictions. This could break existing codesigning signatures. Consider stripping the library with lipo or disabling with --optimize=-trim-architectures");
                // Assert.True (testResult.Contains ("MM2108"), $"MM2108 not given in release");
            });
        }