Skip to content

Commit

Permalink
Added testscript
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@723 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
henjo committed Feb 11, 2002
1 parent af48c1c commit c39a2a8
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 38 deletions.
36 changes: 0 additions & 36 deletions modeq/test_codegen/Makefile
Expand Up @@ -12,39 +12,3 @@ ODIR = obj
BDIR = bin


MOFILES = \
algorithm_for1.mo \
algorithm_if1.mo \
algorithm_while1.mo \
expression_if1.mo \
expression_matrix_vector_product1.mo \
expression_range1.mo

TARGETS = $(MOFILES:.mo=)
OBJS = $(MOFILES:%.mo=%.main.o)
GENC = $(MOFILES:%.mo=%.c)

all : $(MOFILES:.mo=)


$(TARGETS) : % : %.main.o
gcc -o $@ $(LDFLAGS) $< -lc_runtime

$(OBJS) : %.main.o : %.c main.c
@echo compiling $(subst .main.o,,$@)
@$(CC) $(CFLAGS) \
-DCFILE_TO_INCLUDE="\"$(subst .main.o,.c,$@)\""\
-DCFUNCTION_TO_CALL="$(subst .main.o,,$@)_read_call_write"\
-c -o $@ main.c

.SUFFIXES: .mo


.mo.c:
@$(MODEQ) $< +d=codegen > $(<:.mo=.c)

clean :
rm -f $(TARGETS)
rm -f $(OBJS)
rm -f $(GENC)
rm -f *~
2 changes: 1 addition & 1 deletion modeq/test_codegen/Makefile.single
Expand Up @@ -8,7 +8,7 @@
MODEQ=../modeq
CC=gcc

CFLAGS= -Wall -ansi -pedantic -g -I../../c_runtime
CFLAGS= -W -Wall -ansi -pedantic-errors -Werror -g -I../../c_runtime

LDFLAGS= -L../../c_runtime -lm

Expand Down
14 changes: 14 additions & 0 deletions modeq/test_codegen/input_variable_size_array.mo
@@ -0,0 +1,14 @@

function input_variable_size_array

input Real[:] x;
output Real[size(x,1)] y;

algorithm

y := x;

end input_variable_size_array;

model mo
end mo;
2 changes: 1 addition & 1 deletion modeq/test_codegen/misc_simplex2.mo
Expand Up @@ -72,7 +72,7 @@ algorithm


if (q < M+1) and (p < N+1) then
a := pivot(a,p,q);
a := pivot2(a,p,q);
end if;

end while;
Expand Down
21 changes: 21 additions & 0 deletions modeq/test_codegen/rtest.sh
@@ -0,0 +1,21 @@
#!/sw/gnu/bin/bash

function do_one()
{

if make -f Makefile.single TARGET=${mo/%.mo/} clean all > /dev/null 2> /dev/null;
then echo OK;
else echo failed;
fi


}

points='....................................................... '

for mo in *.mo; do {
echo -n ${mo} ${points:${#mo}} ' '
do_one


} done

0 comments on commit c39a2a8

Please sign in to comment.