Skip to content
Snippets Groups Projects
Makefile 3.29 KiB
Newer Older
Erwan Jahier's avatar
Erwan Jahier committed
NL="----------------------------------------------------------------------\\n"
filter_line=grep -v Opening\ file
OK_LUS=$(shell find should_work -name "*.lus" -print | LC_ALL=C sort -n)
KO_LUS=$(shell find should_fail -name "*.lus" -print | LC_ALL=C sort -n)
LIC=$(shell find should_work -name "*.lic" -print | LC_ALL=C sort -n)
tgz:
	tar cvfz lustre_non_reg_files.tgz should_work should_fail

lic:
	echo "generate all possible lic files"
	for d in ${OK_LUS}; do \
		echo -e "\n$(NL)====> $(LC2) $$d -o $$d.lic " ;\
		$(LC2) $$d -o $$d.lic ;\
	done

xxx:
	echo "reentrant ?"
	for d in ${LIC}; do \
		echo -e "\n$(NL)====> $(LC2) $$d  " ;\
		$(LC2) $$d > /dev/null ;\
	done


begin:
	echo "Non-regression tests" > test_ok.res
	echo "Those tests are supposed to generate errors" > test_ko.res


FILTER= grep -v "file was generated by" | grep -v " on "
	$(LC) do_not_exist.lus | $(FILTER) >> test_ko.res 2>&1 || true

same_file:
	$(LC) should_work/NONREG/ex.lus should_work/NONREG/ex.lus >> test_ok.res 2>&1

Erwan Jahier's avatar
Erwan Jahier committed
test_lic: begin unit help version do_not_exist same_file
	for d in ${OK_LUS}; do \
		echo -e "\n$(NL)====> $(LC) $$d" >> test_ok.res; \
	done; \
	for d in ${KO_LUS}; do \
		echo -e  "\n$(NL)====> $(LC) $$d" >> test_ko.res; \
	rm -f test.res ; cat test_ok.res test_ko.res  | $(FILTER) > test.res ;\
	diff -u test.res.exp test.res > test.diff || \
		(cat test.diff ; echo "cf test.diff"; exit 1)
Erwan Jahier's avatar
Erwan Jahier committed
utest_lic:
Erwan Jahier's avatar
Erwan Jahier committed
errors_nb:
	echo -e "There were $(shell grep Error test_ok.res | wc -l) errors."
	echo -e "There were $(shell grep Warning test_ok.res | wc -l) Warnings."
Erwan Jahier's avatar
Erwan Jahier committed

errors:errors_nb
	echo -e "There were $(shell grep Warning test_ok.res | wc -l) Warnings."
	grep Warning test_ok.res || true
	echo -e "There were $(shell grep Error test_ok.res | wc -l) errors."
	grep "*** Error" test_ok.res
Erwan Jahier's avatar
Erwan Jahier committed



test_ec: 
	rm test_ec.res
	for d in ${OK_LUS}; do \
		echo -e "\n$(NL)====> $(LC) -ec $$d -o /tmp/xx.ec" >> test_ec.res; \
		$(LC0) -ec $$d -o /tmp/xx.ec >> test_ec.res 2>&1 ;\
		echo -e "ec2c /tmp/xx.ec" >> test_ec.res; \
		(ec2c /tmp/xx.ec >> test_ec.res 2>&1 && echo -n "ok ") || echo " KO!";\
	done; \
	diff -u test_ec.res.exp test_ec.res > test_ec.diff || \
		(cat test_ec.diff ; echo "cf test_ec.diff"; exit 1)
test_lv4: 
	rm test_lv4.res || echo "";
	for d in ${OK_LUS}; do \
		echo -e "\n$(NL)====> $(LC) -lv4 $$d -o /tmp/xx.lus" >> test_lv4.res; \
		$(LC0) -lv4 $$d -o /tmp/xx.lus >> test_lv4.res 2>&1 ;\
		for node in `lusinfo /tmp/xx.lus nodes`; do \
			echo -e "lus2ec /tmp/xx.lus $$node" >> test_lv4.res; \
			(lus2ec /tmp/xx.lus $$node >> \
				test_lv4.res 2>&1 && echo -n "ok ") \
			|| echo " KO!";\
		done; \
	done; \
	diff -u test_lv4.res.exp test_lv4.res > test_lv4.diff || \
		(cat test_lv4.diff ; echo "cf test_lv4.diff"; exit 1)


utest_lv4:
	cp test_lv4.res test_lv4.res.exp 

Erwan Jahier's avatar
Erwan Jahier committed
test: test_lic test_ec test_lv4
utest: utest_lic utest_ec utest_lv4
clean:
	for d in ${ALL_LUS}; do \
		rm $$d.lic; \
	done