Skip to content

Commit

Permalink
Merge pull request #116 from yangzx18/sig
Browse files Browse the repository at this point in the history
test: add performance test
  • Loading branch information
Louis-C7 authored May 15, 2024
2 parents 9ed619f + 2c17e63 commit 3ddc362
Show file tree
Hide file tree
Showing 4 changed files with 371 additions and 14 deletions.
11 changes: 2 additions & 9 deletions tester/svgDemoCases/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ import {
StyleSheet,
View,
} from 'react-native';
// import * as exampleByName from './components';
import {NavigationContainer, Page} from './Navigation';
// import {Benchmarker, DeepTree, SierpinskiTriangle} from './benchmarks';
import {PortalHost, PortalProvider} from '@gorhom/portal';
import {PortalProvider} from '@gorhom/portal';
import testSuiteByName from './components';
import {Tester} from '@rnoh/testerino';


const comList = Object.keys(testSuiteByName).map(testSuiteName => {
Expand All @@ -38,12 +35,8 @@ function App() {
return (
<Page
key={com.name}
name={`${com.name.replace('Test', '')}`}>
{/* <Tester style={{flex: 1}}>
<ScrollView style={{flex: 1}}> */}
name={`${com.name}`}>
<TestSuite key={com.name} />
{/* </ScrollView>
</Tester> */}
</Page>
);
})}
Expand Down
11 changes: 7 additions & 4 deletions tester/svgDemoCases/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ const NavigationContext = React.createContext<

export function NavigationContainer({
initialPage = 'INDEX',
hasHeader = true,
children,
}: {
initialPage?: string;
children: any;
hasHeader?: boolean
}) {
const [currentPageName, setCurrentPageName] = React.useState(initialPage);
const [registeredPageNames, setRegisteredPageNames] = React.useState<
Expand All @@ -49,7 +51,7 @@ export function NavigationContainer({
}}>
<View style={{width: '100%', height: '100%', flexDirection: 'column'}}>
<Page name="INDEX">
<IndexPage />
<IndexPage hasHeader={hasHeader} />
</Page>
{children}
</View>
Expand Down Expand Up @@ -90,14 +92,14 @@ export function Page({name, children}: {name: string; children: any}) {
) : null;
}

export function IndexPage() {
export function IndexPage({ hasHeader }: { hasHeader: boolean }) {
const {navigateTo, registeredPageNames} = useNavigation();

return (
<FlatList
data={registeredPageNames}
ListHeaderComponent={
<View
hasHeader ? <View
style={{
flexDirection: 'row',
alignItems: 'center',
Expand All @@ -116,12 +118,13 @@ export function IndexPage() {
fontWeight: 'bold',
padding: 16,
}}>
RN Tester
RN Svg Capi Tester
{'rnohArchitecture' in Platform.constants
? (` (${Platform.constants.rnohArchitecture})` as string)
: ''}
</Text>
</View>
: null
}
renderItem={({item}) => {
return (
Expand Down
6 changes: 5 additions & 1 deletion tester/svgDemoCases/components/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import ClipPath from './clipPath';
import Image from './Image';
import Combination from './Combination';
import ComplexDemo from './complexDemo';
import PerformanceList from './PerformanceList';
export default {
Circle,
Defs,
Expand Down Expand Up @@ -54,5 +55,8 @@ export default {
ClipPath,
Image,
Combination,
ComplexDemo
ComplexDemo,


PerformanceTest: PerformanceList
}
Loading

0 comments on commit 3ddc362

Please sign in to comment.