kopia lustrzana https://gitlab.com/sane-project/backends
				
				
				
			Update sanei_config_test to use full config path
This lets test pass even when ran from a different location. Also, added missing data files to distribution list. These two things lets this test case pass when ran using "make distcheck".merge-requests/1/head
							rodzic
							
								
									8b0e4257a9
								
							
						
					
					
						commit
						317626116f
					
				|  | @ -1,3 +1,12 @@ | |||
| 2013-08-16 Chris Bagwell <chris@cnpbagwell.com> | ||||
| 	* testsuite/sanei/Makefile.am: Add missing data files to distribution. | ||||
| 	Pass in $srcdir to sanei_config_test so it knows were data files are | ||||
| 	regardless of were ran from. | ||||
| 	* testsuite/sanei/sanei_config_test.c: Use full path for config | ||||
| 	file.  This allows "make distcheck" to work for this testcase | ||||
| 	since it uses a different build directory then source directory | ||||
| 	and also runs it from build directory. | ||||
| 
 | ||||
| 2013-08-15 Chris Bagwell <chris@cnpbagwell.com> | ||||
| 	* sanei/sanei_thread.c: Add support for winpthreads used by | ||||
| 	mingw64 in addition to preexisting support for pthread-win32 used | ||||
|  |  | |||
|  | @ -4,10 +4,16 @@ | |||
| ##  This file is part of the "Sane" build infra-structure.  See
 | ||||
| ##  included LICENSE file for license information.
 | ||||
| 
 | ||||
| EXTRA_DIST = data/boolean.conf data/empty.conf data/fixed.conf data/int.conf \
 | ||||
| 	     data/snapscan.conf data/string.conf data/string-list.conf \
 | ||||
| 	     data/umax_pp.conf data/word-array.conf data/wrong-boolean.conf \
 | ||||
| 	     data/wrong-fixed.conf data/wrong-range.conf \
 | ||||
| 	     data/wrong-string-list.conf | ||||
| 
 | ||||
| MATH_LIB = @MATH_LIB@ | ||||
| USB_LIBS = @USB_LIBS@ | ||||
| PTHREAD_LIBS = @PTHREAD_LIBS@ | ||||
| TEST_LDADD = ../../sanei/libsanei.la ../../lib/liblib.la ../../lib/libfelib.la $(MATH_LIB) $(USB_LIBS) $(PTHREAD_LIBS)  | ||||
| TEST_LDADD = ../../sanei/libsanei.la ../../lib/liblib.la ../../lib/libfelib.la $(MATH_LIB) $(USB_LIBS) $(PTHREAD_LIBS) | ||||
| 
 | ||||
| check_PROGRAMS = sanei_usb_test test_wire sanei_check_test sanei_config_test sanei_constrain_test | ||||
| TESTS = $(check_PROGRAMS) | ||||
|  | @ -18,6 +24,7 @@ sanei_constrain_test_SOURCES = sanei_constrain_test.c | |||
| sanei_constrain_test_LDADD = $(TEST_LDADD) | ||||
| 
 | ||||
| sanei_config_test_SOURCES = sanei_config_test.c | ||||
| sanei_config_test_CPPFLAGS = $(AM_CPPFLAGS) -DTESTSUITE_SANEI_SRCDIR=$(srcdir) | ||||
| sanei_config_test_LDADD = $(TEST_LDADD) | ||||
| 
 | ||||
| sanei_check_test_SOURCES = sanei_check_test.c | ||||
|  | @ -25,7 +32,7 @@ sanei_check_test_LDADD = $(TEST_LDADD) | |||
| 
 | ||||
| sanei_usb_test_SOURCES = sanei_usb_test.c | ||||
| sanei_usb_test_LDADD = $(TEST_LDADD) | ||||
|   | ||||
| 
 | ||||
| test_wire_SOURCES = test_wire.c | ||||
| test_wire_LDADD = $(TEST_LDADD) | ||||
| 
 | ||||
|  |  | |||
|  | @ -107,7 +107,8 @@ AM_V_lt = $(am__v_lt_@AM_V@) | |||
| am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) | ||||
| am__v_lt_0 = --silent | ||||
| am__v_lt_1 =  | ||||
| am_sanei_config_test_OBJECTS = sanei_config_test.$(OBJEXT) | ||||
| am_sanei_config_test_OBJECTS =  \
 | ||||
