Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions private/react-native-fantom/runner/formatFantomConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ function formatFantomHermesVariant(hermesVariant: HermesVariant): string {
switch (hermesVariant) {
case FantomTestConfigHermesVariant.Hermes:
return 'hermes';
case FantomTestConfigHermesVariant.StaticHermes:
return 'hermes 🆕';
case FantomTestConfigHermesVariant.StaticHermesStable:
return 'shermes 🆕';
case FantomTestConfigHermesVariant.StaticHermesStaging:
return 'shermes ⏭️';
case FantomTestConfigHermesVariant.StaticHermesExperimental:
return 'hermes 🧪';
return 'shermes 🧪';
}
}

Expand Down
16 changes: 10 additions & 6 deletions private/react-native-fantom/runner/getFantomTestConfigs.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const MAX_FANTOM_CONFIGURATION_VARIATIONS = 12;
* /**
* * @flow strict-local
* * @fantom_mode opt
* * @fantom_hermes_variant static_hermes
* * @fantom_hermes_variant static_hermes_stable
* * @fantom_flags commonTestFlag:true
* * @fantom_flags jsOnlyTestFlag:true
* * @fantom_react_fb_flags reactInternalFlag:true
Expand All @@ -101,8 +101,8 @@ const MAX_FANTOM_CONFIGURATION_VARIATIONS = 12;
* - `fantom_mode`: specifies the level of optimization to compile the test
* with. Valid values are `dev`, `dev-bytecode` and `opt`.
* - `fantom_hermes_variant`: specifies the Hermes variant to use to run the
* test. Valid values are `hermes`, `static_hermes` and
* `static_hermes_experimental`.
* test. Valid values are `hermes`, `static_hermes_stable`,
* `static_hermes_staging` and `static_hermes_experimental`.
* - `fantom_flags`: specifies the configuration for common and JS-only feature
* flags. They can be specified in the same pragma or in different ones, and
* the format is `<flag_name>:<value>`.
Expand Down Expand Up @@ -187,16 +187,20 @@ export default function getFantomTestConfigs(
case 'hermes':
config.hermesVariant = HermesVariant.Hermes;
break;
case 'static_hermes':
config.hermesVariant = HermesVariant.StaticHermes;
case 'static_hermes_stable':
config.hermesVariant = HermesVariant.StaticHermesStable;
break;
case 'static_hermes_staging':
config.hermesVariant = HermesVariant.StaticHermesStaging;
break;
case 'static_hermes_experimental':
config.hermesVariant = HermesVariant.StaticHermesExperimental;
break;
case '*':
configVariations.push([
{hermesVariant: HermesVariant.Hermes},
{hermesVariant: HermesVariant.StaticHermes},
{hermesVariant: HermesVariant.StaticHermesStable},
{hermesVariant: HermesVariant.StaticHermesStaging},
{hermesVariant: HermesVariant.StaticHermesExperimental},
]);
break;
Expand Down
11 changes: 8 additions & 3 deletions private/react-native-fantom/runner/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ const BUCK_ISOLATION_DIR = 'react-native-fantom-buck-out';

export enum HermesVariant {
Hermes,
StaticHermes, // Static Hermes Stable
StaticHermesStable, // Static Hermes Stable
StaticHermesStaging, // Static Hermes Staging
StaticHermesExperimental, // Static Hermes Trunk
}

Expand All @@ -30,8 +31,10 @@ export function getBuckOptionsForHermes(
switch (variant) {
case HermesVariant.Hermes:
return [];
case HermesVariant.StaticHermes:
case HermesVariant.StaticHermesStable:
return ['-c hermes.static_hermes=stable'];
case HermesVariant.StaticHermesStaging:
return ['-c hermes.static_hermes=staging'];
case HermesVariant.StaticHermesExperimental:
return ['-c hermes.static_hermes=trunk'];
}
Expand All @@ -41,8 +44,10 @@ export function getHermesCompilerTarget(variant: HermesVariant): string {
switch (variant) {
case HermesVariant.Hermes:
return '//xplat/hermes/tools/hermesc:hermesc';
case HermesVariant.StaticHermes:
case HermesVariant.StaticHermesStable:
return '//xplat/shermes/stable:hermesc';
case HermesVariant.StaticHermesStaging:
return '//xplat/shermes/staging:hermesc';
case HermesVariant.StaticHermesExperimental:
return '//xplat/static_h:hermesc';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
*
* @flow strict-local
* @format
* @fantom_hermes_variant static_hermes
* @fantom_hermes_variant static_hermes_stable
*/

declare var HermesInternal: $HermesInternalType;

describe('"@fantom_hermes_variant static_hermes" in docblock', () => {
describe('"@fantom_hermes_variant static_hermes_stable" in docblock', () => {
it('should use Static Hermes', () => {
expect(HermesInternal.getRuntimeProperties?.()['Static Hermes']).toBe(true);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
* @fantom_hermes_variant static_hermes_staging
*/

declare var HermesInternal: $HermesInternalType;

describe('"@fantom_hermes_variant static_hermes_staging" in docblock', () => {
it('should use Static Hermes', () => {
expect(HermesInternal.getRuntimeProperties?.()['Static Hermes']).toBe(true);
});
});
Loading