summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfergus.henderson <fergus.henderson@01de4be4-8c4a-0410-9132-4925637da917>2008-07-30 22:56:39 +0000
committerfergus.henderson <fergus.henderson@01de4be4-8c4a-0410-9132-4925637da917>2008-07-30 22:56:39 +0000
commit0985bd7b9188524a151139abb725da09a72141e7 (patch)
tree35368a4a98d2992002c4b78232df3d05bab6a82b
parent2365d95ccfd74e4f62cea6a906cfd1bf543beb77 (diff)
downloaddistcc-0985bd7b9188524a151139abb725da09a72141e7.tar.gz
Add a test case to test "-MT" and "-MF" without spaces after them.
Some more bug fixes to make the test case pass. Also, make the DashWpMD_Case test a bit more strict: disable fallbacks, so that it tests that we can distribute such jobs. git-svn-id: http://distcc.googlecode.com/svn/trunk@574 01de4be4-8c4a-0410-9132-4925637da917
-rw-r--r--src/dotd.c2
-rw-r--r--src/serve.c2
-rw-r--r--src/strip.c5
-rwxr-xr-xtest/testdistcc.py23
4 files changed, 29 insertions, 3 deletions
diff --git a/src/dotd.c b/src/dotd.c
index 87b7c3b..8193ce5 100644
--- a/src/dotd.c
+++ b/src/dotd.c
@@ -204,6 +204,8 @@ int dcc_get_dotd_info(char **argv, char **dotd_fname,
if (strcmp(a, "-MF") == 0) {
++i;
deps_output = argv[i];
+ } else if (strncmp(a, "-MF", 3) == 0) {
+ deps_output = argv[i] + 3;
} else if (strcmp(a, "-o") == 0) {
has_dash_o = 1;
}
diff --git a/src/serve.c b/src/serve.c
index 217971a..bcb7a34 100644
--- a/src/serve.c
+++ b/src/serve.c
@@ -442,7 +442,7 @@ static int dcc_convert_mt_to_dotd_target(char **argv, char **dotd_target)
/* if we find -MT but only at the very end, that's an error. */
if (argv[i+1] == NULL) {
- rs_trace("found -MF at the end of the command line");
+ rs_trace("found -MT at the end of the command line");
return 1;
}
diff --git a/src/strip.c b/src/strip.c
index 43878ec..a01ec3d 100644
--- a/src/strip.c
+++ b/src/strip.c
@@ -104,7 +104,10 @@ int dcc_strip_local_args(char **from, char ***out_argv)
|| str_startswith("-U", from[from_i])
|| str_startswith("-I", from[from_i])
|| str_startswith("-l", from[from_i])
- || str_startswith("-L", from[from_i])) {
+ || str_startswith("-L", from[from_i])
+ || str_startswith("-MF", from[from_i])
+ || str_startswith("-MT", from[from_i])
+ || str_startswith("-MQ", from[from_i])) {
/* Something like "-DNDEBUG" or
* "-Wp,-MD,.deps/nsinstall.pp". Just skip this word */
;
diff --git a/test/testdistcc.py b/test/testdistcc.py
index bd2e3cd..6e6212d 100755
--- a/test/testdistcc.py
+++ b/test/testdistcc.py
@@ -1212,6 +1212,7 @@ class DashONoSpace_Case(CompileHello_Case):
else:
CompileHello_Case.runtest (self)
+
class WriteDevNull_Case(CompileHello_Case):
def runtest(self):
self.compile()
@@ -1378,11 +1379,30 @@ int main(void) {
def checkBuiltProgramMsgs(self, msgs):
self.assert_equal(msgs, "hello world\n")
+
+class DashMD_DashMF_DashMT_Case(CompileHello_Case):
+ """Test -MD -MFfoo -MTbar"""
+
+ def compileCmd(self):
+ return self.distcc_without_fallback() + _gcc + \
+ " -MD -MFdotd_filename -MTtarget_name_42 -o testtmp.o -c %s" % \
+ (self.sourceFilename())
+
+ def runtest(self):
+ try:
+ os.remove('dotd_filename')
+ except OSError:
+ pass
+ self.compile();
+ dotd_contents = open("dotd_filename").read()
+ self.assert_re_search("target_name_42", dotd_contents)
+
+
class DashWpMD_Case(CompileHello_Case):
"""Test -Wp,-MD,depfile"""
def compileCmd(self):
- return self.distcc() + _gcc + \
+ return self.distcc_without_fallback() + _gcc + \
" -c -Wp,-MD,depsfile -o testtmp.o testtmp.c"
def runtest(self):
@@ -1882,6 +1902,7 @@ tests = [
ScanArgs_Case,
ParseMask_Case,
DotD_Case,
+ DashMD_DashMF_DashMT_Case,
Compile_c_Case,
ImplicitCompilerScan_Case,
StripArgs_Case,