Skip to content

Commit 3e925ee

Browse files
committed
add project test for intel-ipsec-mb isa-l_crypto isa-l
1 parent 5d65530 commit 3e925ee

File tree

6 files changed

+84
-11
lines changed

6 files changed

+84
-11
lines changed

test/Makefile.in

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ TESTS = $(wildcard *.asm)
1919
RM_F = rm -f
2020
RM_RF = rm -rf
2121

22-
.PHONY: tools nasm ndisasm ffmpegtest x264test dav1dtest
22+
.PHONY: tools nasm ndisasm ffmpegtest x264test dav1dtest intel-ipsec-mbtest isa-ltest isa-l_cryptotest
2323
tools:
2424
$(MAKE) -C .. all
2525

@@ -38,6 +38,15 @@ x264test:
3838
dav1dtest:
3939
bash projtest.sh '$(NASM)' $@
4040

41+
intel-ipsec-mbtest:
42+
bash projtest.sh '$(NASM)' $@
43+
44+
isa-ltest:
45+
bash projtest.sh '$(NASM)' $@
46+
47+
isa-l_cryptotest:
48+
bash projtest.sh '$(NASM)' $@
49+
4150
%.bin: %.asm $(NASM)
4251
$(NASM) $(NASMOPT) -f bin -o $@ -MD $@.dep -l $@.lst $<
4352

@@ -123,6 +132,7 @@ clean:
123132
$(RM_RF) testresults
124133
$(RM_F) elftest elftest64
125134
$(RM_RF) ffmpegtest x264test dav1dtest
135+
$(RM_RF) intel-ipsec-mbtest isa-ltest isa-l_cryptotest
126136

127137
spotless: clean
128138
$(RM_RF) golden
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
: >> "$filelist"
4+
5+
if [ -d intel-ipsec-mb/.git ]; then
6+
cd intel-ipsec-mb
7+
git reset --hard
8+
xargs -r rm -f < "$filelist"
9+
rm -rf build
10+
else
11+
git clone https://github.com/intel/intel-ipsec-mb.git
12+
cd intel-ipsec-mb
13+
fi
14+
15+
: > "$filelist"
16+
mkdir -p build
17+
cd build
18+
cmake ..
19+
cmake --build . --parallel

test/get_build_isa-l_cryptotest.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
: >> "$filelist"
4+
5+
if [ -d isa-l_crypto/.git ]; then
6+
cd isa-l_crypto
7+
git reset --hard
8+
xargs -r rm -f < "$filelist"
9+
make clean
10+
else
11+
git clone https://github.com/intel/isa-l_crypto.git isa-l_crypto
12+
cd isa-l_crypto
13+
fi
14+
: > "$filelist"
15+
make -f Makefile.unx -j

test/get_build_isa-ltest.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
: >> "$filelist"
4+
5+
if [ -d isa-l/.git ]; then
6+
cd isa-l
7+
git reset --hard
8+
xargs -r rm -f < "$filelist"
9+
make clean
10+
else
11+
git clone https://github.com/intel/isa-l.git isa-l
12+
cd isa-l
13+
fi
14+
: > "$filelist"
15+
make -f Makefile.unx -j

test/nasm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ done
3232
printf '%s\n' "$*" >> "$projnasm_logfile"
3333

3434
rm -f "$ofile"
35+
"$projnasm_nasm2" "${param2[@]}"
3536
"$projnasm_nasm1" "${param1[@]}" || exit $?
36-
"$projnasm_nasm2" "${param2[@]}" || exit $?
3737
if [ -f $ofile.1 ]; then
3838
cp -f "$ofile.1" "$ofile"
3939
fi

test/projtest.sh

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,37 +48,51 @@ if [ "$rev" -ne "0" ]; then
4848
fi
4949

5050
set +x
51+
tmpf=$(mktemp)
5152

5253
{
5354
for y in "o" "obj"
5455
do
5556
for x in $(grep -o -P "\-o .*\.${y}" $logfile | sed -e 's/-o //')
5657
do
58+
f=$x
5759
if ! [ -f $x ]; then
60+
b=$(basename $x)
61+
if find -name $b >/dev/null; then
62+
find -name $b >$tmpf
63+
while read -r line; do
64+
if [[ "$line" == *"$x" ]]; then
65+
f=$line
66+
fi
67+
done < "$tmpf"
68+
fi
69+
fi
70+
if ! [ -f $f ]; then
5871
# probably it's a temporary assembly being tested
5972
continue
6073
fi
61-
if ! [ -f ${x}.1 ]; then
62-
echo file ${x}.1 does not exist
74+
if ! [ -f ${f}.1 ]; then
75+
echo file ${f}.1 does not exist
6376
fi
6477

65-
if ! [ -f ${x}.2 ]; then
66-
echo file ${x}.2 does not exist
78+
if ! [ -f ${f}.2 ]; then
79+
echo file ${f}.2 does not exist
6780
fi
6881

69-
objdump -d ${x}.1 | tail -n +4 >/tmp/1.dump
70-
objdump -d ${x}.2 | tail -n +4 >/tmp/2.dump
82+
objdump -d ${f}.1 | tail -n +4 >/tmp/1.dump
83+
objdump -d ${f}.2 | tail -n +4 >/tmp/2.dump
7184
if ! diff /tmp/1.dump /tmp/2.dump >/dev/null; then
72-
echo [differs] $x
73-
#diff /tmp/1.dump /tmp/2.dump
85+
echo [differs] $f
86+
#diff -u /tmp/1.dump /tmp/2.dump
7487
else
75-
echo [matches] $x
88+
echo [matches] $f
7689
fi
7790
rm -f /tmp/1.dump /tmp/2.dump
7891
done
7992
done
8093
} | tee "$here/results"
8194

95+
rm -f $tmpf
8296
rev=$(! grep -e " does not exist" -e "\[differs\]" $here/results >/dev/null)
8397

8498
exit $rev

0 commit comments

Comments
 (0)