Skip to content

Commit

Permalink
checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
aappleby committed Mar 26, 2024
1 parent 25aadec commit 4f95cc0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
8 changes: 7 additions & 1 deletion tests/header_changed.hancho
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
from hancho import *

rules = load("rules.hancho")
build_config.defaults(
command_path = Path.cwd(),
source_path = Path.cwd(),
build_path = Path.cwd() / "build",
)

rules = load("rules.hancho", build_config)
rules.compile_cpp("src/test.cpp")
28 changes: 14 additions & 14 deletions tests/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,20 +197,20 @@ def test_doesnt_create_output(self):
run_hancho("doesnt_create_output")
self.assertFalse(path.exists("build/result.txt"))

# def test_header_changed(self):
# """Changing a header file tracked in the GCC depfile should trigger a rebuild"""
# run_hancho("header_changed")
# mtime1 = mtime("build/src/test.o")
#
# run_hancho("header_changed")
# mtime2 = mtime("build/src/test.o")
#
# Path("src/test.hpp").touch()
# run_hancho("header_changed")
# mtime3 = mtime("build/src/test.o")
# self.assertEqual(mtime1, mtime2)
# self.assertLess(mtime2, mtime3)
#
def test_header_changed(self):
"""Changing a header file tracked in the GCC depfile should trigger a rebuild"""
run_hancho("header_changed")
mtime1 = mtime("build/src/test.o")

run_hancho("header_changed")
mtime2 = mtime("build/src/test.o")

Path("src/test.hpp").touch()
run_hancho("header_changed")
mtime3 = mtime("build/src/test.o")
self.assertEqual(mtime1, mtime2)
self.assertLess(mtime2, mtime3)

# def test_input_changed(self):
# """Changing a source file should trigger a rebuild"""
# run_hancho("input_changed")
Expand Down

0 comments on commit 4f95cc0

Please sign in to comment.