Skip to content

Commit

Permalink
use noderawfs for github workflow test
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuhengwe1 committed Nov 1, 2022
1 parent 509d915 commit 3423036
Show file tree
Hide file tree
Showing 6 changed files with 27,749 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/wasm-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ jobs:
- run: make gmp-bootstrap
- run: make gtest-bootstrap
- run: bash ./build/mktargets.sh
- run: emmake make all OS=wasm ARCH= EMFS=nodefs
- run: emmake make all OS=wasm ARCH= EMFS=noderawfs
- run: node h264enc.js testbin/welsenc_vd_1d_wasm_nodefs.cfg
- run: node h264enc.js testbin/welsenc_vd_rc_wasm_nodefs.cfg
- run: node h264enc.js testbin/welsenc_arbitrary_res_wasm_nodefs.cfg
- run: node h264dec.js res/test_vd_1d.264 testbin/test_vd_1d.yuv
- run: node h264dec.js res/test_vd_rc.264 testbin/test_vd_rc.yuv
- run: node h264dec.js res/Static.264 testbin/Static.yuv
- run: ( cd test/encoder_binary_comparison ; ./run_PrepareAllTestData.sh 64 )
- run: ( cd test/encoder_binary_comparison ; ./run_PrepareAllTestData.sh 64 wasm )
- run: ./run_Test.sh BinaryCompareWasm BA_MW_D.264
- run: ./run_Test.sh BinaryCompareWasm Adobe_PDF_sample_a_1024x768_50Frms.264
- run: ./run_Test.sh BinaryCompareWasm Zhling_1280x720.264
5 changes: 5 additions & 0 deletions build/platform-wasm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ CFLAGS += -DNODEFS
CXXFLAGS += -DNODEFS
LDFLAGS += -lnodefs.js
endif
ifeq ($(EMFS), noderawfs)
CFLAGS += -DNODERAWFS
CXXFLAGS += -DNODERAWFS
LDFLAGS += -s NODERAWFS=1
endif
ifeq ($(EMFS), memfs)
CFLAGS += -DMEMFS
CXXFLAGS += -DMEMFS
Expand Down
2 changes: 2 additions & 0 deletions commandTest.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node ./h264enc.js welsenc.cfg -bf TempData/BA_MW_D.264_x.yuv_codec_target.264 -org /home/test/workspace/openh264/test/encoder_binary_comparison/AllTestData/BA_MW_D.264/BA_MW_D.264_x.yuv
node ./h264enc.js welsenc.cfg -bf workload/test/encoder_binary_comparison/AllTestData/BA_MW_D.264/TempData/BA_MW_D.264_x.yuv_codec_target.264 -org /home/test/workspace/openh264/test/encoder_binary_comparison/AllTestData/BA_MW_D.264/BA_MW_D.264_x.yuv
2 changes: 2 additions & 0 deletions test/encoder_binary_comparison/Scripts/run_BitStreamToYUV.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ run_BitStream2YUV()
return 1
fi
#decode bitstream
echo "running decode test, printing pwd..."
echo $(pwd)
if [ "$TestWasm" = "0" ]
then
./h264dec ${BitStreamName} ${OutputYUVName} 2> ${LogFile}
Expand Down
69 changes: 54 additions & 15 deletions test/encoder_binary_comparison/run_PrepareAllTestData.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,24 @@ runBuildCodec()
cd ${MakeFileDir}
if [ "${BitType}" -eq 64 ]
then
make clean
make -B ENABLE64BIT=Yes h264dec h264enc
if [ "${TestWasm}" -eq 1 ]
then
make clean
emmake make binaries -B ENABLE64BIT=Yes OS=wasm ARCH= EMFS=noderawfs
else
make clean
make -B ENABLE64BIT=Yes h264dec h264enc
fi
elif [ "${BitType}" -eq 32 ]
then
make clean
make -B ENABLE64BIT=No h264dec h264enc
if [ "${TestWasm}" -eq 1 ]
then
make clean
emmake make binaries -B ENABLE64BIT=No OS=wasm ARCH= EMFS=noderawfs
else
make clean
make -B ENABLE64BIT=No h264dec h264enc
fi
else
echo "usage: runBuildCodec \64/32 #bits"
exit 1
Expand All @@ -51,14 +63,20 @@ runBuildCodec()
cd ${CurrentDir}

echo ""
if [ ! -e ${MakeFileDir}/h264enc ]
if [ ! -e ${MakeFileDir}/h264enc ]
then
echo "h264 Encoder build failed"
return 1
elif [ ! -e ${MakeFileDir}/h264dec ]
if [! -e $${MakeFileDir}/h264enc.js ]
then
echo "h264 Encoder build failed"
return 1
fi
elif [ ! -e ${MakeFileDir}/h264dec ]
then
echo "h264 Decoder build failed"
return 1
if [! -e $${MakeFileDir}/h264dec.js ]
then
echo "h264 Decoder build failed"
return 1
fi
else
echo "codec build succeed!"
return 0
Expand All @@ -74,8 +92,18 @@ runCopyFiles()
local ConfigureFileDir="../../testbin"

#copy codec and configure files
cp -p ${MakeFileDir}/h264enc ${CodecFolder}/
cp -p ${MakeFileDir}/h264dec ${CodecFolder}/
if [ "${TestWasm}" -eq 1 ]
then
cp -p ${MakeFileDir}/h264enc.js ${CodecFolder}/
cp -p ${MakeFileDir}/h264dec.js ${CodecFolder}/
cp -p ${MakeFileDir}/h264enc.worker.js ${CodecFolder}/
cp -p ${MakeFileDir}/h264dec.worker.js ${CodecFolder}/
cp -p ${MakeFileDir}/h264enc.wasm ${CodecFolder}/
cp -p ${MakeFileDir}/h264dec.wasm ${CodecFolder}/
else
cp -p ${MakeFileDir}/h264enc ${CodecFolder}/
cp -p ${MakeFileDir}/h264dec ${CodecFolder}/
fi
cp -p ${ConfigureFileDir}/layer2.cfg ${CodecFolder}/layer0.cfg
cp -p ${ConfigureFileDir}/layer2.cfg ${CodecFolder}/layer1.cfg
cp -p ${ConfigureFileDir}/layer2.cfg ${CodecFolder}/layer2.cfg
Expand Down Expand Up @@ -125,13 +153,18 @@ runPrepareAllFolder()
runMain()
{
#parameter check!
if [ ! $# -eq 1 ]
if [ ! $# -eq 2 ]
then
echo "usage: run_PrepareAllTestFolder.sh \${BitType}"
exit 1
fi

BitType=$1
export TestWasm=0
if [ "${WasmTest}" = "wasm" ]
then
let "TestWasm=1"
fi
AllTestDataFolder="./AllTestData"
CodecFolder="./Codec"
ScriptFolder="./Scripts"
Expand All @@ -150,7 +183,12 @@ runMain()
mkdir FinalResult

echo ""
echo "building codec.........."
if [ "${TestWasm}" -eq 1 ]
then
echo "building wasm codec.........."
else
echo "building codec.........."
fi
runBuildCodec ${BitType}
if [ ! $? -eq 0 ]
then
Expand All @@ -170,5 +208,6 @@ runMain()
}

BitType=$1
runMain ${BitType}
WasmTest=${2:-"normal"}
runMain ${BitType} ${WasmTest}

Loading

0 comments on commit 3423036

Please sign in to comment.