Merge mozilla-central to autoland

This commit is contained in:
Dorel Luca 2018-04-03 07:22:33 +03:00
commit baf0da3fea
27 changed files with 457 additions and 475 deletions

View File

@ -59,6 +59,13 @@ const TELEMETRY_REPORTED_PATTERNS = new Set([
/^chrome:\/\/(?:global|browser|devtools)/,
]);
// Mapping of regexes to sample rates; if the regex matches the module an error
// is thrown from, the matching sample rate is used instead of the default.
// In case of a conflict, the first matching rate by insertion order is used.
const MODULE_SAMPLE_RATES = new Map([
[/^(?:chrome|resource):\/\/devtools/, 1],
]);
/**
* Collects nsIScriptError messages logged to the browser console and reports
* them to a remotely-hosted error collection service.
@ -212,7 +219,13 @@ class BrowserErrorReporter {
}
// Sample the amount of errors we send out
const sampleRate = Number.parseFloat(this.sampleRatePref);
let sampleRate = Number.parseFloat(this.sampleRatePref);
for (const [regex, rate] of MODULE_SAMPLE_RATES) {
if (message.sourceName.match(regex)) {
sampleRate = rate;
break;
}
}
if (!Number.isFinite(sampleRate) || (Math.random() >= sampleRate)) {
return;
}

View File

@ -27,7 +27,7 @@ function createScriptError(options = {}) {
const scriptError = Cc["@mozilla.org/scripterror;1"].createInstance(Ci.nsIScriptError);
scriptError.init(
options.message || "",
options.sourceName || null,
"sourceName" in options ? options.sourceName : null,
options.sourceLine || null,
options.lineNumber || null,
options.columnNumber || null,
@ -210,6 +210,12 @@ add_task(async function testSampling() {
"A 1.0 sample rate will cause the reporter to always collect errors.",
);
await reporter.observe(createScriptError({message: "undefined", sourceName: undefined}));
ok(
fetchPassedError(fetchSpy, "undefined"),
"A missing sourceName doesn't break reporting.",
);
await SpecialPowers.pushPrefEnv({set: [
[PREF_SAMPLE_RATE, "0.0"],
]});
@ -219,6 +225,24 @@ add_task(async function testSampling() {
"A 0.0 sample rate will cause the reporter to never collect errors.",
);
await reporter.observe(createScriptError({
message: "chromedevtools",
sourceName: "chrome://devtools/Foo.jsm",
}));
ok(
fetchPassedError(fetchSpy, "chromedevtools"),
"chrome://devtools/ paths are sampled at 100% even if the default rate is 0.0.",
);
await reporter.observe(createScriptError({
message: "resourcedevtools",
sourceName: "resource://devtools/Foo.jsm",
}));
ok(
fetchPassedError(fetchSpy, "resourcedevtools"),
"resource://devtools/ paths are sampled at 100% even if the default rate is 0.0.",
);
await SpecialPowers.pushPrefEnv({set: [
[PREF_SAMPLE_RATE, ")fasdf"],
]});

View File

@ -491,7 +491,6 @@ def check_compiler(compiler, language, target):
# Note: MSVC, while supporting C++14, still reports 199711L for __cplusplus.
# Note: this is a strict version check because we used to always add
# -std=gnu++14.
draft_cxx14_version = 201300
cxx14_version = 201402
if info.language == 'C++':
if info.type == 'clang' and info.language_version != cxx14_version:
@ -500,12 +499,6 @@ def check_compiler(compiler, language, target):
# with appropriate checks.
elif info.type == 'clang-cl' and info.language_version != cxx14_version:
append_flag('-std=c++14')
# GCC 4.9 indicates that it implements draft C++14 features
# instead of the full language.
elif info.type == 'gcc' and \
info.language_version not in (draft_cxx14_version,
cxx14_version):
append_flag('-std=gnu++14')
# We force clang-cl to emulate Visual C++ 2017 version 15.6.0
msvc_version = '19.13.26128'
@ -904,14 +897,14 @@ def compiler(language, host_or_target, c_compiler=None, other_compiler=None,
# Check the compiler version here instead of in `compiler_version` so
# that the `checking` message doesn't pretend the compiler can be used
# to then bail out one line later.
if info.type == 'gcc' and info.version < '4.9.0':
raise FatalCheckError(
'Only GCC 4.9 or newer is supported (found version %s).'
% info.version)
if info.type == 'gcc' and host_or_target.os == 'Android':
raise FatalCheckError('GCC is not supported on Android.\n'
'Please use clang from the Android NDK instead.')
if info.type == 'gcc':
if host_or_target.os == 'Android':
raise FatalCheckError('GCC is not supported on Android.\n'
'Please use clang from the Android NDK instead.')
if info.version < '6.1.0':
raise FatalCheckError(
'Only GCC 6.1 or newer is supported (found version %s).'
% info.version)
# If you want to bump the version check here search for
# cxx_alignof above, and see the associated comment.
@ -1139,7 +1132,7 @@ def color_cflags(info):
# value changes to e.g. "<x>=always", exact string match may fail and
# multiple color flags could be added. So examine downstream consumers
# before adding flags to return values.
if info.type == 'gcc' and info.version >= '4.9.0':
if info.type == 'gcc':
return '-fdiagnostics-color'
elif info.type == 'clang':
return '-fcolor-diagnostics'

View File

@ -4,13 +4,13 @@
"use strict";
const { createFactory, PureComponent } = require("devtools/client/shared/vendor/react");
const { Component, createFactory } = require("devtools/client/shared/vendor/react");
const dom = require("devtools/client/shared/vendor/react-dom-factories");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const AnimatedPropertyItem = createFactory(require("./AnimatedPropertyItem"));
class AnimatedPropertyList extends PureComponent {
class AnimatedPropertyList extends Component {
static get propTypes() {
return {
animation: PropTypes.object.isRequired,

View File

@ -5,14 +5,14 @@
"use strict";
const { connect } = require("devtools/client/shared/vendor/react-redux");
const { createFactory, PureComponent } = require("devtools/client/shared/vendor/react");
const { Component, createFactory } = require("devtools/client/shared/vendor/react");
const dom = require("devtools/client/shared/vendor/react-dom-factories");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const AnimationTarget = createFactory(require("./AnimationTarget"));
const SummaryGraph = createFactory(require("./graph/SummaryGraph"));
class AnimationItem extends PureComponent {
class AnimationItem extends Component {
static get propTypes() {
return {
animation: PropTypes.object.isRequired,

View File

@ -4,7 +4,7 @@
"use strict";
const { PureComponent } = require("devtools/client/shared/vendor/react");
const { Component } = require("devtools/client/shared/vendor/react");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const dom = require("devtools/client/shared/vendor/react-dom-factories");
const { translateNodeFrontToGrip } = require("devtools/client/inspector/shared/utils");
@ -13,7 +13,7 @@ const { REPS, MODE } = require("devtools/client/shared/components/reps/reps");
const { Rep } = REPS;
const ElementNode = REPS.ElementNode;
class AnimationTarget extends PureComponent {
class AnimationTarget extends Component {
static get propTypes() {
return {
animation: PropTypes.object.isRequired,

View File

@ -4,8 +4,7 @@
"use strict";
const { createFactory, PureComponent } =
require("devtools/client/shared/vendor/react");
const { Component, createFactory } = require("devtools/client/shared/vendor/react");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const dom = require("devtools/client/shared/vendor/react-dom-factories");
const { connect } = require("devtools/client/shared/vendor/react-redux");
@ -18,7 +17,7 @@ const { findOptimalTimeInterval } = require("../utils/utils");
// The minimum spacing between 2 time graduation headers in the timeline (px).
const TIME_GRADUATION_MIN_SPACING = 40;
class AnimationTimelineTickList extends PureComponent {
class AnimationTimelineTickList extends Component {
static get propTypes() {
return {
sidebarWidth: PropTypes.number.isRequired,

View File

@ -4,7 +4,7 @@
"use strict";
const { createFactory, PureComponent } = require("devtools/client/shared/vendor/react");
const { Component, createFactory } = require("devtools/client/shared/vendor/react");
const dom = require("devtools/client/shared/vendor/react-dom-factories");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const { connect } = require("devtools/client/shared/vendor/react-redux");
@ -15,7 +15,7 @@ const AnimationToolbar = createFactory(require("./AnimationToolbar"));
const NoAnimationPanel = createFactory(require("./NoAnimationPanel"));
const SplitBox = createFactory(require("devtools/client/shared/components/splitter/SplitBox"));
class App extends PureComponent {
class App extends Component {
static get propTypes() {
return {
addAnimationsCurrentTimeListener: PropTypes.func.isRequired,

View File

@ -4,7 +4,7 @@
"use strict";
const { PureComponent } = require("devtools/client/shared/vendor/react");
const { Component } = require("devtools/client/shared/vendor/react");
const dom = require("devtools/client/shared/vendor/react-dom-factories");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const { connect } = require("devtools/client/shared/vendor/react-redux");
@ -13,7 +13,7 @@ const { LocalizationHelper } = require("devtools/shared/l10n");
const L10N =
new LocalizationHelper("devtools/client/locales/animationinspector.properties");
class NoAnimationPanel extends PureComponent {
class NoAnimationPanel extends Component {
static get propTypes() {
return {
elementPickerEnabled: PropTypes.bool.isRequired,

View File

@ -4,7 +4,7 @@
"use strict";
const { createFactory, PureComponent } = require("devtools/client/shared/vendor/react");
const { Component, createFactory } = require("devtools/client/shared/vendor/react");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const dom = require("devtools/client/shared/vendor/react-dom-factories");
const ReactDOM = require("devtools/client/shared/vendor/react-dom");
@ -18,7 +18,7 @@ const { DEFAULT_GRAPH_HEIGHT } = require("../../utils/graph-helper");
// Minimum opacity for semitransparent fill color for keyframes's easing graph.
const MIN_KEYFRAMES_EASING_OPACITY = 0.5;
class SummaryGraphPath extends PureComponent {
class SummaryGraphPath extends Component {
static get propTypes() {
return {
animation: PropTypes.object.isRequired,

View File

@ -10,14 +10,14 @@ add_task(async function() {
const { inspector, panel } = await openAnimationInspector();
info("Checking the path for different time scale");
await selectNodeAndWaitForAnimations(".no-compositor", inspector);
await selectNodeAndWaitForAnimations(".animated", inspector);
const pathStringA = panel.querySelector(".animation-iteration-path").getAttribute("d");
info("Select animation which has different time scale from no-compositor");
await selectNodeAndWaitForAnimations(".endDelayed", inspector);
await selectNodeAndWaitForAnimations("#endDelayed", inspector);
info("Select no-compositor again");
await selectNodeAndWaitForAnimations(".no-compositor", inspector);
await selectNodeAndWaitForAnimations(".animated", inspector);
const pathStringB = panel.querySelector(".animation-iteration-path").getAttribute("d");
is(pathStringA, pathStringB, "Path string should be same even change the time scale");
});

View File

@ -15,10 +15,14 @@ const TAB_NAME = "newanimationinspector";
const ANIMATION_L10N =
new LocalizationHelper("devtools/client/locales/animationinspector.properties");
// Enable new animation inspector.
Services.prefs.setBoolPref("devtools.new-animationinspector.enabled", true);
// Auto clean-up when a test ends.
// Clean-up all prefs that might have been changed during a test run
// (safer here because if the test fails, then the pref is never reverted)
registerCleanupFunction(() => {
Services.prefs.clearUserPref("devtools.new-animationinspector.enabled");
Services.prefs.clearUserPref("devtools.toolsidebar-width.inspector");
});

View File

@ -53,20 +53,15 @@ add_task(async function() {
await onShown;
info("event tooltip for the second div is shown");
info("Click on the animation inspector tab");
info("Click on the computed view tab");
let onHighlighterHidden = toolbox.once("node-unhighlight");
let onTabInspectorSelected = inspector.sidebar.once("newanimationinspector-selected");
let onInspectorUpdated = inspector.once("inspector-updated");
let animationInspectorTab =
inspector.panelDoc.querySelector("#newanimationinspector-tab");
EventUtils.synthesizeMouseAtCenter(animationInspectorTab, {},
let onTabComputedViewSelected = inspector.sidebar.once("computedview-selected");
let computedViewTab = inspector.panelDoc.querySelector("#computedview-tab");
EventUtils.synthesizeMouseAtCenter(computedViewTab, {},
inspector.panelDoc.defaultView);
await onTabInspectorSelected;
info("animation inspector was selected");
await onInspectorUpdated;
info("animation inspector was updated");
await onTabComputedViewSelected;
info("computed view was selected");
await onHighlighterHidden;
info("box model highlighter hidden after moving the mouse out of the markup view");

View File

@ -642,10 +642,19 @@ void SkScalerContext_CairoFT::generateMetrics(SkGlyph* glyph)
prepareGlyph(face->glyph);
if (fRec.fFlags & SkScalerContext::kVertical_Flag) {
glyph->fAdvanceX = -SkFDot6ToFloat(face->glyph->advance.x);
glyph->fAdvanceY = SkFDot6ToFloat(face->glyph->advance.y);
} else {
glyph->fAdvanceX = SkFDot6ToFloat(face->glyph->advance.x);
glyph->fAdvanceY = -SkFDot6ToFloat(face->glyph->advance.y);
}
SkIRect bounds;
switch (face->glyph->format) {
case FT_GLYPH_FORMAT_OUTLINE:
if (!face->glyph->outline.n_contours) {
break;
return;
}
FT_BBox bbox;
@ -654,10 +663,10 @@ void SkScalerContext_CairoFT::generateMetrics(SkGlyph* glyph)
bbox.yMin &= ~63;
bbox.xMax = (bbox.xMax + 63) & ~63;
bbox.yMax = (bbox.yMax + 63) & ~63;
glyph->fWidth = SkToU16(SkFDot6Floor(bbox.xMax - bbox.xMin));
glyph->fHeight = SkToU16(SkFDot6Floor(bbox.yMax - bbox.yMin));
glyph->fTop = -SkToS16(SkFDot6Floor(bbox.yMax));
glyph->fLeft = SkToS16(SkFDot6Floor(bbox.xMin));
bounds = SkIRect::MakeLTRB(SkFDot6Floor(bbox.xMin),
-SkFDot6Floor(bbox.yMax),
SkFDot6Floor(bbox.xMax),
-SkFDot6Floor(bbox.yMin));
if (isLCD(fRec)) {
// In FreeType < 2.8.1, LCD filtering, if explicitly used, may
@ -669,11 +678,9 @@ void SkScalerContext_CairoFT::generateMetrics(SkGlyph* glyph)
// here. generateGlyphImage will detect if the mask is smaller
// than the bounds and clip things appropriately.
if (fRec.fFlags & kLCD_Vertical_Flag) {
glyph->fTop -= 1;
glyph->fHeight += 2;
bounds.outset(0, 1);
} else {
glyph->fLeft -= 1;
glyph->fWidth += 2;
bounds.outset(1, 0);
}
}
break;
@ -702,15 +709,15 @@ void SkScalerContext_CairoFT::generateMetrics(SkGlyph* glyph)
SkRect destRect;
fShapeMatrix.mapRect(&destRect, srcRect);
SkIRect glyphRect = destRect.roundOut();
glyph->fWidth = SkToU16(glyphRect.width());
glyph->fHeight = SkToU16(glyphRect.height());
glyph->fTop = SkToS16(SkScalarRoundToInt(destRect.fTop));
glyph->fLeft = SkToS16(SkScalarRoundToInt(destRect.fLeft));
bounds = SkIRect::MakeXYWH(SkScalarRoundToInt(destRect.fLeft),
SkScalarRoundToInt(destRect.fTop),
glyphRect.width(),
glyphRect.height());
} else {
glyph->fWidth = SkToU16(face->glyph->bitmap.width);
glyph->fHeight = SkToU16(face->glyph->bitmap.rows);
glyph->fTop = -SkToS16(face->glyph->bitmap_top);
glyph->fLeft = SkToS16(face->glyph->bitmap_left);
bounds = SkIRect::MakeXYWH(face->glyph->bitmap_left,
-face->glyph->bitmap_top,
face->glyph->bitmap.width,
face->glyph->bitmap.rows);
}
break;
default:
@ -718,12 +725,11 @@ void SkScalerContext_CairoFT::generateMetrics(SkGlyph* glyph)
return;
}
if (fRec.fFlags & SkScalerContext::kVertical_Flag) {
glyph->fAdvanceX = -SkFDot6ToFloat(face->glyph->advance.x);
glyph->fAdvanceY = SkFDot6ToFloat(face->glyph->advance.y);
} else {
glyph->fAdvanceX = SkFDot6ToFloat(face->glyph->advance.x);
glyph->fAdvanceY = -SkFDot6ToFloat(face->glyph->advance.y);
if (SkIRect::MakeXYWH(SHRT_MIN, SHRT_MIN, USHRT_MAX, USHRT_MAX).contains(bounds)) {
glyph->fWidth = SkToU16(bounds.width());
glyph->fHeight = SkToU16(bounds.height());
glyph->fLeft = SkToS16(bounds.left());
glyph->fTop = SkToS16(bounds.top());
}
}

View File

@ -2998,12 +2998,16 @@ ScrollFrameHelper::ScrollToImpl(nsPoint aPt, const nsRect& aRange, nsAtom* aOrig
}
}
static int32_t
static Maybe<int32_t>
MaxZIndexInList(nsDisplayList* aList, nsDisplayListBuilder* aBuilder)
{
int32_t maxZIndex = -1;
Maybe<int32_t> maxZIndex = Nothing();
for (nsDisplayItem* item = aList->GetBottom(); item; item = item->GetAbove()) {
maxZIndex = std::max(maxZIndex, item->ZIndex());
if (!maxZIndex) {
maxZIndex = Some(item->ZIndex());
} else {
maxZIndex = Some(std::max(maxZIndex.value(), item->ZIndex()));
}
}
return maxZIndex;
}
@ -3012,10 +3016,10 @@ template<class T>
static void
AppendInternalItemToTop(const nsDisplayListSet& aLists,
T* aItem,
int32_t aZIndex)
const Maybe<int32_t>& aZIndex)
{
if (aZIndex >= 0) {
aItem->SetOverrideZIndex(aZIndex);
if (aZIndex) {
aItem->SetOverrideZIndex(aZIndex.value());
aLists.PositionedDescendants()->AppendToTop(aItem);
} else {
aLists.Content()->AppendToTop(aItem);
@ -3060,9 +3064,12 @@ AppendToTop(nsDisplayListBuilder* aBuilder, const nsDisplayListSet& aLists,
// We want overlay scrollbars to always be on top of the scrolled content,
// but we don't want them to unnecessarily cover overlapping elements from
// outside our scroll frame.
int32_t zIndex = -1;
Maybe<int32_t> zIndex = Nothing();
if (aFlags & APPEND_OVERLAY) {
zIndex = MaxZIndexInList(aLists.PositionedDescendants(), aBuilder);
} else if (aSourceFrame->StylePosition()->mZIndex.GetUnit() == eStyleUnit_Integer) {
zIndex = Some(aSourceFrame->StylePosition()->mZIndex.GetIntValue());
}
AppendInternalItemToTop(aLists, newItem, zIndex);
} else {
@ -3145,6 +3152,10 @@ ScrollFrameHelper::AppendScrollPartsTo(nsDisplayListBuilder* aBuilder,
flags |= nsDisplayOwnLayerFlags::eHorizontalScrollbar;
appendToTopFlags |= APPEND_SCROLLBAR_CONTAINER;
}
if (scrollParts[i] == mResizerBox &&
!HasResizer()) {
continue;
}
// The display port doesn't necessarily include the scrollbars, so just
// include all of the scrollbars if we are in a RCD-RSF. We only do
@ -3153,6 +3164,9 @@ ScrollFrameHelper::AppendScrollPartsTo(nsDisplayListBuilder* aBuilder,
nsRect visible = mIsRoot && mOuter->PresContext()->IsRootContentDocument()
? scrollParts[i]->GetVisualOverflowRectRelativeToParent()
: aBuilder->GetVisibleRect();
if (visible.IsEmpty()) {
continue;
}
nsRect dirty = mIsRoot && mOuter->PresContext()->IsRootContentDocument()
? scrollParts[i]->GetVisualOverflowRectRelativeToParent()
: aBuilder->GetDirtyRect();
@ -3182,8 +3196,10 @@ ScrollFrameHelper::AppendScrollPartsTo(nsDisplayListBuilder* aBuilder,
if (aPositioned) {
appendToTopFlags |= APPEND_POSITIONED;
}
if (overlayScrollbars) {
if (overlayScrollbars ||
scrollParts[i] == mResizerBox) {
appendToTopFlags |= APPEND_OVERLAY;
aBuilder->SetBuiltOverlayScrollbars(true);
}
{
@ -3328,15 +3344,6 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
}
}
// Adding overlay scrollbars requires us to look at the display list
// for the highest z-index item, which isn't possible during partial
// building. Mark the frame modified and do a full rebuild of this
// scrollframe.
if (LookAndFeel::GetInt(LookAndFeel::eIntID_UseOverlayScrollbars) &&
aBuilder->IsRetainingDisplayList()) {
aBuilder->MarkCurrentFrameModifiedDuringBuilding();
}
// It's safe to get this value before the DecideScrollableLayer call below
// because that call cannot create a displayport for root scroll frames,
// and hence it cannot create an ignore scroll frame.
@ -3705,13 +3712,13 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
nsDisplayCompositorHitTestInfo* hitInfo =
MakeDisplayItem<nsDisplayCompositorHitTestInfo>(aBuilder, mScrolledFrame, info, 1,
Some(mScrollPort + aBuilder->ToReferenceFrame(mOuter)));
AppendInternalItemToTop(scrolledContent, hitInfo, INT32_MAX);
AppendInternalItemToTop(scrolledContent, hitInfo, Some(INT32_MAX));
}
if (aBuilder->IsBuildingLayerEventRegions()) {
nsDisplayLayerEventRegions* inactiveRegionItem =
MakeDisplayItem<nsDisplayLayerEventRegions>(aBuilder, mScrolledFrame, 1);
inactiveRegionItem->AddInactiveScrollPort(mScrolledFrame, mScrollPort + aBuilder->ToReferenceFrame(mOuter));
AppendInternalItemToTop(scrolledContent, inactiveRegionItem, INT32_MAX);
AppendInternalItemToTop(scrolledContent, inactiveRegionItem, Some(INT32_MAX));
}
}

View File

@ -1003,7 +1003,8 @@ nsDisplayListBuilder::nsDisplayListBuilder(nsIFrame* aReferenceFrame,
mBuildingInvisibleItems(false),
mHitTestIsForVisibility(false),
mIsBuilding(false),
mInInvalidSubtree(false)
mInInvalidSubtree(false),
mBuiltOverlayScrollbars(false)
{
MOZ_COUNT_CTOR(nsDisplayListBuilder);

View File

@ -840,6 +840,9 @@ public:
*/
bool IsInSubdocument() { return mPresShellStates.Length() > 1; }
void SetBuiltOverlayScrollbars(bool aOverlayScrollbars) { mBuiltOverlayScrollbars = aOverlayScrollbars; }
bool BuiltOverlayScrollbars() { return mBuiltOverlayScrollbars; }
/**
* Return true if we're currently building a display list for the presshell
* of a chrome document, or if we're building the display list for a popup.
@ -2010,6 +2013,7 @@ private:
bool mInInvalidSubtree;
bool mBuildCompositorHitTestInfo;
bool mLessEventRegionItems;
bool mBuiltOverlayScrollbars;
};
class nsDisplayItem;

View File

@ -84,20 +84,22 @@ def GCC(version):
def GXX(version):
return GCC_BASE(version) + DEFAULT_CXX_97 + SUPPORTS_GNUXX11
SUPPORTS_DRAFT_CXX14_VERSION = {
'-std=gnu++14': DRAFT_CXX_14,
}
SUPPORTS_DRAFT_CXX14_VERSION = {
'-std=gnu++14': DRAFT_CXX_14,
}
GCC_4_7 = GCC('4.7.3')
GXX_4_7 = GXX('4.7.3')
GCC_4_9 = GCC('4.9.3')
GXX_4_9 = GXX('4.9.3') + SUPPORTS_DRAFT_CXX14_VERSION
GCC_5 = GCC('5.2.1') + DEFAULT_C11
GXX_5 = GXX('5.2.1') + SUPPORTS_GNUXX14
GCC_6 = GCC('6.4.0') + DEFAULT_C11
GXX_6 = GXX('6.4.0') + DEFAULT_CXX_14
GCC_7 = GCC('7.3.0') + DEFAULT_C11
GXX_7 = GXX('7.3.0') + DEFAULT_CXX_14
DEFAULT_GCC = GCC_6
DEFAULT_GXX = GXX_6
GCC_PLATFORM_LITTLE_ENDIAN = {
'__BYTE_ORDER__': 1234,
@ -192,6 +194,8 @@ CLANGXX_3_6 = CLANGXX('3.6.2') + {
'__has_feature(cxx_alignof)': '1',
},
}
DEFAULT_CLANG = CLANG_3_6
DEFAULT_CLANGXX = CLANGXX_3_6
def CLANG_PLATFORM(gcc_platform):
@ -413,52 +417,67 @@ class BaseToolchainTest(BaseConfigureTest):
'%s=%s' % (k, library_name_info[k]))
def old_gcc_message(old_ver):
return 'Only GCC 6.1 or newer is supported (found version {}).'.format(old_ver)
class LinuxToolchainTest(BaseToolchainTest):
PATHS = {
'/usr/bin/gcc': GCC_4_9 + GCC_PLATFORM_X86_64_LINUX,
'/usr/bin/g++': GXX_4_9 + GCC_PLATFORM_X86_64_LINUX,
'/usr/bin/gcc-4.7': GCC_4_7 + GCC_PLATFORM_X86_64_LINUX,
'/usr/bin/g++-4.7': GXX_4_7 + GCC_PLATFORM_X86_64_LINUX,
'/usr/bin/gcc': DEFAULT_GCC + GCC_PLATFORM_X86_64_LINUX,
'/usr/bin/g++': DEFAULT_GXX + GCC_PLATFORM_X86_64_LINUX,
'/usr/bin/gcc-4.9': GCC_4_9 + GCC_PLATFORM_X86_64_LINUX,
'/usr/bin/g++-4.9': GXX_4_9 + GCC_PLATFORM_X86_64_LINUX,
'/usr/bin/gcc-5': GCC_5 + GCC_PLATFORM_X86_64_LINUX,
'/usr/bin/g++-5': GXX_5 + GCC_PLATFORM_X86_64_LINUX,
'/usr/bin/clang': CLANG_3_6 + CLANG_PLATFORM_X86_64_LINUX,
'/usr/bin/clang++': CLANGXX_3_6 + CLANG_PLATFORM_X86_64_LINUX,
'/usr/bin/gcc-6': GCC_6 + GCC_PLATFORM_X86_64_LINUX,
'/usr/bin/g++-6': GXX_6 + GCC_PLATFORM_X86_64_LINUX,
'/usr/bin/gcc-7': GCC_7 + GCC_PLATFORM_X86_64_LINUX,
'/usr/bin/g++-7': GXX_7 + GCC_PLATFORM_X86_64_LINUX,
'/usr/bin/clang': DEFAULT_CLANG + CLANG_PLATFORM_X86_64_LINUX,
'/usr/bin/clang++': DEFAULT_CLANGXX + CLANG_PLATFORM_X86_64_LINUX,
'/usr/bin/clang-3.6': CLANG_3_6 + CLANG_PLATFORM_X86_64_LINUX,
'/usr/bin/clang++-3.6': CLANGXX_3_6 + CLANG_PLATFORM_X86_64_LINUX,
'/usr/bin/clang-3.3': CLANG_3_3 + CLANG_PLATFORM_X86_64_LINUX,
'/usr/bin/clang++-3.3': CLANGXX_3_3 + CLANG_PLATFORM_X86_64_LINUX,
}
GCC_4_7_RESULT = ('Only GCC 4.9 or newer is supported '
'(found version 4.7.3).')
GCC_4_7_RESULT = old_gcc_message('4.7.3')
GXX_4_7_RESULT = GCC_4_7_RESULT
GCC_4_9_RESULT = CompilerResult(
GCC_4_9_RESULT = old_gcc_message('4.9.3')
GXX_4_9_RESULT = GCC_4_9_RESULT
GCC_5_RESULT = old_gcc_message('5.2.1')
GXX_5_RESULT = GCC_5_RESULT
GCC_6_RESULT = CompilerResult(
flags=['-std=gnu99'],
version='4.9.3',
version='6.4.0',
type='gcc',
compiler='/usr/bin/gcc',
compiler='/usr/bin/gcc-6',
language='C',
)
GXX_4_9_RESULT = CompilerResult(
flags=['-std=gnu++14'],
version='4.9.3',
GXX_6_RESULT = CompilerResult(
flags=[],
version='6.4.0',
type='gcc',
compiler='/usr/bin/g++',
compiler='/usr/bin/g++-6',
language='C++',
)
GCC_5_RESULT = CompilerResult(
GCC_7_RESULT = CompilerResult(
flags=['-std=gnu99'],
version='5.2.1',
version='7.3.0',
type='gcc',
compiler='/usr/bin/gcc-5',
compiler='/usr/bin/gcc-7',
language='C',
)
GXX_5_RESULT = CompilerResult(
flags=['-std=gnu++14'],
version='5.2.1',
GXX_7_RESULT = CompilerResult(
flags=[],
version='7.3.0',
type='gcc',
compiler='/usr/bin/g++-5',
compiler='/usr/bin/g++-7',
language='C++',
)
DEFAULT_GCC_RESULT = GCC_6_RESULT + {'compiler': '/usr/bin/gcc'}
DEFAULT_GXX_RESULT = GXX_6_RESULT + {'compiler': '/usr/bin/g++'}
CLANG_3_3_RESULT = CompilerResult(
flags=[],
version='3.3.0',
@ -471,84 +490,86 @@ class LinuxToolchainTest(BaseToolchainTest):
flags=['-std=gnu99'],
version='3.6.2',
type='clang',
compiler='/usr/bin/clang',
compiler='/usr/bin/clang-3.6',
language='C',
)
CLANGXX_3_6_RESULT = CompilerResult(
flags=['-std=gnu++14'],
version='3.6.2',
type='clang',
compiler='/usr/bin/clang++',
compiler='/usr/bin/clang++-3.6',
language='C++',
)
DEFAULT_CLANG_RESULT = CLANG_3_6_RESULT + {'compiler': '/usr/bin/clang'}
DEFAULT_CLANGXX_RESULT = CLANGXX_3_6_RESULT + {'compiler': '/usr/bin/clang++'}
def test_gcc(self):
# We'll try gcc and clang, and find gcc first.
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.GCC_4_9_RESULT,
'cxx_compiler': self.GXX_4_9_RESULT,
'c_compiler': self.DEFAULT_GCC_RESULT,
'cxx_compiler': self.DEFAULT_GXX_RESULT,
})
def test_unsupported_gcc(self):
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.GCC_4_7_RESULT,
'c_compiler': self.GCC_4_9_RESULT,
}, environ={
'CC': 'gcc-4.7',
'CXX': 'g++-4.7',
'CC': 'gcc-4.9',
'CXX': 'g++-4.9',
})
# Maybe this should be reporting the mismatched version instead.
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.GCC_4_9_RESULT,
'cxx_compiler': self.GXX_4_7_RESULT,
'c_compiler': self.DEFAULT_GCC_RESULT,
'cxx_compiler': self.GXX_4_9_RESULT,
}, environ={
'CXX': 'g++-4.7',
'CXX': 'g++-4.9',
})
def test_overridden_gcc(self):
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.GCC_5_RESULT,
'cxx_compiler': self.GXX_5_RESULT,
'c_compiler': self.GCC_7_RESULT,
'cxx_compiler': self.GXX_7_RESULT,
}, environ={
'CC': 'gcc-5',
'CXX': 'g++-5',
'CC': 'gcc-7',
'CXX': 'g++-7',
})
def test_guess_cxx(self):
# When CXX is not set, we guess it from CC.
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.GCC_5_RESULT,
'cxx_compiler': self.GXX_5_RESULT,
'c_compiler': self.GCC_7_RESULT,
'cxx_compiler': self.GXX_7_RESULT,
}, environ={
'CC': 'gcc-5',
'CC': 'gcc-7',
})
def test_mismatched_gcc(self):
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.GCC_4_9_RESULT,
'c_compiler': self.DEFAULT_GCC_RESULT,
'cxx_compiler': (
'The target C compiler is version 4.9.3, while the target '
'C++ compiler is version 5.2.1. Need to use the same compiler '
'The target C compiler is version 6.4.0, while the target '
'C++ compiler is version 7.3.0. Need to use the same compiler '
'version.'),
}, environ={
'CXX': 'g++-5',
'CXX': 'g++-7',
})
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.GCC_4_9_RESULT,
'cxx_compiler': self.GXX_4_9_RESULT,
'host_c_compiler': self.GCC_4_9_RESULT,
'c_compiler': self.DEFAULT_GCC_RESULT,
'cxx_compiler': self.DEFAULT_GXX_RESULT,
'host_c_compiler': self.DEFAULT_GCC_RESULT,
'host_cxx_compiler': (
'The host C compiler is version 4.9.3, while the host '
'C++ compiler is version 5.2.1. Need to use the same compiler '
'The host C compiler is version 6.4.0, while the host '
'C++ compiler is version 7.3.0. Need to use the same compiler '
'version.'),
}, environ={
'HOST_CXX': 'g++-5',
'HOST_CXX': 'g++-7',
})
def test_mismatched_compiler(self):
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.GCC_4_9_RESULT,
'c_compiler': self.DEFAULT_GCC_RESULT,
'cxx_compiler': (
'The target C compiler is gcc, while the target C++ compiler '
'is clang. Need to use the same compiler suite.'),
@ -557,9 +578,9 @@ class LinuxToolchainTest(BaseToolchainTest):
})
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.GCC_4_9_RESULT,
'cxx_compiler': self.GXX_4_9_RESULT,
'host_c_compiler': self.GCC_4_9_RESULT,
'c_compiler': self.DEFAULT_GCC_RESULT,
'cxx_compiler': self.DEFAULT_GXX_RESULT,
'host_c_compiler': self.DEFAULT_GCC_RESULT,
'host_cxx_compiler': (
'The host C compiler is gcc, while the host C++ compiler '
'is clang. Need to use the same compiler suite.'),
@ -575,7 +596,7 @@ class LinuxToolchainTest(BaseToolchainTest):
})
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.GCC_4_9_RESULT,
'c_compiler': self.DEFAULT_GCC_RESULT,
'cxx_compiler': '`%s` is not a C++ compiler.'
% mozpath.abspath('/usr/bin/gcc'),
}, environ={
@ -590,19 +611,15 @@ class LinuxToolchainTest(BaseToolchainTest):
if os.path.basename(k) not in ('gcc', 'g++')
}
self.do_toolchain_test(paths, {
'c_compiler': self.CLANG_3_6_RESULT,
'cxx_compiler': self.CLANGXX_3_6_RESULT,
'c_compiler': self.DEFAULT_CLANG_RESULT,
'cxx_compiler': self.DEFAULT_CLANGXX_RESULT,
})
def test_guess_cxx_clang(self):
# When CXX is not set, we guess it from CC.
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.CLANG_3_6_RESULT + {
'compiler': '/usr/bin/clang-3.6',
},
'cxx_compiler': self.CLANGXX_3_6_RESULT + {
'compiler': '/usr/bin/clang++-3.6',
},
'c_compiler': self.CLANG_3_6_RESULT,
'cxx_compiler': self.CLANGXX_3_6_RESULT,
}, environ={
'CC': 'clang-3.6',
})
@ -635,11 +652,11 @@ class LinuxToolchainTest(BaseToolchainTest):
'/opt/clang/bin/clang++': paths['/usr/bin/clang++'],
})
result = {
'c_compiler': self.CLANG_3_6_RESULT + {
'c_compiler': self.DEFAULT_CLANG_RESULT + {
'compiler': '/opt/clang/bin/clang',
},
'cxx_compiler': self.CLANGXX_3_6_RESULT + {
'compiler': '/opt/clang/bin/clang++'
'cxx_compiler': self.DEFAULT_CLANGXX_RESULT + {
'compiler': '/opt/clang/bin/clang++',
},
}
self.do_toolchain_test(paths, result, environ={
@ -658,10 +675,10 @@ class LinuxToolchainTest(BaseToolchainTest):
'/usr/bin/afl-clang-fast++': paths['/usr/bin/clang++'],
})
self.do_toolchain_test(paths, {
'c_compiler': self.CLANG_3_6_RESULT + {
'c_compiler': self.DEFAULT_CLANG_RESULT + {
'compiler': '/usr/bin/afl-clang-fast',
},
'cxx_compiler': self.CLANGXX_3_6_RESULT + {
'cxx_compiler': self.DEFAULT_CLANGXX_RESULT + {
'compiler': '/usr/bin/afl-clang-fast++',
},
}, environ={
@ -671,20 +688,20 @@ class LinuxToolchainTest(BaseToolchainTest):
def test_mixed_compilers(self):
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.CLANG_3_6_RESULT,
'cxx_compiler': self.CLANGXX_3_6_RESULT,
'host_c_compiler': self.GCC_4_9_RESULT,
'host_cxx_compiler': self.GXX_4_9_RESULT,
'c_compiler': self.DEFAULT_CLANG_RESULT,
'cxx_compiler': self.DEFAULT_CLANGXX_RESULT,
'host_c_compiler': self.DEFAULT_GCC_RESULT,
'host_cxx_compiler': self.DEFAULT_GXX_RESULT,
}, environ={
'CC': 'clang',
'HOST_CC': 'gcc',
})
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.CLANG_3_6_RESULT,
'cxx_compiler': self.CLANGXX_3_6_RESULT,
'host_c_compiler': self.GCC_4_9_RESULT,
'host_cxx_compiler': self.GXX_4_9_RESULT,
'c_compiler': self.DEFAULT_CLANG_RESULT,
'cxx_compiler': self.DEFAULT_CLANGXX_RESULT,
'host_c_compiler': self.DEFAULT_GCC_RESULT,
'host_cxx_compiler': self.DEFAULT_GXX_RESULT,
}, environ={
'CC': 'clang',
'CXX': 'clang++',
@ -695,33 +712,33 @@ class LinuxToolchainTest(BaseToolchainTest):
class LinuxSimpleCrossToolchainTest(BaseToolchainTest):
TARGET = 'i686-pc-linux-gnu'
PATHS = LinuxToolchainTest.PATHS
GCC_4_9_RESULT = LinuxToolchainTest.GCC_4_9_RESULT
GXX_4_9_RESULT = LinuxToolchainTest.GXX_4_9_RESULT
CLANG_3_6_RESULT = LinuxToolchainTest.CLANG_3_6_RESULT
CLANGXX_3_6_RESULT = LinuxToolchainTest.CLANGXX_3_6_RESULT
DEFAULT_GCC_RESULT = LinuxToolchainTest.DEFAULT_GCC_RESULT
DEFAULT_GXX_RESULT = LinuxToolchainTest.DEFAULT_GXX_RESULT
DEFAULT_CLANG_RESULT = LinuxToolchainTest.DEFAULT_CLANG_RESULT
DEFAULT_CLANGXX_RESULT = LinuxToolchainTest.DEFAULT_CLANGXX_RESULT
def test_cross_gcc(self):
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.GCC_4_9_RESULT + {
'c_compiler': self.DEFAULT_GCC_RESULT + {
'flags': ['-m32']
},
'cxx_compiler': self.GXX_4_9_RESULT + {
'cxx_compiler': self.DEFAULT_GXX_RESULT + {
'flags': ['-m32']
},
'host_c_compiler': self.GCC_4_9_RESULT,
'host_cxx_compiler': self.GXX_4_9_RESULT,
'host_c_compiler': self.DEFAULT_GCC_RESULT,
'host_cxx_compiler': self.DEFAULT_GXX_RESULT,
})
def test_cross_clang(self):
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.CLANG_3_6_RESULT + {
'c_compiler': self.DEFAULT_CLANG_RESULT + {
'flags': ['--target=i686-linux-gnu'],
},
'cxx_compiler': self.CLANGXX_3_6_RESULT + {
'cxx_compiler': self.DEFAULT_CLANGXX_RESULT + {
'flags': ['--target=i686-linux-gnu'],
},
'host_c_compiler': self.CLANG_3_6_RESULT,
'host_cxx_compiler': self.CLANGXX_3_6_RESULT,
'host_c_compiler': self.DEFAULT_CLANG_RESULT,
'host_cxx_compiler': self.DEFAULT_CLANGXX_RESULT,
}, environ={
'CC': 'clang',
})
@ -731,38 +748,38 @@ class LinuxX86_64CrossToolchainTest(BaseToolchainTest):
HOST = 'i686-pc-linux-gnu'
TARGET = 'x86_64-pc-linux-gnu'
PATHS = {
'/usr/bin/gcc': GCC_4_9 + GCC_PLATFORM_X86_LINUX,
'/usr/bin/g++': GXX_4_9 + GCC_PLATFORM_X86_LINUX,
'/usr/bin/clang': CLANG_3_6 + CLANG_PLATFORM_X86_LINUX,
'/usr/bin/clang++': CLANGXX_3_6 + CLANG_PLATFORM_X86_LINUX,
'/usr/bin/gcc': DEFAULT_GCC + GCC_PLATFORM_X86_LINUX,
'/usr/bin/g++': DEFAULT_GXX + GCC_PLATFORM_X86_LINUX,
'/usr/bin/clang': DEFAULT_CLANG + CLANG_PLATFORM_X86_LINUX,
'/usr/bin/clang++': DEFAULT_CLANGXX + CLANG_PLATFORM_X86_LINUX,
}
GCC_4_9_RESULT = LinuxToolchainTest.GCC_4_9_RESULT
GXX_4_9_RESULT = LinuxToolchainTest.GXX_4_9_RESULT
CLANG_3_6_RESULT = LinuxToolchainTest.CLANG_3_6_RESULT
CLANGXX_3_6_RESULT = LinuxToolchainTest.CLANGXX_3_6_RESULT
DEFAULT_GCC_RESULT = LinuxToolchainTest.DEFAULT_GCC_RESULT
DEFAULT_GXX_RESULT = LinuxToolchainTest.DEFAULT_GXX_RESULT
DEFAULT_CLANG_RESULT = LinuxToolchainTest.DEFAULT_CLANG_RESULT
DEFAULT_CLANGXX_RESULT = LinuxToolchainTest.DEFAULT_CLANGXX_RESULT
def test_cross_gcc(self):
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.GCC_4_9_RESULT + {
'c_compiler': self.DEFAULT_GCC_RESULT + {
'flags': ['-m64']
},
'cxx_compiler': self.GXX_4_9_RESULT + {
'cxx_compiler': self.DEFAULT_GXX_RESULT + {
'flags': ['-m64']
},
'host_c_compiler': self.GCC_4_9_RESULT,
'host_cxx_compiler': self.GXX_4_9_RESULT,
'host_c_compiler': self.DEFAULT_GCC_RESULT,
'host_cxx_compiler': self.DEFAULT_GXX_RESULT,
})
def test_cross_clang(self):
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.CLANG_3_6_RESULT + {
'c_compiler': self.DEFAULT_CLANG_RESULT + {
'flags': ['--target=x86_64-linux-gnu'],
},
'cxx_compiler': self.CLANGXX_3_6_RESULT + {
'cxx_compiler': self.DEFAULT_CLANGXX_RESULT + {
'flags': ['--target=x86_64-linux-gnu'],
},
'host_c_compiler': self.CLANG_3_6_RESULT,
'host_cxx_compiler': self.CLANGXX_3_6_RESULT,
'host_c_compiler': self.DEFAULT_CLANG_RESULT,
'host_cxx_compiler': self.DEFAULT_CLANGXX_RESULT,
}, environ={
'CC': 'clang',
})
@ -771,14 +788,12 @@ class LinuxX86_64CrossToolchainTest(BaseToolchainTest):
class OSXToolchainTest(BaseToolchainTest):
HOST = 'x86_64-apple-darwin11.2.0'
PATHS = {
'/usr/bin/gcc': GCC_4_9 + GCC_PLATFORM_X86_64_OSX,
'/usr/bin/g++': GXX_4_9 + GCC_PLATFORM_X86_64_OSX,
'/usr/bin/gcc-4.7': GCC_4_7 + GCC_PLATFORM_X86_64_OSX,
'/usr/bin/g++-4.7': GXX_4_7 + GCC_PLATFORM_X86_64_OSX,
'/usr/bin/gcc-5': GCC_5 + GCC_PLATFORM_X86_64_OSX,
'/usr/bin/g++-5': GXX_5 + GCC_PLATFORM_X86_64_OSX,
'/usr/bin/clang': CLANG_3_6 + CLANG_PLATFORM_X86_64_OSX,
'/usr/bin/clang++': CLANGXX_3_6 + CLANG_PLATFORM_X86_64_OSX,
'/usr/bin/gcc-7': GCC_7 + GCC_PLATFORM_X86_64_OSX,
'/usr/bin/g++-7': GXX_7 + GCC_PLATFORM_X86_64_OSX,
'/usr/bin/clang': DEFAULT_CLANG + CLANG_PLATFORM_X86_64_OSX,
'/usr/bin/clang++': DEFAULT_CLANGXX + CLANG_PLATFORM_X86_64_OSX,
'/usr/bin/clang-3.6': CLANG_3_6 + CLANG_PLATFORM_X86_64_OSX,
'/usr/bin/clang++-3.6': CLANGXX_3_6 + CLANG_PLATFORM_X86_64_OSX,
'/usr/bin/clang-3.3': CLANG_3_3 + CLANG_PLATFORM_X86_64_OSX,
@ -786,17 +801,18 @@ class OSXToolchainTest(BaseToolchainTest):
}
CLANG_3_3_RESULT = LinuxToolchainTest.CLANG_3_3_RESULT
CLANGXX_3_3_RESULT = LinuxToolchainTest.CLANGXX_3_3_RESULT
CLANG_3_6_RESULT = LinuxToolchainTest.CLANG_3_6_RESULT
CLANGXX_3_6_RESULT = LinuxToolchainTest.CLANGXX_3_6_RESULT
GCC_4_7_RESULT = LinuxToolchainTest.GCC_4_7_RESULT
DEFAULT_CLANG_RESULT = LinuxToolchainTest.DEFAULT_CLANG_RESULT
DEFAULT_CLANGXX_RESULT = LinuxToolchainTest.DEFAULT_CLANGXX_RESULT
GCC_5_RESULT = LinuxToolchainTest.GCC_5_RESULT
GXX_5_RESULT = LinuxToolchainTest.GXX_5_RESULT
GCC_7_RESULT = LinuxToolchainTest.GCC_7_RESULT
GXX_7_RESULT = LinuxToolchainTest.GXX_7_RESULT
def test_clang(self):
# We only try clang because gcc is known not to work.
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.CLANG_3_6_RESULT,
'cxx_compiler': self.CLANGXX_3_6_RESULT,
'c_compiler': self.DEFAULT_CLANG_RESULT,
'cxx_compiler': self.DEFAULT_CLANGXX_RESULT,
})
def test_not_gcc(self):
@ -822,19 +838,19 @@ class OSXToolchainTest(BaseToolchainTest):
def test_forced_gcc(self):
# GCC can still be forced if the user really wants it.
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.GCC_5_RESULT,
'cxx_compiler': self.GXX_5_RESULT,
'c_compiler': self.GCC_7_RESULT,
'cxx_compiler': self.GXX_7_RESULT,
}, environ={
'CC': 'gcc-5',
'CXX': 'g++-5',
'CC': 'gcc-7',
'CXX': 'g++-7',
})
def test_forced_unsupported_gcc(self):
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.GCC_4_7_RESULT,
'c_compiler': self.GCC_5_RESULT,
}, environ={
'CC': 'gcc-4.7',
'CXX': 'g++-4.7',
'CC': 'gcc-5',
'CXX': 'g++-5',
})
@ -853,14 +869,16 @@ class WindowsToolchainTest(BaseToolchainTest):
'/opt/VS_2017u4/bin/cl': VS_2017u4 + VS_PLATFORM_X86,
'/usr/bin/cl': VS_2017u6 + VS_PLATFORM_X86,
'/usr/bin/clang-cl': CLANG_CL_3_9 + CLANG_CL_PLATFORM_X86,
'/usr/bin/gcc': GCC_4_9 + GCC_PLATFORM_X86_WIN,
'/usr/bin/g++': GXX_4_9 + GCC_PLATFORM_X86_WIN,
'/usr/bin/gcc-4.7': GCC_4_7 + GCC_PLATFORM_X86_WIN,
'/usr/bin/g++-4.7': GXX_4_7 + GCC_PLATFORM_X86_WIN,
'/usr/bin/gcc': DEFAULT_GCC + GCC_PLATFORM_X86_WIN,
'/usr/bin/g++': DEFAULT_GXX + GCC_PLATFORM_X86_WIN,
'/usr/bin/gcc-4.9': GCC_4_9 + GCC_PLATFORM_X86_WIN,
'/usr/bin/g++-4.9': GXX_4_9 + GCC_PLATFORM_X86_WIN,
'/usr/bin/gcc-5': GCC_5 + GCC_PLATFORM_X86_WIN,
'/usr/bin/g++-5': GXX_5 + GCC_PLATFORM_X86_WIN,
'/usr/bin/clang': CLANG_3_6 + CLANG_PLATFORM_X86_WIN,
'/usr/bin/clang++': CLANGXX_3_6 + CLANG_PLATFORM_X86_WIN,
'/usr/bin/gcc-6': GCC_6 + GCC_PLATFORM_X86_WIN,
'/usr/bin/g++-6': GXX_6 + GCC_PLATFORM_X86_WIN,
'/usr/bin/clang': DEFAULT_CLANG + CLANG_PLATFORM_X86_WIN,
'/usr/bin/clang++': DEFAULT_CLANGXX + CLANG_PLATFORM_X86_WIN,
'/usr/bin/clang-3.6': CLANG_3_6 + CLANG_PLATFORM_X86_WIN,
'/usr/bin/clang++-3.6': CLANGXX_3_6 + CLANG_PLATFORM_X86_WIN,
'/usr/bin/clang-3.3': CLANG_3_3 + CLANG_PLATFORM_X86_WIN,
@ -927,25 +945,16 @@ class WindowsToolchainTest(BaseToolchainTest):
)
CLANG_3_3_RESULT = LinuxToolchainTest.CLANG_3_3_RESULT
CLANGXX_3_3_RESULT = LinuxToolchainTest.CLANGXX_3_3_RESULT
CLANG_3_6_RESULT = LinuxToolchainTest.CLANG_3_6_RESULT
CLANGXX_3_6_RESULT = LinuxToolchainTest.CLANGXX_3_6_RESULT
GCC_4_7_RESULT = LinuxToolchainTest.GCC_4_7_RESULT
DEFAULT_CLANG_RESULT = LinuxToolchainTest.DEFAULT_CLANG_RESULT
DEFAULT_CLANGXX_RESULT = LinuxToolchainTest.DEFAULT_CLANGXX_RESULT
GCC_4_9_RESULT = LinuxToolchainTest.GCC_4_9_RESULT
GXX_4_9_RESULT = CompilerResult(
flags=['-std=gnu++14'],
version='4.9.3',
type='gcc',
compiler='/usr/bin/g++',
language='C++',
)
GXX_4_9_RESULT = LinuxToolchainTest.GXX_4_9_RESULT
GCC_5_RESULT = LinuxToolchainTest.GCC_5_RESULT
GXX_5_RESULT = CompilerResult(
flags=['-std=gnu++14'],
version='5.2.1',
type='gcc',
compiler='/usr/bin/g++-5',
language='C++',
)
GXX_5_RESULT = LinuxToolchainTest.GXX_5_RESULT
GCC_6_RESULT = LinuxToolchainTest.GCC_6_RESULT
GXX_6_RESULT = LinuxToolchainTest.GXX_6_RESULT
DEFAULT_GCC_RESULT = LinuxToolchainTest.DEFAULT_GCC_RESULT
DEFAULT_GXX_RESULT = LinuxToolchainTest.DEFAULT_GXX_RESULT
# VS2017u6 or greater is required.
def test_msvc(self):
@ -1015,16 +1024,16 @@ class WindowsToolchainTest(BaseToolchainTest):
if os.path.basename(k) not in ('cl', 'clang-cl')
}
self.do_toolchain_test(paths, {
'c_compiler': self.GCC_4_9_RESULT,
'cxx_compiler': self.GXX_4_9_RESULT,
'c_compiler': self.DEFAULT_GCC_RESULT,
'cxx_compiler': self.DEFAULT_GXX_RESULT,
})
def test_overridden_unsupported_gcc(self):
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.GCC_4_7_RESULT,
'c_compiler': self.GCC_5_RESULT,
}, environ={
'CC': 'gcc-4.7',
'CXX': 'g++-4.7',
'CC': 'gcc-5',
'CXX': 'g++-5',
})
def test_clang(self):
@ -1034,8 +1043,8 @@ class WindowsToolchainTest(BaseToolchainTest):
if os.path.basename(k) not in ('cl', 'clang-cl', 'gcc')
}
self.do_toolchain_test(paths, {
'c_compiler': self.CLANG_3_6_RESULT,
'cxx_compiler': self.CLANGXX_3_6_RESULT,
'c_compiler': self.DEFAULT_CLANG_RESULT,
'cxx_compiler': self.DEFAULT_CLANGXX_RESULT,
})
def test_overridden_unsupported_clang(self):
@ -1073,14 +1082,18 @@ class Windows64ToolchainTest(WindowsToolchainTest):
'/opt/VS_2017u4/bin/cl': VS_2017u4 + VS_PLATFORM_X86_64,
'/usr/bin/cl': VS_2017u6 + VS_PLATFORM_X86_64,
'/usr/bin/clang-cl': CLANG_CL_3_9 + CLANG_CL_PLATFORM_X86_64,
'/usr/bin/gcc': GCC_4_9 + GCC_PLATFORM_X86_64_WIN,
'/usr/bin/g++': GXX_4_9 + GCC_PLATFORM_X86_64_WIN,
'/usr/bin/gcc-4.7': GCC_4_7 + GCC_PLATFORM_X86_64_WIN,
'/usr/bin/g++-4.7': GXX_4_7 + GCC_PLATFORM_X86_64_WIN,
'/usr/bin/gcc': DEFAULT_GCC + GCC_PLATFORM_X86_64_WIN,
'/usr/bin/g++': DEFAULT_GXX + GCC_PLATFORM_X86_64_WIN,
'/usr/bin/gcc-4.9': GCC_4_9 + GCC_PLATFORM_X86_64_WIN,
'/usr/bin/g++-4.9': GXX_4_9 + GCC_PLATFORM_X86_64_WIN,
'/usr/bin/gcc-5': GCC_5 + GCC_PLATFORM_X86_64_WIN,
'/usr/bin/g++-5': GXX_5 + GCC_PLATFORM_X86_64_WIN,
'/usr/bin/clang': CLANG_3_6 + CLANG_PLATFORM_X86_64_WIN,
'/usr/bin/clang++': CLANGXX_3_6 + CLANG_PLATFORM_X86_64_WIN,
'/usr/bin/gcc-6': GCC_6 + GCC_PLATFORM_X86_64_WIN,
'/usr/bin/g++-6': GXX_6 + GCC_PLATFORM_X86_64_WIN,
'/usr/bin/gcc-7': GCC_7 + GCC_PLATFORM_X86_64_WIN,
'/usr/bin/g++-7': GXX_7 + GCC_PLATFORM_X86_64_WIN,
'/usr/bin/clang': DEFAULT_CLANG + CLANG_PLATFORM_X86_64_WIN,
'/usr/bin/clang++': DEFAULT_CLANGXX + CLANG_PLATFORM_X86_64_WIN,
'/usr/bin/clang-3.6': CLANG_3_6 + CLANG_PLATFORM_X86_64_WIN,
'/usr/bin/clang++-3.6': CLANGXX_3_6 + CLANG_PLATFORM_X86_64_WIN,
'/usr/bin/clang-3.3': CLANG_3_3 + CLANG_PLATFORM_X86_64_WIN,
@ -1100,25 +1113,36 @@ class Windows64ToolchainTest(WindowsToolchainTest):
class LinuxCrossCompileToolchainTest(BaseToolchainTest):
TARGET = 'arm-unknown-linux-gnu'
PATHS = {
'/usr/bin/arm-linux-gnu-gcc': GCC_4_9 + GCC_PLATFORM_ARM_LINUX,
'/usr/bin/arm-linux-gnu-g++': GXX_4_9 + GCC_PLATFORM_ARM_LINUX,
'/usr/bin/arm-linux-gnu-gcc-4.7': GCC_4_7 + GCC_PLATFORM_ARM_LINUX,
'/usr/bin/arm-linux-gnu-g++-4.7': GXX_4_7 + GCC_PLATFORM_ARM_LINUX,
'/usr/bin/arm-linux-gnu-gcc-4.9': GCC_4_9 + GCC_PLATFORM_ARM_LINUX,
'/usr/bin/arm-linux-gnu-g++-4.9': GXX_4_9 + GCC_PLATFORM_ARM_LINUX,
'/usr/bin/arm-linux-gnu-gcc-5': GCC_5 + GCC_PLATFORM_ARM_LINUX,
'/usr/bin/arm-linux-gnu-g++-5': GXX_5 + GCC_PLATFORM_ARM_LINUX,
'/usr/bin/arm-linux-gnu-gcc': DEFAULT_GCC + GCC_PLATFORM_ARM_LINUX,
'/usr/bin/arm-linux-gnu-g++': DEFAULT_GXX + GCC_PLATFORM_ARM_LINUX,
'/usr/bin/arm-linux-gnu-gcc-7': GCC_7 + GCC_PLATFORM_ARM_LINUX,
'/usr/bin/arm-linux-gnu-g++-7': GXX_7 + GCC_PLATFORM_ARM_LINUX,
}
PATHS.update(LinuxToolchainTest.PATHS)
ARM_GCC_4_7_RESULT = LinuxToolchainTest.GXX_4_7_RESULT
ARM_GCC_5_RESULT = LinuxToolchainTest.GCC_5_RESULT + {
'compiler': '/usr/bin/arm-linux-gnu-gcc-5',
ARM_GCC_4_9_RESULT = LinuxToolchainTest.GCC_4_9_RESULT
ARM_GXX_4_9_RESULT = LinuxToolchainTest.GXX_4_9_RESULT
ARM_GCC_5_RESULT = LinuxToolchainTest.GCC_5_RESULT
ARM_GXX_5_RESULT = LinuxToolchainTest.GXX_5_RESULT
ARM_DEFAULT_GCC_RESULT = LinuxToolchainTest.DEFAULT_GCC_RESULT + {
'compiler': '/usr/bin/arm-linux-gnu-gcc',
}
ARM_GXX_5_RESULT = LinuxToolchainTest.GXX_5_RESULT + {
'compiler': '/usr/bin/arm-linux-gnu-g++-5',
ARM_DEFAULT_GXX_RESULT = LinuxToolchainTest.DEFAULT_GXX_RESULT + {
'compiler': '/usr/bin/arm-linux-gnu-g++',
}
CLANG_3_6_RESULT = LinuxToolchainTest.CLANG_3_6_RESULT
CLANGXX_3_6_RESULT = LinuxToolchainTest.CLANGXX_3_6_RESULT
GCC_4_9_RESULT = LinuxToolchainTest.GCC_4_9_RESULT
GXX_4_9_RESULT = LinuxToolchainTest.GXX_4_9_RESULT
ARM_GCC_7_RESULT = LinuxToolchainTest.GCC_7_RESULT + {
'compiler': '/usr/bin/arm-linux-gnu-gcc-7',
}
ARM_GXX_7_RESULT = LinuxToolchainTest.GXX_7_RESULT + {
'compiler': '/usr/bin/arm-linux-gnu-g++-7',
}
DEFAULT_CLANG_RESULT = LinuxToolchainTest.DEFAULT_CLANG_RESULT
DEFAULT_CLANGXX_RESULT = LinuxToolchainTest.DEFAULT_CLANGXX_RESULT
DEFAULT_GCC_RESULT = LinuxToolchainTest.DEFAULT_GCC_RESULT
DEFAULT_GXX_RESULT = LinuxToolchainTest.DEFAULT_GXX_RESULT
little_endian = FakeCompiler(GCC_PLATFORM_LINUX,
GCC_PLATFORM_LITTLE_ENDIAN)
@ -1204,17 +1228,17 @@ class LinuxCrossCompileToolchainTest(BaseToolchainTest):
self.HOST = host
self.TARGET = target
paths = {
'/usr/bin/gcc': GCC_4_9 + self.PLATFORMS[host],
'/usr/bin/g++': GXX_4_9 + self.PLATFORMS[host],
'/usr/bin/gcc': DEFAULT_GCC + self.PLATFORMS[host],
'/usr/bin/g++': DEFAULT_GXX + self.PLATFORMS[host],
}
cross_flags = {
'flags': ['-m64' if '64' in target else '-m32']
}
self.do_toolchain_test(paths, {
'c_compiler': self.GCC_4_9_RESULT + cross_flags,
'cxx_compiler': self.GXX_4_9_RESULT + cross_flags,
'host_c_compiler': self.GCC_4_9_RESULT,
'host_cxx_compiler': self.GXX_4_9_RESULT,
'c_compiler': self.DEFAULT_GCC_RESULT + cross_flags,
'cxx_compiler': self.DEFAULT_GXX_RESULT + cross_flags,
'host_c_compiler': self.DEFAULT_GCC_RESULT,
'host_cxx_compiler': self.DEFAULT_GXX_RESULT,
})
self.HOST = LinuxCrossCompileToolchainTest.HOST
self.TARGET = LinuxCrossCompileToolchainTest.TARGET
@ -1244,8 +1268,8 @@ class LinuxCrossCompileToolchainTest(BaseToolchainTest):
cpu, manufacturer, os = target.split('-', 2)
toolchain_prefix = '/usr/bin/%s-%s' % (cpu, os)
paths = {
'/usr/bin/gcc': GCC_4_9 + self.PLATFORMS[host],
'/usr/bin/g++': GXX_4_9 + self.PLATFORMS[host],
'/usr/bin/gcc': DEFAULT_GCC + self.PLATFORMS[host],
'/usr/bin/g++': DEFAULT_GXX + self.PLATFORMS[host],
}
self.do_toolchain_test(paths, {
'c_compiler': ('Target C compiler target CPU (%s) '
@ -1254,18 +1278,18 @@ class LinuxCrossCompileToolchainTest(BaseToolchainTest):
})
paths.update({
'%s-gcc' % toolchain_prefix: GCC_4_9 + self.PLATFORMS[target],
'%s-g++' % toolchain_prefix: GXX_4_9 + self.PLATFORMS[target],
'%s-gcc' % toolchain_prefix: DEFAULT_GCC + self.PLATFORMS[target],
'%s-g++' % toolchain_prefix: DEFAULT_GXX + self.PLATFORMS[target],
})
self.do_toolchain_test(paths, {
'c_compiler': self.GCC_4_9_RESULT + {
'c_compiler': self.DEFAULT_GCC_RESULT + {
'compiler': '%s-gcc' % toolchain_prefix,
},
'cxx_compiler': self.GXX_4_9_RESULT + {
'cxx_compiler': self.DEFAULT_GXX_RESULT + {
'compiler': '%s-g++' % toolchain_prefix,
},
'host_c_compiler': self.GCC_4_9_RESULT,
'host_cxx_compiler': self.GXX_4_9_RESULT,
'host_c_compiler': self.DEFAULT_GCC_RESULT,
'host_cxx_compiler': self.DEFAULT_GXX_RESULT,
})
self.HOST = LinuxCrossCompileToolchainTest.HOST
self.TARGET = LinuxCrossCompileToolchainTest.TARGET
@ -1279,8 +1303,8 @@ class LinuxCrossCompileToolchainTest(BaseToolchainTest):
self.TARGET = 'mipsel-unknown-linux-gnu'
paths = {
'/usr/bin/gcc': GCC_4_9 + self.PLATFORMS['mips-unknown-linux-gnu'],
'/usr/bin/g++': GXX_4_9 + self.PLATFORMS['mips-unknown-linux-gnu'],
'/usr/bin/gcc': DEFAULT_GCC + self.PLATFORMS['mips-unknown-linux-gnu'],
'/usr/bin/g++': DEFAULT_GXX + self.PLATFORMS['mips-unknown-linux-gnu'],
}
self.do_toolchain_test(paths, {
'c_compiler': ('Target C compiler target endianness (big) '
@ -1290,67 +1314,67 @@ class LinuxCrossCompileToolchainTest(BaseToolchainTest):
def test_overridden_cross_gcc(self):
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.ARM_GCC_5_RESULT,
'cxx_compiler': self.ARM_GXX_5_RESULT,
'host_c_compiler': self.GCC_4_9_RESULT,
'host_cxx_compiler': self.GXX_4_9_RESULT,
'c_compiler': self.ARM_GCC_7_RESULT,
'cxx_compiler': self.ARM_GXX_7_RESULT,
'host_c_compiler': self.DEFAULT_GCC_RESULT,
'host_cxx_compiler': self.DEFAULT_GXX_RESULT,
}, environ={
'CC': 'arm-linux-gnu-gcc-5',
'CXX': 'arm-linux-gnu-g++-5',
'CC': 'arm-linux-gnu-gcc-7',
'CXX': 'arm-linux-gnu-g++-7',
})
def test_overridden_unsupported_cross_gcc(self):
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.ARM_GCC_4_7_RESULT,
'c_compiler': self.ARM_GCC_4_9_RESULT,
}, environ={
'CC': 'arm-linux-gnu-gcc-4.7',
'CXX': 'arm-linux-gnu-g++-4.7',
'CC': 'arm-linux-gnu-gcc-4.9',
'CXX': 'arm-linux-gnu-g++-4.9',
})
def test_guess_cross_cxx(self):
# When CXX is not set, we guess it from CC.
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.ARM_GCC_5_RESULT,
'cxx_compiler': self.ARM_GXX_5_RESULT,
'host_c_compiler': self.GCC_4_9_RESULT,
'host_cxx_compiler': self.GXX_4_9_RESULT,
'c_compiler': self.ARM_GCC_7_RESULT,
'cxx_compiler': self.ARM_GXX_7_RESULT,
'host_c_compiler': self.DEFAULT_GCC_RESULT,
'host_cxx_compiler': self.DEFAULT_GXX_RESULT,
}, environ={
'CC': 'arm-linux-gnu-gcc-5',
'CC': 'arm-linux-gnu-gcc-7',
})
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.ARM_GCC_5_RESULT,
'cxx_compiler': self.ARM_GXX_5_RESULT,
'host_c_compiler': self.CLANG_3_6_RESULT,
'host_cxx_compiler': self.CLANGXX_3_6_RESULT,
'c_compiler': self.ARM_DEFAULT_GCC_RESULT,
'cxx_compiler': self.ARM_DEFAULT_GXX_RESULT,
'host_c_compiler': self.DEFAULT_CLANG_RESULT,
'host_cxx_compiler': self.DEFAULT_CLANGXX_RESULT,
}, environ={
'CC': 'arm-linux-gnu-gcc-5',
'CC': 'arm-linux-gnu-gcc',
'HOST_CC': 'clang',
})
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.ARM_GCC_5_RESULT,
'cxx_compiler': self.ARM_GXX_5_RESULT,
'host_c_compiler': self.CLANG_3_6_RESULT,
'host_cxx_compiler': self.CLANGXX_3_6_RESULT,
'c_compiler': self.ARM_DEFAULT_GCC_RESULT,
'cxx_compiler': self.ARM_DEFAULT_GXX_RESULT,
'host_c_compiler': self.DEFAULT_CLANG_RESULT,
'host_cxx_compiler': self.DEFAULT_CLANGXX_RESULT,
}, environ={
'CC': 'arm-linux-gnu-gcc-5',
'CXX': 'arm-linux-gnu-g++-5',
'CC': 'arm-linux-gnu-gcc',
'CXX': 'arm-linux-gnu-g++',
'HOST_CC': 'clang',
})
def test_cross_clang(self):
cross_clang_result = self.CLANG_3_6_RESULT + {
cross_clang_result = self.DEFAULT_CLANG_RESULT + {
'flags': ['--target=arm-linux-gnu'],
}
cross_clangxx_result = self.CLANGXX_3_6_RESULT + {
cross_clangxx_result = self.DEFAULT_CLANGXX_RESULT + {
'flags': ['--target=arm-linux-gnu'],
}
self.do_toolchain_test(self.PATHS, {
'c_compiler': cross_clang_result,
'cxx_compiler': cross_clangxx_result,
'host_c_compiler': self.CLANG_3_6_RESULT,
'host_cxx_compiler': self.CLANGXX_3_6_RESULT,
'host_c_compiler': self.DEFAULT_CLANG_RESULT,
'host_cxx_compiler': self.DEFAULT_CLANGXX_RESULT,
}, environ={
'CC': 'clang',
'HOST_CC': 'clang',
@ -1359,8 +1383,8 @@ class LinuxCrossCompileToolchainTest(BaseToolchainTest):
self.do_toolchain_test(self.PATHS, {
'c_compiler': cross_clang_result,
'cxx_compiler': cross_clangxx_result,
'host_c_compiler': self.CLANG_3_6_RESULT,
'host_cxx_compiler': self.CLANGXX_3_6_RESULT,
'host_c_compiler': self.DEFAULT_CLANG_RESULT,
'host_cxx_compiler': self.DEFAULT_CLANGXX_RESULT,
}, environ={
'CC': 'clang',
})
@ -1371,10 +1395,10 @@ class LinuxCrossCompileToolchainTest(BaseToolchainTest):
'/usr/bin/afl-clang-fast': paths['/usr/bin/clang'],
'/usr/bin/afl-clang-fast++': paths['/usr/bin/clang++'],
})
afl_clang_result = self.CLANG_3_6_RESULT + {
afl_clang_result = self.DEFAULT_CLANG_RESULT + {
'compiler': '/usr/bin/afl-clang-fast',
}
afl_clangxx_result = self.CLANGXX_3_6_RESULT + {
afl_clangxx_result = self.DEFAULT_CLANGXX_RESULT + {
'compiler': '/usr/bin/afl-clang-fast++',
}
self.do_toolchain_test(paths, {
@ -1395,19 +1419,19 @@ class LinuxCrossCompileToolchainTest(BaseToolchainTest):
class OSXCrossToolchainTest(BaseToolchainTest):
TARGET = 'i686-apple-darwin11.2.0'
PATHS = LinuxToolchainTest.PATHS
CLANG_3_6_RESULT = LinuxToolchainTest.CLANG_3_6_RESULT
CLANGXX_3_6_RESULT = LinuxToolchainTest.CLANGXX_3_6_RESULT
DEFAULT_CLANG_RESULT = LinuxToolchainTest.DEFAULT_CLANG_RESULT
DEFAULT_CLANGXX_RESULT = LinuxToolchainTest.DEFAULT_CLANGXX_RESULT
def test_osx_cross(self):
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.CLANG_3_6_RESULT + {
'c_compiler': self.DEFAULT_CLANG_RESULT + {
'flags': ['--target=i686-darwin11.2.0'],
},
'cxx_compiler': self.CLANGXX_3_6_RESULT + {
'cxx_compiler': self.DEFAULT_CLANGXX_RESULT + {
'flags': ['--target=i686-darwin11.2.0'],
},
'host_c_compiler': self.CLANG_3_6_RESULT,
'host_cxx_compiler': self.CLANGXX_3_6_RESULT,
'host_c_compiler': self.DEFAULT_CLANG_RESULT,
'host_cxx_compiler': self.DEFAULT_CLANGXX_RESULT,
}, environ={
'CC': 'clang',
})
@ -1425,16 +1449,16 @@ class OpenBSDToolchainTest(BaseToolchainTest):
HOST = 'x86_64-unknown-openbsd6.1'
TARGET = 'x86_64-unknown-openbsd6.1'
PATHS = {
'/usr/bin/gcc': GCC_4_9 + GCC_PLATFORM_X86_64 + GCC_PLATFORM_OPENBSD,
'/usr/bin/g++': GXX_4_9 + GCC_PLATFORM_X86_64 + GCC_PLATFORM_OPENBSD,
'/usr/bin/gcc': DEFAULT_GCC + GCC_PLATFORM_X86_64 + GCC_PLATFORM_OPENBSD,
'/usr/bin/g++': DEFAULT_GXX + GCC_PLATFORM_X86_64 + GCC_PLATFORM_OPENBSD,
}
GCC_4_9_RESULT = LinuxToolchainTest.GCC_4_9_RESULT
GXX_4_9_RESULT = LinuxToolchainTest.GXX_4_9_RESULT
DEFAULT_GCC_RESULT = LinuxToolchainTest.DEFAULT_GCC_RESULT
DEFAULT_GXX_RESULT = LinuxToolchainTest.DEFAULT_GXX_RESULT
def test_gcc(self):
self.do_toolchain_test(self.PATHS, {
'c_compiler': self.GCC_4_9_RESULT,
'cxx_compiler': self.GXX_4_9_RESULT,
'c_compiler': self.DEFAULT_GCC_RESULT,
'cxx_compiler': self.DEFAULT_GXX_RESULT,
})

View File

@ -205,7 +205,7 @@ linux64-base-toolchains/opt:
need-xvfb: true
toolchains:
- linux64-clang-3.9
- linux64-gcc-4.9
- linux64-gcc-6
- linux64-rust-1.24
- linux64-sccache
@ -235,7 +235,7 @@ linux64-base-toolchains/debug:
need-xvfb: true
toolchains:
- linux64-clang-3.9
- linux64-gcc-4.9
- linux64-gcc-6
- linux64-rust-1.24
- linux64-sccache

View File

@ -15,12 +15,11 @@
<head>
<title>&aboutProfiles.title;</title>
<link rel="icon" type="image/png" id="favicon" href="chrome://branding/content/icon32.png"/>
<link rel="stylesheet" href="chrome://global/skin/in-content/common.css" type="text/css"/>
<link rel="stylesheet" href="chrome://mozapps/skin/aboutProfiles.css" type="text/css" />
<script type="application/javascript" src="chrome://global/content/aboutProfiles.js" />
</head>
<body id="body" dir="&locale.dir;">
<div id="action-box">
<body id="body" dir="&locale.dir;" class="wide-container">
<div id="action-box" class="notice-box">
<h3>&aboutProfiles.restart.title;</h3>
<button id="restart-in-safe-mode-button">&aboutProfiles.restart.inSafeMode;</button>
<button id="restart-button">&aboutProfiles.restart.normal;</button>

View File

@ -18,8 +18,6 @@
<link rel="icon" type="image/png" id="favicon"
href="chrome://branding/content/icon32.png"/>
<link rel="stylesheet" href="chrome://global/skin/in-content/common.css"
type="text/css"/>
<link rel="stylesheet" href="chrome://global/skin/aboutSupport.css"
type="text/css"/>
@ -27,10 +25,10 @@
src="chrome://global/content/aboutSupport.js"/>
</head>
<body dir="&locale.dir;">
<body dir="&locale.dir;" class="wide-container">
#ifndef ANDROID
<div id="action-box">
<div id="action-box" class="notice-box">
<div id="reset-box">
<h3>&refreshProfile.title;</h3>
<button id="reset-box-button">

View File

@ -2,14 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
html {
--aboutUrlClassifier-table-background: #ebebeb;
background-color: var(--in-content-page-background);
}
body {
margin: 40px 48px;
}
@import url("chrome://global/skin/in-content/info-pages.css");
.major-section {
margin-top: 2em;
@ -19,41 +12,6 @@ body {
font-weight: bold;
}
table {
background-color: var(--aboutUrlClassifier-table-background);
color: var(--in-content-text-color);
font: message-box;
text-align: start;
width: 100%;
border: 1px solid var(--in-content-border-color);
border-spacing: 0px;
}
th, td {
border: 1px solid var(--in-content-border-color);
padding: 4px;
}
thead th {
text-align: center;
}
th {
text-align: start;
background-color: var(--in-content-table-header-background);
color: var(--in-content-selected-text);
}
th.column {
white-space: nowrap;
width: 0px;
}
td {
text-align: start;
border-color: var(--in-content-table-border-dark-color);
}
#provider-table > tbody > tr > td:last-child {
text-align: center;
}
@ -73,4 +31,5 @@ td {
button {
margin-inline-start: 0;
margin-inline-end: 8px;
padding: 3px;
}

View File

@ -14,12 +14,11 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>&aboutUrlClassifier.title;</title>
<link rel="stylesheet" href="chrome://global/skin/in-content/common.css" type="text/css"/>
<link rel="stylesheet" href="chrome://global/content/aboutUrlClassifier.css" type="text/css"/>
<script type="text/javascript" src="chrome://global/content/aboutUrlClassifier.js"></script>
</head>
<body onload="onLoad()" class="aboutPageWideContainer">
<body onload="onLoad()" class="wide-container">
<h1>&aboutUrlClassifier.title;</h1>
<div id="provider">
<h2 class="major-section">&aboutUrlClassifier.providerTitle;</h2>

View File

@ -2,14 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
html {
--aboutProfiles-table-background: #ebebeb;
background-color: var(--in-content-page-background);
}
body {
margin: 40px 48px;
}
@import url("chrome://global/skin/in-content/info-pages.css");
.page-subtitle {
margin-bottom: 3em;
@ -18,49 +11,15 @@ body {
button {
margin-inline-start: 0;
margin-inline-end: 8px;
}
table {
background-color: var(--aboutProfiles-table-background);
color: var(--in-content-text-color);
font: message-box;
text-align: start;
width: 100%;
border: 1px solid var(--in-content-border-color);
border-spacing: 0px;
}
th, td {
border: 1px solid var(--in-content-border-color);
padding: 4px;
text-align: start;
}
th {
background-color: var(--in-content-table-header-background);
color: var(--in-content-selected-text);
}
th.column {
white-space: nowrap;
width: 0px;
}
td {
border-color: var(--in-content-table-border-dark-color);
unicode-bidi: plaintext; /* Make sure file paths will be LTR */
padding: 3px;
}
#action-box {
background-color: var(--aboutProfiles-table-background);
border: 1px solid var(--in-content-border-color);
color: var(--in-content-text-color);
float: right;
margin-top: 2em;
margin-bottom: 20px;
margin-inline-start: 20px;
margin-inline-end: 0;
padding: 16px;
width: 30%;
}

