+%{__make} %{makeopts}
+
+%if %{with tests}
+%{__make} %{makeopts} -C tests/aapits
+%{__make} %{makeopts} -C tests/aapits/asl \
+ ASL=$(pwd)/generate/unix/bin/iasl
+%{__make} %{makeopts} -C tests/templates
+
+cd tests
+
+# ASL tests
+./aslts.sh # relies on non-zero exit
+[ $? -eq 0 ] || exit 1
+
+# API tests
+cd aapits/bin
+./aapitsrun
+[ $? -eq 0 ] || exit 1
+cd ../..
+
+# misc tests
+#./run-misc-tests.sh $RPM_BUILD_ROOT%{_bindir} %{version}
+
+# Template tests
+cd templates
+if [ -f diff.log ]; then
+ if [ -s diff.log ]; then
+ # implies errors occurred
+ exit 1
+ fi
+fi
+cd ..
+%endif
+