Check-in [0e86072bec]
Overview
Comment:Updated to perform some tests only if we are not cross-compiling
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0e86072becc26b7150ff7c1ab94554aa6a8d7adf
User & Date: rkeene on 2014-06-23 02:44:10
Other Links: manifest | tags
Context
2014-06-23
02:49
Updated to not perform some tests on Darwin check-in: 6d4569b9da user: rkeene tags: trunk
02:44
Updated to perform some tests only if we are not cross-compiling check-in: 0e86072bec user: rkeene tags: trunk
02:31
Added test for external files check-in: 628ec5502b user: rkeene tags: trunk
Changes

Modified Makefile.in from [7a39a34a3e] to [e6a3711f94].

    39     39   		cd tcc && $(shell cd $(srcdir) && pwd)/tcc/configure $(TCC_CONFIGURE_OPTS); \
    40     40   	fi
    41     41   
    42     42   tcc/libtcc.a: tcc/config.h
    43     43   	$(MAKE) -C tcc libtcc.a
    44     44   
    45     45   tcc/libtcc1.a: tcc/config.h
    46         -	-if [ '@build@' = '@host@' ]; then $(MAKE) -C tcc tcc; fi
           46  +	-$(MAKE) -C tcc tcc@EXEEXT@
    47     47   	$(MAKE) -C tcc libtcc1.a
    48     48   
    49     49   tcc4tcl.o: $(srcdir)/tcc4tcl.c $(srcdir)/tcc/tcc.h $(srcdir)/tcc/libtcc.h tcc/config.h
    50     50   	$(CC) $(CPPFLAGS) $(CFLAGS) -o tcc4tcl.o -c $(srcdir)/tcc4tcl.c
    51     51   
    52     52   tcc4tcl.@SHOBJEXT@: tcc4tcl.o tcc/libtcc.a
    53     53   	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(SHOBJLDFLAGS) -o tcc4tcl.@SHOBJEXT@ tcc4tcl.o tcc/libtcc.a $(LIBS)
................................................................................
    93     93   	-if [ "$(PACKAGE_VERSION)" = '@@VERS@@' ]; then cd __TMP__/* && ( \
    94     94   		for file in tcc4tcl.tcl pkgIndex.tcl; do \
    95     95   			sed 's/@@VERS@@/0.0/g' "$${file}" > "$${file}.new"; \
    96     96   			cat "$${file}.new" > "$${file}"; \
    97     97   			rm -f "$${file}.new"; \
    98     98   		done \
    99     99   	); fi
   100         -	$(TCLSH) $(srcdir)/test.tcl __TMP__
          100  +	if [ '@build@' = '@host@' ]; then TCC4TCL_TEST_RUN_NATIVE=1; export TCC4TCL_TEST_RUN_NATIVE; fi; $(TCLSH) $(srcdir)/test.tcl __TMP__
   101    101   	echo Tests Completed OK > TEST-STATUS
   102    102   	rm -rf __TMP__
   103    103   
   104    104   clean:
   105    105   	rm -f tcc4tcl.o
   106    106   	rm -f tcc4tcl.@SHOBJEXT@ tcc4tcl-static.a
   107    107   	rm -f tcc4tcl.@SHOBJEXT@.a tcc4tcl.@SHOBJEXT@.def

Modified test.tcl from [589ff7a7d3] to [9a896e1896].

    75     75   puts [test6 1]
    76     76   
    77     77   ## Delete without performing
    78     78   set handle [tcc4tcl::new]
    79     79   $handle delete
    80     80   
    81     81   # External functions (requires .a files)
    82         -set handle [tcc4tcl::new]
    83         -$handle ccode {const char *curl_version(void);}
    84         -$handle cproc curl_version {} vstring
    85         -$handle add_library_path /usr/lib64
    86         -$handle add_library_path /usr/lib
    87         -$handle add_library curl
    88         -$handle go
    89         -puts [curl_version]
           82  +if {[info exists ::env(TCC4TCL_TEST_RUN_NATIVE)]} {
           83  +	set handle [tcc4tcl::new]
           84  +	$handle ccode {const char *curl_version(void);}
           85  +	$handle cproc curl_version {} vstring
           86  +	$handle add_library_path /usr/lib64
           87  +	$handle add_library_path /usr/lib
           88  +	$handle add_library curl
           89  +	$handle go
           90  +	puts [curl_version]
           91  +}
    90     92   
    91     93   # wide values
    92     94   set handle [tcc4tcl::new]
    93     95   $handle cproc wideTest {Tcl_WideInt x} Tcl_WideInt {
    94     96   	return(x);
    95     97   }
    96     98   $handle go
    97     99   puts [wideTest 30]
    98    100   
    99    101   # Produce a loadable object
   100         -set tmpfile "/tmp/DELETEME_tcc4tcl_test_exec[expr rand()].so"
   101         -file delete $tmpfile
   102         -set handle [tcc4tcl::new $tmpfile "myPkg 0.1"]
   103         -$handle cproc ext_add {int a int b} long { return(a+b); }
   104         -$handle add_library_path /usr/lib64
   105         -$handle add_library_path /usr/lib
   106         -$handle add_library tclstub8.5
   107         -$handle go
   108         -load $tmpfile myPkg
   109         -puts [ext_add 1 42]
   110         -file delete $tmpfile
          102  +if {[info exists ::env(TCC4TCL_TEST_RUN_NATIVE)]} {
          103  +	set tmpfile "/tmp/DELETEME_tcc4tcl_test_exec[expr rand()].so"
          104  +	file delete $tmpfile
          105  +	set handle [tcc4tcl::new $tmpfile "myPkg 0.1"]
          106  +	$handle cproc ext_add {int a int b} long { return(a+b); }
          107  +	$handle add_library_path /usr/lib64
          108  +	$handle add_library_path /usr/lib
          109  +	$handle add_library tclstub8.5
          110  +	$handle go
          111  +	load $tmpfile myPkg
          112  +	puts [ext_add 1 42]
          113  +	file delete $tmpfile
          114  +}