Skip to content

Commit 4da26df

Browse files
committed
update scripts, remove sleep
1 parent a5ca5af commit 4da26df

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

measure/scripts/downloadPublishedVersion.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
const _ = require('lodash');
22
const exec = require('shell-utils').exec;
33

4-
const version = process.argv.splice(process.execArgv.length + 2)[0];
4+
let version = process.argv.splice(process.execArgv.length + 2)[0];
55
const scriptDir = __dirname;
66
const distDir = `${scriptDir}/../../dist`;
77

88
run();
99

1010
function run() {
1111
if (!version) {
12-
throw new Error(`usage: npm run downloadPublishedVersion 224109`)
12+
version = require('../../package.json').version;
1313
}
1414
const url = exec.execSyncRead(`npm view jsc-android@${version} dist.tarball`);
1515
exec.execSync(`curl ${url} | tar -xf -`);

measure/scripts/measure.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,20 @@ function run() {
3737
launchProfiler();
3838
clickOnJsTest();
3939
killProfiler();
40+
resultsStr += readLogcatFilteredOutput() + '\n';
41+
clearLogcat();
4042

4143
launchProfiler();
4244
clickOnFlatRenderTest();
4345
killProfiler();
46+
resultsStr += readLogcatFilteredOutput() + '\n';
47+
clearLogcat();
4448

4549
launchProfiler();
4650
clickOnDeepRenderTest();
4751
killProfiler();
48-
4952
resultsStr += readLogcatFilteredOutput() + '\n';
53+
clearLogcat();
5054
})
5155

5256
const resultLines = _.split(resultsStr, '\n');
@@ -92,14 +96,14 @@ function waitForLogcatMsg(msg) {
9296

9397
function launchProfiler() {
9498
console.log(`launching...`);
95-
exec.execSyncSilent(`adb shell am start-activity -W "${PACKAGE_NAME}/.${ACTIVITY_NAME}" && sleep 2`);
99+
exec.execSyncSilent(`adb shell am start-activity -W "${PACKAGE_NAME}/.${ACTIVITY_NAME}"`);
100+
waitForLogcatMsg(`${LOGCAT_TAG}:ApplicationLoadedAndRendered`);
96101
}
97102

98103
function killProfiler() {
99104
console.log(`killing`);
100105
exec.execSyncSilent(`adb shell am force-stop ${PACKAGE_NAME}`);
101106
exec.execSyncSilent(`adb shell am kill ${PACKAGE_NAME}`);
102-
exec.execSyncSilent(`sleep 2`);
103107
}
104108

105109
function clickOnJsTest() {

0 commit comments

Comments
 (0)