Skip to content

Commit

Permalink
Moved all tests on root folder, to the correct test folder
Browse files Browse the repository at this point in the history
  • Loading branch information
jefersonla committed Nov 14, 2016
1 parent cf44434 commit fcee7c7
Show file tree
Hide file tree
Showing 15 changed files with 296 additions and 3 deletions.
26 changes: 24 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ $(LEXICAL_EXECUTABLE): y.tab.c lex.yy.c $(LIBS_SRC) $(LIBS_HEADERS)
$(CC) $(CFLAGS) lex.yy.c $(LIBS_SRC) $(TODO_WARN) -o $(LEXICAL_EXECUTABLE) $(CFLAGS_LEXICAL) -D LEXICAL_ANALYSER

# Realiza os testes nos executaveis
check: lexical-test parser-test
check: lexical-test parser-test codegen-test
#test: lexical-test parser-test

# Executa todos os testes
Expand Down Expand Up @@ -146,6 +146,28 @@ parser-all-tests:
@bash test.sh $(PARSER_EXECUTABLE) tests/parser/simple.lua
@printf "\n-- Finished Parser All Tests-- \n"

# Executa os testes basicos para o codegen
codegen-test:
@bash test.sh simulate.sh tests/codegen/test1.lua
@printf "\n"

# Executa todos os testes para o codegen
codegen-all-tests:
@bash test.sh simulate.sh tests/codegen/test1.lua tests/codegen/test1.code.out tests/codegen/test1.lua.exp
@printf "\n"
@bash test.sh simulate.sh tests/codegen/test2.lua tests/codegen/test2.code.out tests/codegen/test2.lua.exp
@printf "\n"
@bash test.sh simulate.sh tests/codegen/test3.lua tests/codegen/test3.code.out tests/codegen/test3.lua.exp
@printf "\n"
@bash test.sh simulate.sh tests/codegen/test4.lua tests/codegen/test4.code.out tests/codegen/test4.lua.exp
@printf "\n"
@bash test.sh simulate.sh tests/codegen/test5.lua tests/codegen/test5.code.out tests/codegen/test5.lua.exp
@printf "\n"
@bash test.sh simulate.sh tests/codegen/test6.lua tests/codegen/test6.code.out tests/codegen/test6.lua.exp
@printf "\n"
@bash test.sh simulate.sh tests/codegen/test7.lua tests/codegen/test7.code.out tests/codegen/test7.lua.exp
@printf "\n"

# Parser extra
check-extra:
-rm -r tests/testing
Expand Down Expand Up @@ -193,4 +215,4 @@ package:
# Limpa o ambiente
clean:
@printf "Cleaning project folder...\n"
@\rm -rf *.yy.c *.yy.h *.tab.c *.tab.h tests/testing/* *.o $(EXECUTABLES) *.out tests/lexical/*.out tests/parser/*.out *.output pkg pkg.zip
@\rm -rf *.yy.c *.yy.h *.tab.c *.tab.h tests/testing/* *.o $(EXECUTABLES) *.out tests/lexical/*.out tests/parser/*.out tests/codegen/*.out tests/codegen/*.mips *.output pkg pkg.zip
File renamed without changes.
20 changes: 20 additions & 0 deletions tests/codegen/test1.lua.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
2
7
3
4
0
1
nil
23
1
0
1
0
0
1
0
1
0
0
12
888
File renamed without changes.
99 changes: 99 additions & 0 deletions tests/codegen/test2.lua.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
1
1
0
0
1
1
1111111111
1
0
0
1
1111111111
0
1
0
1
1111111111
-10
10
0
1
1
1000000000
1
0
0
1
5
6
6
0
1
1000000000
2
1
0
0
1
1111111111
1
0
0
1
1000000000
0
0
1
1
0
1212121212
2
5
6
1
0
1
0
1234567890
11
6
7
8
9
10
11
10
11
12
13
14
15
16
17
18
19
20
0
2
4
6
8
10
12
14
16
18
20
1234567890
45
45
45
45
1111111111
100
200
200
400
600
700
File renamed without changes.
29 changes: 29 additions & 0 deletions tests/codegen/test3.lua.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
10
11
12
1212121212
5
10
nil
20
1313131313
10
10
10
10
10
10
10
10
10
10
1414141414
12
14
16
18
1515151515
10
20
30
nil
2 changes: 1 addition & 1 deletion test4.lua → tests/codegen/test4.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ end
z()

-- For just a convention this is NIL! so if this number is used
print(2147483641) -- SHOULD BE PRINTED ... but it will only display nil :/
print(2147483641) -- SHOULD BE PRINTED
39 changes: 39 additions & 0 deletions tests/codegen/test4.lua.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
24
10
22
9
20
8
18
7
16
6
14
5
12
4
10
3
8
2
6
1
4
0
1222333444
0
3
6
9
1333444222
0
4
10
151553444
0
1
2
3
4
5
2147483641
File renamed without changes.
38 changes: 38 additions & 0 deletions tests/codegen/test5.lua.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
nil
10
10
nil
20
10
987654321
nil
40
10
123456789
nil
50
10
123456789
nil
60
10
123456789
nil
30
10
123456789
30
nil
nil
10
20
30
10
20
30
0
1
2
4
8
4
File renamed without changes.
32 changes: 32 additions & 0 deletions tests/codegen/test6.lua.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
11
6
7
8
9
10
11
nil
10
10
11
12
13
14
15
16
17
18
19
20
0
2
4
6
8
10
12
14
16
18
20
nil
File renamed without changes.
14 changes: 14 additions & 0 deletions tests/codegen/test7.lua.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
0
100
502
1100
10
30
25
30
40
nil
40
80
80
40

0 comments on commit fcee7c7

Please sign in to comment.