| 	sanei_config_test-sanei_config_test.$(OBJEXT) | ||||
| sanei_config_test_OBJECTS = $(am_sanei_config_test_OBJECTS) | ||||
| sanei_config_test_DEPENDENCIES = $(am__DEPENDENCIES_2) | ||||
| am_sanei_constrain_test_OBJECTS = sanei_constrain_test.$(OBJEXT) | ||||
|  | @ -559,12 +560,19 @@ target_alias = @target_alias@ | |||
| top_build_prefix = @top_build_prefix@ | ||||
| top_builddir = @top_builddir@ | ||||
| top_srcdir = @top_srcdir@ | ||||
| TEST_LDADD = ../../sanei/libsanei.la ../../lib/liblib.la ../../lib/libfelib.la $(MATH_LIB) $(USB_LIBS) $(PTHREAD_LIBS)  | ||||
| EXTRA_DIST = data/boolean.conf data/empty.conf data/fixed.conf data/int.conf \
 | ||||
| 	     data/snapscan.conf data/string.conf data/string-list.conf \
 | ||||
| 	     data/umax_pp.conf data/word-array.conf data/wrong-boolean.conf \
 | ||||
| 	     data/wrong-fixed.conf data/wrong-range.conf \
 | ||||
| 	     data/wrong-string-list.conf | ||||
| 
 | ||||
| TEST_LDADD = ../../sanei/libsanei.la ../../lib/liblib.la ../../lib/libfelib.la $(MATH_LIB) $(USB_LIBS) $(PTHREAD_LIBS) | ||||
| TESTS = $(check_PROGRAMS) | ||||
| AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_builddir)/include -I$(top_srcdir)/include | ||||
| sanei_constrain_test_SOURCES = sanei_constrain_test.c | ||||
| sanei_constrain_test_LDADD = $(TEST_LDADD) | ||||
| sanei_config_test_SOURCES = sanei_config_test.c | ||||
| sanei_config_test_CPPFLAGS = $(AM_CPPFLAGS) -DTESTSUITE_SANEI_SRCDIR=$(srcdir) | ||||
| sanei_config_test_LDADD = $(TEST_LDADD) | ||||
| sanei_check_test_SOURCES = sanei_check_test.c | ||||
| sanei_check_test_LDADD = $(TEST_LDADD) | ||||
|  | @ -643,7 +651,7 @@ distclean-compile: | |||
| 	-rm -f *.tab.c | ||||
| 
 | ||||
| @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanei_check_test.Po@am__quote@ | ||||
| @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanei_config_test.Po@am__quote@ | ||||
| @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanei_config_test-sanei_config_test.Po@am__quote@ | ||||
| @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanei_constrain_test.Po@am__quote@ | ||||
| @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanei_usb_test.Po@am__quote@ | ||||
| @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_wire.Po@am__quote@ | ||||
|  | @ -669,6 +677,20 @@ distclean-compile: | |||
| @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||||
| @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< | ||||
| 
 | ||||
| sanei_config_test-sanei_config_test.o: sanei_config_test.c | ||||
| @am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sanei_config_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sanei_config_test-sanei_config_test.o -MD -MP -MF $(DEPDIR)/sanei_config_test-sanei_config_test.Tpo -c -o sanei_config_test-sanei_config_test.o `test -f 'sanei_config_test.c' || echo '$(srcdir)/'`sanei_config_test.c | ||||
| @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/sanei_config_test-sanei_config_test.Tpo $(DEPDIR)/sanei_config_test-sanei_config_test.Po | ||||
| @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='sanei_config_test.c' object='sanei_config_test-sanei_config_test.o' libtool=no @AMDEPBACKSLASH@ | ||||
| @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||||
| @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sanei_config_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sanei_config_test-sanei_config_test.o `test -f 'sanei_config_test.c' || echo '$(srcdir)/'`sanei_config_test.c | ||||
| 
 | ||||
| sanei_config_test-sanei_config_test.obj: sanei_config_test.c | ||||
| @am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sanei_config_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sanei_config_test-sanei_config_test.obj -MD -MP -MF $(DEPDIR)/sanei_config_test-sanei_config_test.Tpo -c -o sanei_config_test-sanei_config_test.obj `if test -f 'sanei_config_test.c'; then $(CYGPATH_W) 'sanei_config_test.c'; else $(CYGPATH_W) '$(srcdir)/sanei_config_test.c'; fi` | ||||
| @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/sanei_config_test-sanei_config_test.Tpo $(DEPDIR)/sanei_config_test-sanei_config_test.Po | ||||
| @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='sanei_config_test.c' object='sanei_config_test-sanei_config_test.obj' libtool=no @AMDEPBACKSLASH@ | ||||
| @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||||
| @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sanei_config_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sanei_config_test-sanei_config_test.obj `if test -f 'sanei_config_test.c'; then $(CYGPATH_W) 'sanei_config_test.c'; else $(CYGPATH_W) '$(srcdir)/sanei_config_test.c'; fi` | ||||
| 
 | ||||
