Test running of jobs.
[whenjobs.git] / tests / jobs / Makefile.am
diff --git a/tests/jobs/Makefile.am b/tests/jobs/Makefile.am
new file mode 100644 (file)
index 0000000..f6d0580
--- /dev/null
@@ -0,0 +1,61 @@
+# whenjobs
+# Copyright (C) 2012 Red Hat Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+EXTRA_DIST = test_run.sh $(TESTS)
+
+TESTS_ENVIRONMENT = ./test_run.sh
+TESTS = t100_counter.ml t101_updown.ml
+
+OCAMLPACKAGES = -package unix,num,camlp4.lib,calendar,rpc -I ../../lib
+
+OCAMLCFLAGS = -g -warn-error CDEFLMPSUVYZX $(OCAMLPACKAGES)
+OCAMLOPTFLAGS = $(OCAMLCFLAGS)
+
+PP = -pp '$(CAMLP4O) ../../lib/pa_when.cmo'
+
+# Rules for all OCaml files.
+%.cmi: %.mli ../../lib/pa_when.cmo
+       $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) $(PP) -c $< -o $@
+%.cmo: %.ml ../../lib/pa_when.cmo
+       $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) $(PP) -c $< -o $@
+#%.cmx: %.ml ../../lib/pa_when.cmo
+#      $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) $(PP) -c $< -o $@
+
+SUFFIXES = .cmo .cmi .cmx .ml .mli .mll .mly
+
+# OCaml dependencies.
+depend: .depend
+
+.depend: $(SOURCES)
+       rm -f $@ $@-t
+       $(OCAMLFIND) ocamldep $(PP) $^ | \
+         $(SED) -e 's/ *$$//' | \
+         $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \
+         LANG=C sort > $@-t
+       mv $@-t $@
+
+-include .depend
+
+# Useful for debugging: print the generated AST for the tests.
+print:
+       @for f in $(check_SCRIPTS); do \
+         b=`basename $$f .cmo`; \
+         echo "Test: $$b.ml"; \
+         camlp4o ../../lib/pa_when.cmo -printer pr_o.cmo $$b.ml; \
+       done
+
+CLEANFILES = *.cmi *.cmo *.cmx *.cma *.cmxa *~