testsuite: Add some make test cases.

This commit is contained in:
Igor Murzov 2011-11-08 04:00:46 +03:00
parent fff412b2f2
commit d48d9ebd2f
4 changed files with 44 additions and 2 deletions

16
test/fixtures/make/Makefile vendored Normal file
View File

@ -0,0 +1,16 @@
NAME := sample
.PHONY: all
all: $(NAME)
$(NAME): sample.c
cc -o $@ $^
.PHONY: install
install: all
mkdir -p /usr/bin
install -m 755 $(NAME) /usr/bin
.PHONY: clean
clean:
-rm -f $(NAME)

View File

7
test/fixtures/make/sample.c vendored Normal file
View File

@ -0,0 +1,7 @@
#include <stdio.h>
int main(void)
{
puts("Hello, world!");
return 0;
}

View File

@ -4,14 +4,33 @@ proc setup {} {
proc teardown {} {
assert_env_unmodified
assert_env_unmodified {/OLDPWD=/d}
}
setup
assert_complete_any "make "
set test "-f Ma<TAB> should complete \"Makefile\""
set dir $::srcdir/fixtures/make
assert_complete_dir "Makefile" "make -f Ma" $dir $test
sync_after_int
set test "\"make <TAB>\" should complete targets"
set dir $::srcdir/fixtures/make
set targets "all sample install clean"
assert_complete_dir $targets "make " $dir $test
sync_after_int
set test "\"make <TAB>\" should not show anything in directory without makefile"
set dir $::srcdir/fixtures/make/empty_dir
assert_complete_dir "" "make " $dir $test
sync_after_int