Skip to content
Snippets Groups Projects
Commit b5155a6c authored by hdgarrood's avatar hdgarrood Committed by Marge Bot
Browse files

Add new driver test for use of outdated .o files

This is something that's quite important for the correctness of the
incremental build system and doesn't appear to be tested currently; this
test fails on my hashing branch, whereas all of the other (non-perf)
tests pass.
parent 4cd98bd2
No related branches found
No related tags found
No related merge requests found
module B where
x :: Int
x = 2
module B where
x :: Int
x = 12
module C where
x :: Int
x = 3
module Main where
import qualified B
import qualified C
main = putStrLn $ show $ B.x + C.x
TOP=../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
# Recompilation test for when .hi files are up to date but .o files are
# not
clean:
rm -f Main *.o *.hi B.hs
recomp019: clean
cp B1.hs B.hs
echo 'first run'
'$(TEST_HC)' $(TEST_HC_OPTS) --make Main
./Main
# Update B.hs
cp B2.hs B.hs
# Update B.hi (but not B.o)
'$(TEST_HC)' $(TEST_HC_OPTS) --make B -fno-code -fwrite-interface
# Recompile
echo 'second run'
'$(TEST_HC)' $(TEST_HC_OPTS) --make Main
./Main
# Recompilation test for when .hi files are up to date but .o files are
# not
test('recomp019',
[extra_files(['Main.hs', 'B1.hs', 'B2.hs', 'C.hs'])],
makefile_test, [])
first run
[1 of 3] Compiling B ( B.hs, B.o )
[2 of 3] Compiling C ( C.hs, C.o )
[3 of 3] Compiling Main ( Main.hs, Main.o )
Linking Main ...
5
[1 of 1] Compiling B ( B.hs, nothing )
second run
[2 of 3] Compiling B ( B.hs, B.o )
Linking Main ...
15
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment