Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions test/t/test_make.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
import os
import sys

import pytest

from conftest import assert_complete


class TestMake:
@pytest.fixture
def remove_extra_makefile(self, bash):
yield
# For some reason macos make doesn't actually create extra_makefile
if sys.platform != "darwin":
os.remove(f"{bash.cwd}/make/extra_makefile")

@pytest.mark.complete("make -f Ma", cwd="make")
def test_1(self, completion):
assert completion == "kefile"

@pytest.mark.complete("make .", cwd="make", require_cmd=True)
def test_2(self, bash, completion):
def test_2(self, bash, completion, remove_extra_makefile):
"""Hidden targets."""
assert completion == ".cache/ .test_passes".split()
os.remove(f"{bash.cwd}/make/extra_makefile")

@pytest.mark.complete("make .cache/", cwd="make", require_cmd=True)
def test_3(self, bash, completion):
def test_3(self, bash, completion, remove_extra_makefile):
assert completion == ".cache/1 .cache/2".split()
os.remove(f"{bash.cwd}/make/extra_makefile")

@pytest.mark.complete("make ", cwd="shared/empty_dir")
def test_4(self, completion):
Expand All @@ -30,24 +36,20 @@ def test_5(self, completion):
assert completion

@pytest.mark.complete("make ", cwd="make", require_cmd=True)
def test_6(self, bash, completion):
def test_6(self, bash, completion, remove_extra_makefile):
assert completion == "all clean extra_makefile install sample".split()
os.remove(f"{bash.cwd}/make/extra_makefile")

@pytest.mark.complete("make .cache/.", cwd="make", require_cmd=True)
def test_7(self, bash, completion):
def test_7(self, bash, completion, remove_extra_makefile):
assert completion == ".cache/.1 .cache/.2".split()
os.remove(f"{bash.cwd}/make/extra_makefile")

@pytest.mark.complete("make -C make ", require_cmd=True)
def test_8(self, bash, completion):
def test_8(self, bash, completion, remove_extra_makefile):
assert completion == "all clean extra_makefile install sample".split()
os.remove(f"{bash.cwd}/make/extra_makefile")

@pytest.mark.complete("make -nC make ", require_cmd=True)
def test_8n(self, bash, completion):
def test_8n(self, bash, completion, remove_extra_makefile):
assert completion == "all clean extra_makefile install sample".split()
os.remove(f"{bash.cwd}/make/extra_makefile")

@pytest.mark.complete("make -", require_cmd=True)
def test_9(self, completion):
Expand Down
Loading