| mostlyclean-libtool: | ||||
| 	-rm -f *.lo | ||||
| 
 | ||||
|  |  | |||
|  | @ -14,8 +14,12 @@ | |||
| #include "../include/sane/sanei.h" | ||||
| #include "../include/sane/sanei_config.h" | ||||
| 
 | ||||
| #define XSTR(s) STR(s) | ||||
| #define STR(s) #s | ||||
| #define CONFIG_PATH XSTR(TESTSUITE_SANEI_SRCDIR) | ||||
| 
 | ||||
| /*
 | ||||
|  * variables and functions used by the tests below  | ||||
|  * variables and functions used by the tests below | ||||
|  */ | ||||
| 
 | ||||
| 
 | ||||
|  | @ -92,7 +96,8 @@ inexistent_config (void) | |||
|   config.count = 0; | ||||
|   config.descriptors = NULL; | ||||
|   config.values = NULL; | ||||
|   status = sanei_configure_attach ("data/inexistent.conf", &config, NULL); | ||||
|   status = sanei_configure_attach (CONFIG_PATH | ||||
|                                    "/data/inexistent.conf", &config, NULL); | ||||
| 
 | ||||
|   /* check results */ | ||||
|   assert (status != SANE_STATUS_GOOD); | ||||
|  | @ -108,7 +113,8 @@ null_config (void) | |||
|   SANE_Status status; | ||||
| 
 | ||||
|   status = | ||||
|     sanei_configure_attach ("data/umax_pp.conf", NULL, check_config_attach); | ||||
|     sanei_configure_attach (CONFIG_PATH "/data/umax_pp.conf", NULL, | ||||
|                             check_config_attach); | ||||
| 
 | ||||
