# -*-Perl-*-
# $Id: general.in,v 1.4 2004/06/27 02:05:39 rockyb Exp $
$description = "The following checks general debugger operation.\n";

$details = "check debugger operations: print, examine, break\n";

return -1 if !"";
# TEST #1
# -------

open(MAKEFILE,"> $makefile");

# The Contents of the MAKEFILE ...

print MAKEFILE <<\EOF;
# Test #1 test Makefile for testing debugger operation
FOO=bar
BAZ=$(FOO)
all: foo
foo: baz
	@echo hi > /dev/null
	@exit 5
baz: 
	@echo ho > /dev/null
EOF
# END of Contents of MAKEFILE

close(MAKEFILE);

$debug_cmdfile = "$testpath.dbg";
open(DBG_CMDS,"> $debug_cmdfile");

# The Contents of the DEBUG COMMAND FILE ...

print DBG_CMDS <<\EOF;
# This is a comment.
print MAKE
examine $(BAZ)
list foo
break foo
step
continue
list foo
where
quit
EOF
# END of Contents of DEBUG COMMAND FILE

close(DBG_CMDS);

&run_make_with_options($makefile,"--debugger --basename-filenames",
                       &get_logfile, 0, $debug_cmdfile);

# Create the answer to what should be produced by this Makefile

$answer = '
work/debugger/general.mk:5: foo
makedb<0> 
work/debugger/general.mk:5: foo
makedb<1> (null):0 MAKE = $(MAKE_COMMAND)


work/debugger/general.mk:5: foo
makedb<2> bar

work/debugger/general.mk:5: foo
makedb<3> 
foo: baz
#  Implicit rule search has not been done.
#  File does not exist.
#  File has not been updated.
#  commands to execute (from `work/debugger/general.mk\', line 6):
	@echo hi > /dev/null
	@exit 5
	

work/debugger/general.mk:5: foo
makedb<4> Breakpoint on target foo set.

work/debugger/general.mk:5: foo
makedb<5> 
work/debugger/general.mk:8: baz
makedb<6> 
work/debugger/general.mk:6: foo
makedb<7> 
foo: baz
#  Implicit rule search has not been done.
#  Implicit/static pattern stem: `\'
#  File does not exist.
#  File has not been updated.
# automatic
# @ := foo
# automatic
# % := 
# automatic
# * := 
# automatic
# + := baz
# automatic
# | := 
# automatic
# < := baz
# automatic
# ^ := baz
# automatic
# ? := baz
# variable set hash-table stats:
# Load=8/32=25%, Rehash=0, Collisions=1/12=8%
#  commands to execute (from `work/debugger/general.mk\', line 6):
	@echo hi > /dev/null
	@exit 5
	

work/debugger/general.mk:6: foo
makedb<8> 
=>#0  foo at work/debugger/general.mk:6
  #1  all at work/debugger/general.mk:4

work/debugger/general.mk:6: foo
makedb<9> ';

# COMPARE RESULTS

&compare_output($answer,&get_logfile(1));
