-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdosemu.exp
46 lines (38 loc) · 1.08 KB
/
dosemu.exp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Board file for running DOS .com programs in DOSEMU.
load_generic_config "unix"
process_multilib_options ""
set_board_info compiler "[find_gcc]"
set_board_info ldflags "-Tdos-com.ld -lgcc -lc -ldos-com -lnosys"
set_board_info noargs 1
set_board_info gcc,stack_size 16000
rename prune_gcc_output prune_gcc_output_original
proc prune_gcc_output { text } {
regsub -all "(^|\n)\[^\n\]*: warning: target system does not support debug output\[^\n\]*" $text "" text
return prune_gcc_output_original $text
}
proc dosemu_load {dest prog args} {
global env
exec cp $prog $env(HERE)/testcase.com
set output ""
set result "unresolved"
set pid [spawn $env(HERE)/dosemu/bin/dosemu "--Flibdir" /usr/lib/dosemu "-dumb" $env(HERE)/run.bat testcase.com]
# set timeout 300
expect {
timeout {
exec kill $pid
}
eof {
set output $expect_out(buffer)
set status [check_for_board_status output]
if { $status != 0 } {
set result "fail"
set output ""
} else {
set result "pass"
}
}
}
catch { close }
wait
return [list $result $output]
}