|   /* check results */ | ||||
|   assert (status == SANE_STATUS_GOOD); | ||||
|  | @ -123,7 +129,8 @@ null_attach (void) | |||
| { | ||||
|   SANE_Status status; | ||||
| 
 | ||||
|   status = sanei_configure_attach ("data/umax_pp.conf", NULL, NULL); | ||||
|   status = sanei_configure_attach (CONFIG_PATH | ||||
|                                    "/data/umax_pp.conf", NULL, NULL); | ||||
| 
 | ||||
|   /* check results */ | ||||
|   assert (status == SANE_STATUS_GOOD); | ||||
|  | @ -143,7 +150,8 @@ empty_config (void) | |||
|   config.descriptors = NULL; | ||||
|   config.values = NULL; | ||||
|   status = | ||||
|     sanei_configure_attach ("data/empty.conf", &config, check_config_attach); | ||||
|     sanei_configure_attach (CONFIG_PATH "/data/empty.conf", | ||||
|                             &config, check_config_attach); | ||||
| 
 | ||||
|   /* check results */ | ||||
|   assert (status == SANE_STATUS_GOOD); | ||||
|  | @ -197,7 +205,8 @@ string_option (void) | |||
| 
 | ||||
|   /* configure and attach */ | ||||
|   status = | ||||
|     sanei_configure_attach ("data/string.conf", &config, check_config_attach); | ||||
|     sanei_configure_attach (CONFIG_PATH "/data/string.conf", | ||||
|                             &config, check_config_attach); | ||||
| 
 | ||||
|   /* check results */ | ||||
|   assert (status == SANE_STATUS_GOOD); | ||||
|  | @ -240,7 +249,8 @@ int_option (void) | |||
| 
 | ||||
|   /* configure and attach */ | ||||
|   status = | ||||
|     sanei_configure_attach ("data/int.conf", &config, check_config_attach); | ||||
|     sanei_configure_attach (CONFIG_PATH "/data/int.conf", &config, | ||||
|                             check_config_attach); | ||||
| 
 | ||||
|   /* check results */ | ||||
|   assert (status == SANE_STATUS_GOOD); | ||||
|  | @ -282,8 +292,8 @@ wrong_range_int_option (void) | |||
| 
 | ||||
|   /* configure and attach */ | ||||
|   status = | ||||
|     sanei_configure_attach ("data/wrong-range.conf", &config, | ||||
| 			    check_config_attach); | ||||
|     sanei_configure_attach (CONFIG_PATH "/data/wrong-range.conf", | ||||
|                             &config, check_config_attach); | ||||
| 
 | ||||
|   /* check results */ | ||||
|   assert (status == SANE_STATUS_INVAL); | ||||
|  | @ -325,8 +335,8 @@ word_array_option (void) | |||
| 
 | ||||
|   /* configure and attach */ | ||||
|   status = | ||||
|     sanei_configure_attach ("data/word-array.conf", &config, | ||||
| 			    check_config_attach); | ||||
|     sanei_configure_attach (CONFIG_PATH "/data/word-array.conf", | ||||
|                             &config, check_config_attach); | ||||
| 
 | ||||
|   /* check results */ | ||||
|   assert (status == SANE_STATUS_GOOD); | ||||
|  | @ -371,8 +381,8 @@ string_list_option (void) | |||
| 
 | ||||
|   /* configure and attach */ | ||||
|   status = | ||||
|     sanei_configure_attach ("data/string-list.conf", &config, | ||||
| 			    check_config_attach); | ||||
|     sanei_configure_attach (CONFIG_PATH "/data/string-list.conf", | ||||
|                             &config, check_config_attach); | ||||
| 
 | ||||
|   /* check results */ | ||||
|   assert (status == SANE_STATUS_GOOD); | ||||
|  | @ -416,7 +426,8 @@ wrong_string_list_option (void) | |||
| 
 | ||||
|   /* configure and attach */ | ||||
|   status = | ||||
|     sanei_configure_attach ("data/wrong-string-list.conf", &config, | ||||
|     sanei_configure_attach (CONFIG_PATH | ||||
|                             "/data/wrong-string-list.conf", &config, | ||||
| 			    check_config_attach); | ||||
| 
 | ||||
|   /* check results */ | ||||
|  | @ -551,8 +562,8 @@ umax_pp (void) | |||
| 
 | ||||
|   /* configure and attach */ | ||||
|   status = | ||||
|     sanei_configure_attach ("data/umax_pp.conf", &config, | ||||
| 			    check_config_attach); | ||||
|     sanei_configure_attach (CONFIG_PATH "/data/umax_pp.conf", | ||||
|                             &config, check_config_attach); | ||||
| 
 | ||||
|   /* check results */ | ||||
|   assert (status == SANE_STATUS_GOOD); | ||||
|  | @ -619,8 +630,8 @@ wrong_bool_option (void) | |||
| 
 | ||||
|   /* configure and attach */ | ||||
|   status = | ||||
|     sanei_configure_attach ("data/wrong-boolean.conf", &config, | ||||
| 			    check_config_attach); | ||||
|     sanei_configure_attach (CONFIG_PATH "/data/wrong-boolean.conf", | ||||
|                             &config, check_config_attach); | ||||
| 
 | ||||
|   /* check results */ | ||||
|   assert (status == SANE_STATUS_INVAL); | ||||
|  | @ -684,8 +695,8 @@ bool_option (void) | |||
| 
 | ||||
|   /* configure and attach */ | ||||
|   status = | ||||
|     sanei_configure_attach ("data/boolean.conf", &config, | ||||
| 			    check_config_attach); | ||||
|     sanei_configure_attach (CONFIG_PATH "/data/boolean.conf", | ||||
|                             &config, check_config_attach); | ||||
| 
 | ||||
|   /* check results */ | ||||
|   assert (status == SANE_STATUS_GOOD); | ||||
|  | @ -755,7 +766,8 @@ fixed_option (void) | |||
| 
 | ||||
|   /* configure and attach */ | ||||
|   status = | ||||
|     sanei_configure_attach ("data/fixed.conf", &config, check_config_attach); | ||||
|     sanei_configure_attach (CONFIG_PATH "/data/fixed.conf", | ||||
|                             &config, check_config_attach); | ||||
| 
 | ||||
|   /* check results */ | ||||
|   assert (status == SANE_STATUS_GOOD); | ||||
|  | @ -801,8 +813,8 @@ wrong_fixed_option (void) | |||
| 
 | ||||
|   /* configure and attach */ | ||||
|   status = | ||||
|     sanei_configure_attach ("data/wrong-fixed.conf", &config, | ||||
| 			    check_config_attach); | ||||
|     sanei_configure_attach (CONFIG_PATH "/data/wrong-fixed.conf", | ||||
|                             &config, check_config_attach); | ||||
| 
 | ||||
|   /* check results */ | ||||
|   assert (status == SANE_STATUS_INVAL); | ||||
|  | @ -839,8 +851,8 @@ snapscan (void) | |||
| 
 | ||||
|   /* configure and attach */ | ||||
|   status = | ||||
|     sanei_configure_attach ("data/snapscan.conf", &config, | ||||
| 			    check_config_attach); | ||||
|     sanei_configure_attach (CONFIG_PATH "/data/snapscan.conf", | ||||
|                             &config, check_config_attach); | ||||
| 
 | ||||
|   /* check results */ | ||||
|   assert (status == SANE_STATUS_GOOD); | ||||
|  |  | |||
		Ładowanie…
	
		Reference in New Issue
	
	 Chris Bagwell
						Chris Bagwell