change JerryScript test case

This commit is contained in:
wgzAIIT
2023-11-20 09:02:11 +08:00
parent ba81c73a06
commit d1d846184b
7 changed files with 35 additions and 304 deletions
+6 -22
View File
@@ -1,15 +1,5 @@
# jerryscript编译步骤,本文档依赖 Ubuntu 20.04 操作系统.
## 1、jerryscript源码下载
JerryScript 源码,已经以子模块的形式保存在xiuos/APP_Framework/lib/JerryScript/jerryscript下,第一次进行编译前需要将该源码下载下来,在xiuos根目录下执行:
```bash
git submodule
git submodule init
git submodule update APP_Framework/lib/JerryScript/jerryscript
```
## 2、jerryscript编译依赖工具链安装
# jerryscript编译步骤,注意本文档依赖 Ubuntu 20.04 操作系统.
## 1、jerryscript编译依赖工具链安装
第一次编译需要安装依赖,在APP_Framework/lib/JerryScript路径下,依次执行:
@@ -23,7 +13,7 @@ sudo apt install \
libexpat-dev gcc-multilib g++-multilib picocom u-boot-tools util-linux
```
## 3、jerryscript源码编译
## 2、jerryscript源码编译
当前在XiZi操作系统下,支持HC32F4A0单片机和STM32F4单片机两个系列的开发板,在APP_Framework/lib/JerryScript路径下,以edu-arm32开发板(HC32F4A0单片机)为例,进入到APP_Framework/lib/JerryScript下执行:
@@ -41,7 +31,7 @@ jerryscript/tools/build.py \
如果是STM32F4的单片机,将.cmake指定为toolchain_mcu_stm32f4.cmake即可,这一步完成后在APP_Framework/lib/JerryScript/jerryscript/build目录下会编译出几个.a文件,这些文件是接下来的bin包构建过程中需要的。
## 4、开发板bin包构建
## 3、开发板bin包构建
以edu-arm32开发板为例进行构建,进入到xiuos/Ubiquitous/XiZi_IIoT目录下,执行:
@@ -64,13 +54,7 @@ make BOARD=edu-arm32
APP_Framework/lib/JerryScript/testfile目录下存放了几个.js文件,可以将这些文件拷贝到内存卡中,也可以自行创建一些.js文件,完成烧录后,插入存有.js文件的内存卡,正确完成挂载后执行:
```shell
jerrytest hello.js
jerrytest demo.js
```
也可以同时执行多个.js文件:
```shell
jerrytest hello.js test.js mathfunction.js
```
即可看到执行.js文件执行结果,如果jerrytest命令没有带文件参数,则执行一条默认的js语句。
会执行一个数组的快速排序demo,打印排序后的数组。