Skip to content

Commit cb4c7ae

Browse files
committed
ci: clean up output, use xxd when dumping binaries
1 parent bd923a3 commit cb4c7ae

File tree

4 files changed

+36
-13
lines changed

4 files changed

+36
-13
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ tests/compat/*.bin
22
tests/compat/*.elf
33
tests/compat/*.o
44
tests/compat/*.ulp
5+
tests/compat/*.log
56
.DS_Store

.travis.yml

+12-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ script:
1414

1515
###### Install tools ######
1616

17+
- echo -e "travis_fold:start:build_micropython"
1718
- echo "Building micropython"
1819
- git clone --recursive https://github.com/micropython/micropython.git
1920
- pushd micropython/ports/unix
@@ -23,7 +24,9 @@ script:
2324
- export PATH=$PATH:$PWD
2425
- test $(micropython -c 'print("test")') = "test"
2526
- popd
27+
- echo -e "travis_fold:end:build_micropython"
2628

29+
- echo -e "travis_fold:start:build_binutils"
2730
- echo "Building binutils-esp32ulp"
2831
- git clone https://github.com/espressif/binutils-esp32ulp.git
2932
- pushd binutils-esp32ulp
@@ -35,9 +38,17 @@ script:
3538
- export PATH=$PATH:$PWD/dist/bin
3639
- esp32ulp-elf-as --version | grep 'esp32ulp-elf' > /dev/null
3740
- popd
41+
- echo -e "travis_fold:end:build_binutils"
3842

3943
###### Run tests ######
4044

4145
- pushd tests
42-
- ./00_run_tests.sh
46+
47+
- echo -e "travis_fold:start:unit_tests"
48+
- ./00_unit_tests.sh
49+
- echo -e "travis_fold:end:unit_tests"
50+
51+
- echo -e "travis_fold:start:compat_tests"
52+
- ./01_compat_tests.sh
53+
- echo -e "travis_fold:end:compat_tests"
4354

tests/00_unit_tests.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
# export PYTHONPATH=.:$PYTHONPATH
4+
5+
set -e
6+
7+
for file in opcodes assemble link ; do
8+
echo testing $file...
9+
micropython $file.py
10+
done

tests/00_run_tests.sh renamed to tests/01_compat_tests.sh

+13-12
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,36 @@
44

55
set -e
66

7-
for file in opcodes assemble link ; do
8-
echo testing $file...
9-
micropython $file.py
10-
done
11-
127
for src_file in $(ls -1 compat/*.S); do
138
src_name="${src_file%.S}"
149

15-
echo "Building $src_file using py-esp32-ulp"
10+
echo "Testing $src_file"
11+
echo -e "\tBuilding using py-esp32-ulp"
1612
ulp_file="${src_name}.ulp"
17-
micropython -m esp32_ulp $src_file # generates $ulp_file
13+
log_file="${src_name}.log"
14+
micropython -m esp32_ulp $src_file 1>$log_file # generates $ulp_file
1815

1916
obj_file="${src_name}.o"
2017
elf_file="${src_name}.elf"
2118
bin_file="${src_name}.bin"
2219

23-
echo "Building $src_file using binutils"
20+
echo -e "\tBuilding using binutils"
2421
esp32ulp-elf-as -o $obj_file $src_file
2522
esp32ulp-elf-ld -T esp32.ulp.ld -o $elf_file $obj_file
2623
esp32ulp-elf-objcopy -O binary $elf_file $bin_file
2724

28-
if ! diff $ulp_file $bin_file; then
25+
if ! diff $ulp_file $bin_file 1>/dev/null; then
26+
echo -e "\tBuild outputs differ!"
27+
echo ""
2928
echo "Compatibility test failed for $src_file"
29+
echo "py-esp32-ulp log:"
30+
cat $log_file
3031
echo "py-esp32-ulp output:"
31-
hexdump $ulp_file
32+
xxd -e $ulp_file
3233
echo "binutils output:"
33-
hexdump $bin_file
34+
xxd -e $bin_file
3435
exit 1
3536
else
36-
echo "Build outputs match for $src_file"
37+
echo -e "\tBuild outputs match"
3738
fi
3839
done

0 commit comments

Comments
 (0)