View File

@ -2,14 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
html {
--aboutSupport-table-background: #ebebeb;
background-color: var(--in-content-page-background);
}
body {
margin: 40px 48px;
}
@import url("chrome://global/skin/in-content/info-pages.css");
.page-subtitle {
margin-bottom: 3em;
@ -26,31 +19,7 @@ body {
button {
margin-inline-start: 0;
margin-inline-end: 8px;
}
table {
background-color: var(--aboutSupport-table-background);
color: var(--in-content-text-color);
font: message-box;
text-align: start;
width: 100%;
border: 1px solid var(--in-content-border-color);
border-spacing: 0px;
}
th, td {
border: 1px solid var(--in-content-border-color);
padding: 4px;
}
thead th {
text-align: center;
}
th {
text-align: start;
background-color: var(--in-content-table-header-background);
color: var(--in-content-selected-text);
padding: 3px;
}
th.title-column {
@ -59,16 +28,6 @@ th.title-column {
font-size: medium;
}
th.column {
white-space: nowrap;
width: 0px;
}
td {
text-align: start;
border-color: var(--in-content-table-border-dark-color);
}
td.integer {
text-align: end;
font-family: monospace;
@ -92,15 +51,11 @@ td.integer {
}
#action-box {
background-color: var(--aboutSupport-table-background);
border: 1px solid var(--in-content-border-color);
color: var(--in-content-text-color);
float: right;
margin-top: 2em;
margin-bottom: 20px;
margin-inline-start: 20px;
margin-inline-end: 0;
padding: 16px;
width: 30%;
}
@ -127,10 +82,6 @@ td.integer {
overflow: auto;
}
.block {
display: block;
}
.hidden {
display: none;
}

View File

@ -38,6 +38,7 @@
--in-content-primary-button-background: #0a84ff;
--in-content-primary-button-background-hover: #0060df;
--in-content-primary-button-background-active: #003EAA;
--in-content-table-background: #ebebeb;
--in-content-table-border-dark-color: #d1d1d1;
--in-content-table-header-background: #0a84ff;
}

View File

@ -20,6 +20,10 @@ body {
justify-content: center;
}
body.wide-container {
display: block;
}
.container {
min-width: var(--in-content-container-min-width);
max-width: var(--in-content-container-max-width);
@ -122,9 +126,51 @@ tree {
width: 100%;
}
/* Illustrated Info Pages */
/* Tables */
table {
background-color: var(--in-content-table-background);
color: var(--in-content-text-color);
font: message-box;
text-align: start;
width: 100%;
border: 1px solid var(--in-content-border-color);
border-spacing: 0px;
}
th, td {
border: 1px solid var(--in-content-border-color);
padding: 4px;
text-align: start;
}
thead th {
text-align: center;
}
th {
background-color: var(--in-content-table-header-background);
color: var(--in-content-selected-text);
}
th.column {
white-space: nowrap;
width: 0px;
}
td {
border-color: var(--in-content-table-border-dark-color);
unicode-bidi: plaintext; /* Make sure file paths will be LTR */
}
/* Illustrated Info Pages */
.illustrated .title {
margin-inline-start: 0;
padding-inline-start: 0;
}
.notice-box {
background-color: var(--in-content-table-background);
border: 1px solid var(--in-content-border-color);
color: var(--in-content-text-color);
padding: 16px;
}