Skip to content

Commit

Permalink
* added test to confirm whether system_exec returns the return value …
Browse files Browse the repository at this point in the history
…from a program that returns 15.
  • Loading branch information
shawnpringle committed Oct 22, 2019
1 parent 3e93b93 commit 6bc0549
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
11 changes: 9 additions & 2 deletions source/Makefile.wat
Original file line number Diff line number Diff line change
Expand Up @@ -524,9 +524,16 @@ testeu : .SYMBOLIC $(TRUNKDIR)\tests\ecp.dat $(EU_INTERPRETER_FILES) $(EU_CORE_

!endif #EUPHORIA

test : .SYMBOLIC $(BUILDDIR)\eubind.exe $(TRUNKDIR)\tests\ecp.dat $(FULLBUILDDIR)\eu.$(LIBEXT) $(BUILDDIR)\eub.exe $(BUILDDIR)\euc.exe

$(BUILDDIR)\return15.exe: return15.c
owcc return15.c
wlink SYS nt libfile return15.o name $(BUILDDIR)\return15.exe


test : .SYMBOLIC $(BUILDDIR)\return15.exe $(BUILDDIR)\eubind.exe $(TRUNKDIR)\tests\ecp.dat $(FULLBUILDDIR)\eu.$(LIBEXT) $(BUILDDIR)\eub.exe $(BUILDDIR)\euc.exe
cd ..\tests
set EUCOMPILEDIR=$(TRUNKDIR)
set EUCOMPILEDIR=$(TRUNKDIR)

-$(EUTEST) $(TEST_EXTRA) $(VERBOSE_TESTS) -i ..\include -cc wat -eui $(FULLBUILDDIR)\eui.exe -euc $(FULLBUILDDIR)\euc.exe -lib $(FULLBUILDDIR)\eu.$(LIBEXT) -bind $(FULLBUILDDIR)\eubind.exe -eub $(BUILDDIR)\eub.exe -log $(LIST) $(TESTFILE)
$(EUTEST) -process-log > $(BUILDDIR)/test-report.txt
$(EUTEST) -process-log -html > $(BUILDDIR)/test-report.html
Expand Down
3 changes: 3 additions & 0 deletions source/return15.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
int main() {
return 15;
}
19 changes: 19 additions & 0 deletions tests/t_retval.e
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
include std/unittest.e
include std/filesys.e
include std/io.e
include std/utils.e

constant full_cl = command_line()
constant exe = full_cl[1]
puts(1, exe & 10)
constant build_dir = pathname(exe)
puts(1, build_dir & 10)
constant proposed_return15 = build_dir & SLASH & "return15.exe"
puts(1,proposed_return15 & 10)
constant return15_in_same_dir_as_eui = file_exists(proposed_return15)

test_true("return15.exe was found", return15_in_same_dir_as_eui)
constant return15exe = proposed_return15
test_equal("Program that returns 15", 15, system_exec( sprintf("..\\source\\build\\return15.exe", {}), 2 ))

test_report()

0 comments on commit 6bc0549

Please sign in to comment.