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
40
41
42
43
44
45
46

47
48
49
50
51
52
53
39
40
41
42
43
44
45

46
47
48
49
50
51
52
53







-
+







		cd tcc && $(shell cd $(srcdir) && pwd)/tcc/configure $(TCC_CONFIGURE_OPTS); \
	fi

tcc/libtcc.a: tcc/config.h
	$(MAKE) -C tcc libtcc.a

tcc/libtcc1.a: tcc/config.h
	-if [ '@build@' = '@host@' ]; then $(MAKE) -C tcc tcc; fi
	-$(MAKE) -C tcc tcc@EXEEXT@
	$(MAKE) -C tcc libtcc1.a

tcc4tcl.o: $(srcdir)/tcc4tcl.c $(srcdir)/tcc/tcc.h $(srcdir)/tcc/libtcc.h tcc/config.h
	$(CC) $(CPPFLAGS) $(CFLAGS) -o tcc4tcl.o -c $(srcdir)/tcc4tcl.c

tcc4tcl.@SHOBJEXT@: tcc4tcl.o tcc/libtcc.a
	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(SHOBJLDFLAGS) -o tcc4tcl.@SHOBJEXT@ tcc4tcl.o tcc/libtcc.a $(LIBS)
93
94
95
96
97
98
99
100

101
102
103
104
105
106
107
93
94
95
96
97
98
99

100
101
102
103
104
105
106
107







-
+







	-if [ "$(PACKAGE_VERSION)" = '@@VERS@@' ]; then cd __TMP__/* && ( \
		for file in tcc4tcl.tcl pkgIndex.tcl; do \
			sed 's/@@VERS@@/0.0/g' "$${file}" > "$${file}.new"; \
			cat "$${file}.new" > "$${file}"; \
			rm -f "$${file}.new"; \
		done \
	); fi
	$(TCLSH) $(srcdir)/test.tcl __TMP__
	if [ '@build@' = '@host@' ]; then TCC4TCL_TEST_RUN_NATIVE=1; export TCC4TCL_TEST_RUN_NATIVE; fi; $(TCLSH) $(srcdir)/test.tcl __TMP__
	echo Tests Completed OK > TEST-STATUS
	rm -rf __TMP__

clean:
	rm -f tcc4tcl.o
	rm -f tcc4tcl.@SHOBJEXT@ tcc4tcl-static.a
	rm -f tcc4tcl.@SHOBJEXT@.a tcc4tcl.@SHOBJEXT@.def

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

75
76
77
78
79
80
81

82
83
84
85
86
87
88
89









90
91
92
93
94
95
96
97
98
99

100
101
102
103
104
105
106
107
108
109
110












75
76
77
78
79
80
81
82








83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102











103
104
105
106
107
108
109
110
111
112
113
114







+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+










+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
puts [test6 1]

## Delete without performing
set handle [tcc4tcl::new]
$handle delete

# External functions (requires .a files)
if {[info exists ::env(TCC4TCL_TEST_RUN_NATIVE)]} {
set handle [tcc4tcl::new]
$handle ccode {const char *curl_version(void);}
$handle cproc curl_version {} vstring
$handle add_library_path /usr/lib64
$handle add_library_path /usr/lib
$handle add_library curl
$handle go
puts [curl_version]
	set handle [tcc4tcl::new]
	$handle ccode {const char *curl_version(void);}
	$handle cproc curl_version {} vstring
	$handle add_library_path /usr/lib64
	$handle add_library_path /usr/lib
	$handle add_library curl
	$handle go
	puts [curl_version]
}

# wide values
set handle [tcc4tcl::new]
$handle cproc wideTest {Tcl_WideInt x} Tcl_WideInt {
	return(x);
}
$handle go
puts [wideTest 30]

# Produce a loadable object
if {[info exists ::env(TCC4TCL_TEST_RUN_NATIVE)]} {
set tmpfile "/tmp/DELETEME_tcc4tcl_test_exec[expr rand()].so"
file delete $tmpfile
set handle [tcc4tcl::new $tmpfile "myPkg 0.1"]
$handle cproc ext_add {int a int b} long { return(a+b); }
$handle add_library_path /usr/lib64
$handle add_library_path /usr/lib
$handle add_library tclstub8.5
$handle go
load $tmpfile myPkg
puts [ext_add 1 42]
file delete $tmpfile
	set tmpfile "/tmp/DELETEME_tcc4tcl_test_exec[expr rand()].so"
	file delete $tmpfile
	set handle [tcc4tcl::new $tmpfile "myPkg 0.1"]
	$handle cproc ext_add {int a int b} long { return(a+b); }
	$handle add_library_path /usr/lib64
	$handle add_library_path /usr/lib
	$handle add_library tclstub8.5
	$handle go
	load $tmpfile myPkg
	puts [ext_add 1 42]
	file delete $tmpfile
}