提交 0a7f0701 编写于 作者: L luozhewen

demo命令行编译适配

Signed-off-by: Nluozhewen <luozhewen@huawei.com>
上级 c9b71921
文件模式从 100644 更改为 100755
...@@ -10,9 +10,27 @@ ...@@ -10,9 +10,27 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import("//test/xts/tools/build/suite.gni")
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("hjs_demo_test") { ohos_js_hap_suite("hjs_demo_test") {
test_hap_name = "Hjsdemotest" hap_profile = "./src/main/config.json"
hap_source_path = "hap/entry-debug-signed.hap" deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
# shared_libraries = [
# "//third_party/giflib:libgif",
# "//third_party/libpng:libpng",
# ]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "Hjsdemotest"
# part_name = "prebuilt_hap"
# subsystem_name = "xts"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./src/main/js/default"
}
ohos_resources("hjs_demo_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
} }
文件模式从 100644 更改为 100755
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
}, },
"apiVersion": { "apiVersion": {
"compatible": 4, "compatible": 4,
"target": 4 "target": 5
} }
}, },
"deviceConfig": {}, "deviceConfig": {},
......
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
.container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
}
.title {
font-size: 60px;
text-align: center;
width: 100%;
height: 40%;
margin: 10px;
}
.btn {
width: 50%;
height: 100px;
font-size: 40px;
}
<!--
Copyright (c) 2021 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div class="container" onswipe="touchMove">
<text class="title">
{{ $t('strings.hello') }} {{title}}
</text>
<input class="btn" type="button" value="{{ $t('strings.next') }}" onclick="onclick"></input>
</div>
...@@ -12,11 +12,10 @@ ...@@ -12,11 +12,10 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import file from '@system.file'
import app from '@system.app' import app from '@system.app'
//import {Core, ExpectExtend, ReportExtend, InstrumentLog} from 'deccjsunit/index' import {Core, ExpectExtend} from 'deccjsunit/index'
import {Core, ExpectExtend, ReportExtend} from 'deccjsunit/index'
export default { export default {
data: { data: {
...@@ -31,22 +30,14 @@ export default { ...@@ -31,22 +30,14 @@ export default {
const expectExtend = new ExpectExtend({ const expectExtend = new ExpectExtend({
'id': 'extend' 'id': 'extend'
}) })
const reportExtend = new ReportExtend(file)
// const instrumentLog = new InstrumentLog({
// 'id': 'report'
// })
core.addService('expect', expectExtend) core.addService('expect', expectExtend)
core.addService('report', reportExtend)
// core.addService('report', instrumentLog)
core.init() core.init()
// core.subscribeEvent('spec', instrumentLog)
// core.subscribeEvent('suite', instrumentLog)
// core.subscribeEvent('task', instrumentLog)
const configService = core.getDefaultService('config') const configService = core.getDefaultService('config')
configService.setConfig(this) configService.setConfig(this)
require('../../../test/List.test') require('../../test/List.test')
core.execute() core.execute()
}, },
onReady() { onReady() {
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
* limitations under the License. * limitations under the License.
*/ */
import app from '@system.app' import app from '@system.app'
import Context from '@ohos.napi_context'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
...@@ -40,15 +39,5 @@ describe('appInfoTest', function () { ...@@ -40,15 +39,5 @@ describe('appInfoTest', function () {
expect(info.versionName).assertEqual('1.0') expect(info.versionName).assertEqual('1.0')
expect(info.versionCode).assertEqual('5') expect(info.versionCode).assertEqual('5')
}) })
it('get_process_info_test_001', 0, async function (done) {
console.log("111")
expect(1).assertLarger(0)
Context.getProcessInfo().then(info => {
console.log("222");
console.log("process_info: " + JSON.stringify(info));
expect(info.processName.length).assertLarger(0);
expect(info.pid).assertLarger(0);
});
done()
})
}) })
{
"string": [
{
"name": "app_name",
"value": "JsHelloWorld"
},
{
"name": "mainability_description",
"value": "hap sample empty page"
}
]
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册