Below is the file 'tests/t_rcfile_dir.at' from this revision. You can also download the file.
AT_SETUP([--rcfile=directory])
MONOTONE_SETUP
AT_CHECK(mkdir gongolo)
# write two files and check that they will be invoked in alphabetic order
AT_DATA(gongolo/aaa.rc, [function paraponzi()
io.write("BOOGA BOOGA")
end
paraponzi()
])
AT_DATA(gongolo/bbb.rc, [function labellagigogin()
io.write("CICCA CICCA")
end
labellagigogin()
])
# note: rcfile is placed outside workdir
AT_CHECK(MONOTONE setup alt_wrk, [], [ignore], [ignore])
AT_CHECK(cd alt_wrk && MONOTONE --root=. --rcfile=../gongolo status, [], [stdout], [ignore])
AT_CHECK(grep -q "BOOGA BOOGACICCA CICCA" stdout)
# write a third file: should be read beetween the two previous ones
AT_DATA(gongolo/aba.rc, [function notwowithoutthree()
io.write("hu hu")
end
notwowithoutthree()
])
AT_CHECK(cd alt_wrk && MONOTONE --root=. --rcfile=../gongolo status, [], [stdout], [ignore])
AT_CHECK(grep -q "BOOGA BOOGAhu huCICCA CICCA" stdout)
AT_CLEANUP