Explorar o código

activated automated test

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@53697 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler %!s(int64=12) %!d(string=hai) anos
pai
achega
292c21cbe5
Modificáronse 3 ficheiros con 27 adicións e 0 borrados
  1. 17 0
      lib/cdhc/Makefile
  2. 3 0
      lib/cdhc/c-drive.c.txt
  3. 7 0
      lib/cdhc/test_numbers.csv

+ 17 - 0
lib/cdhc/Makefile

@@ -1,7 +1,24 @@
 MODULE_TOPDIR = ../..
 
+include $(MODULE_TOPDIR)/include/Make/Vars.make
+
+MOD_OBJS := $(filter-out test.o port_test.o,$(AUTO_OBJS))
+
 LIB = CDHC
 
 include $(MODULE_TOPDIR)/include/Make/Lib.make
 
 default: lib
+	@echo "==============TEST============="
+ifeq ($(strip $(CROSS_COMPILING)),)
+	$(MAKE) test
+endif
+
+test: $(OBJDIR)/test$(EXE)
+	cd $(OBJDIR) && $(call run_grass,./test < ../test_numbers.csv)
+
+#  Test functions
+$(OBJDIR)/test$(EXE): $(OBJDIR)/test.o $(CDHCDEP)
+	$(call linker)
+
+$(OBJDIR)/test$(EXE): LIBES = $(CDHCLIB)

+ 3 - 0
lib/cdhc/c-drive.c.txt

@@ -40,8 +40,11 @@ int main(int argc, char **argv)
     y = watson_u2_exp(x, n);
     y = anderson_darling_exp(x, n);
     y = chi_square_exp(x, n);
+
+/* missing from source code:
     y = mod_maxlik_ratio(x, n);
     y = coeff_variation(x, n);
+*/
     y = kotz_families(x, n);
 
     return EXIT_SUCCESS;

+ 7 - 0
lib/cdhc/test_numbers.csv

@@ -0,0 +1,7 @@
+1234.2
+3454
+23423
+234
+23423
+3678
+67873.5