0
0
mirror of https://github.com/netwide-assembler/nasm.git synced 2025-11-08 23:27:15 -05:00

add project test for intel-ipsec-mb isa-l_crypto isa-l

This commit is contained in:
Yongjie Sheng
2025-10-11 09:49:07 +08:00
parent 5d655306f9
commit 3e925ee75c
6 changed files with 84 additions and 11 deletions

View File

@@ -19,7 +19,7 @@ TESTS = $(wildcard *.asm)
RM_F = rm -f
RM_RF = rm -rf
.PHONY: tools nasm ndisasm ffmpegtest x264test dav1dtest
.PHONY: tools nasm ndisasm ffmpegtest x264test dav1dtest intel-ipsec-mbtest isa-ltest isa-l_cryptotest
tools:
$(MAKE) -C .. all
@@ -38,6 +38,15 @@ x264test:
dav1dtest:
bash projtest.sh '$(NASM)' $@
intel-ipsec-mbtest:
bash projtest.sh '$(NASM)' $@
isa-ltest:
bash projtest.sh '$(NASM)' $@
isa-l_cryptotest:
bash projtest.sh '$(NASM)' $@
%.bin: %.asm $(NASM)
$(NASM) $(NASMOPT) -f bin -o $@ -MD $@.dep -l $@.lst $<
@@ -123,6 +132,7 @@ clean:
$(RM_RF) testresults
$(RM_F) elftest elftest64
$(RM_RF) ffmpegtest x264test dav1dtest
$(RM_RF) intel-ipsec-mbtest isa-ltest isa-l_cryptotest
spotless: clean
$(RM_RF) golden

View File

@@ -0,0 +1,19 @@
#!/bin/bash
: >> "$filelist"
if [ -d intel-ipsec-mb/.git ]; then
cd intel-ipsec-mb
git reset --hard
xargs -r rm -f < "$filelist"
rm -rf build
else
git clone https://github.com/intel/intel-ipsec-mb.git
cd intel-ipsec-mb
fi
: > "$filelist"
mkdir -p build
cd build
cmake ..
cmake --build . --parallel

View File

@@ -0,0 +1,15 @@
#!/bin/bash
: >> "$filelist"
if [ -d isa-l_crypto/.git ]; then
cd isa-l_crypto
git reset --hard
xargs -r rm -f < "$filelist"
make clean
else
git clone https://github.com/intel/isa-l_crypto.git isa-l_crypto
cd isa-l_crypto
fi
: > "$filelist"
make -f Makefile.unx -j

15
test/get_build_isa-ltest.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
: >> "$filelist"
if [ -d isa-l/.git ]; then
cd isa-l
git reset --hard
xargs -r rm -f < "$filelist"
make clean
else
git clone https://github.com/intel/isa-l.git isa-l
cd isa-l
fi
: > "$filelist"
make -f Makefile.unx -j

View File

@@ -32,8 +32,8 @@ done
printf '%s\n' "$*" >> "$projnasm_logfile"
rm -f "$ofile"
"$projnasm_nasm2" "${param2[@]}"
"$projnasm_nasm1" "${param1[@]}" || exit $?
"$projnasm_nasm2" "${param2[@]}" || exit $?
if [ -f $ofile.1 ]; then
cp -f "$ofile.1" "$ofile"
fi

View File

@@ -48,37 +48,51 @@ if [ "$rev" -ne "0" ]; then
fi
set +x
tmpf=$(mktemp)
{
for y in "o" "obj"
do
for x in $(grep -o -P "\-o .*\.${y}" $logfile | sed -e 's/-o //')
do
f=$x
if ! [ -f $x ]; then
b=$(basename $x)
if find -name $b >/dev/null; then
find -name $b >$tmpf
while read -r line; do
if [[ "$line" == *"$x" ]]; then
f=$line
fi
done < "$tmpf"
fi
fi
if ! [ -f $f ]; then
# probably it's a temporary assembly being tested
continue
fi
if ! [ -f ${x}.1 ]; then
echo file ${x}.1 does not exist
if ! [ -f ${f}.1 ]; then
echo file ${f}.1 does not exist
fi
if ! [ -f ${x}.2 ]; then
echo file ${x}.2 does not exist
if ! [ -f ${f}.2 ]; then
echo file ${f}.2 does not exist
fi
objdump -d ${x}.1 | tail -n +4 >/tmp/1.dump
objdump -d ${x}.2 | tail -n +4 >/tmp/2.dump
objdump -d ${f}.1 | tail -n +4 >/tmp/1.dump
objdump -d ${f}.2 | tail -n +4 >/tmp/2.dump
if ! diff /tmp/1.dump /tmp/2.dump >/dev/null; then
echo [differs] $x
#diff /tmp/1.dump /tmp/2.dump
echo [differs] $f
#diff -u /tmp/1.dump /tmp/2.dump
else
echo [matches] $x
echo [matches] $f
fi
rm -f /tmp/1.dump /tmp/2.dump
done
done
} | tee "$here/results"
rm -f $tmpf
rev=$(! grep -e " does not exist" -e "\[differs\]" $here/results >/dev/null)
exit $rev