Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
rainers committed Jun 17, 2013
1 parent b872c49 commit 2e3db13
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/compilable/extra-files/test6461/a.d
@@ -0,0 +1,4 @@
module a;
import tmpl;
TypeInfo fun() { return typeid(Tmpl!int()); }

4 changes: 4 additions & 0 deletions test/compilable/extra-files/test6461/b.d
@@ -0,0 +1,4 @@
module b;
import tmpl;
TypeInfo fun() { return typeid(Tmpl!long()); }

6 changes: 6 additions & 0 deletions test/compilable/extra-files/test6461/main.d
@@ -0,0 +1,6 @@
import a, b;
void main() {
auto t1 = a.fun();
auto t2 = b.fun();
assert(t1 != t2);
}
4 changes: 4 additions & 0 deletions test/compilable/extra-files/test6461/tmpl.d
@@ -0,0 +1,4 @@
module tmpl;
struct Tmpl(T) {
T a;
}
24 changes: 24 additions & 0 deletions test/compilable/test6461.sh
@@ -0,0 +1,24 @@
#!/usr/bin/env bash

name=`basename $0 .sh`
dir=${RESULTS_DIR}/compilable
src=compilable/extra-files/test6461

dmd -lib -od${dir} -I${src} ${src}/a.d || exit 1
dmd -lib -od${dir} -I${src} ${src}/b.d || exit 1

if [ "${OS}" == "win32" -o "${OS}" == "Windows_NT" ]; then

dmd -od${dir} -I${src} ${src}/main.d ${dir}/a.lib ${dir}/b.lib || exit 1
rm -f ${dir}/a.lib
rm -f ${dir}/b.lib
rm -f ${dir}/main.obj
rm -f ${dir}/main.exe
else
dmd -od${dir} -I${src} ${src}/main.d -L-la -L-lb || exit 1

rm -f ${dir}/liba.a
rm -f ${dir}/libb.a
rm -f ${dir}/main.o
rm -f ${dir}/main
fi

0 comments on commit 2e3db13

Please sign in to comment.