Closed Bug 1014804 Opened 7 years ago Closed 7 years ago

gtest_filter option in './mach gtest' not working


(Firefox Build System :: General, defect)

Not set


(Not tracked)



(Reporter: botond, Assigned: mstange)




(1 file)

./mach help gtest has the following option:

  gtest_filter          test_filter is a ':'-separated list of wildcard
                        patterns (called the positive patterns),optionally
                        followed by a '-' and another ':'-separated pattern
                        list (called the negative patterns).

However, calling './mach gtest <filter>' has no effect (it does the same thing as just './mach gtest' would), while calling

  GTEST_FILTER=<filter> MOZ_RUN_GTEST=1 <objdir>/dist/bin/firefox

with the same <filter> works correctly. This suggests that something in the build system is not propagating the filter correctly.
This happens because GTestCommands::gtest in does

    def gtest(self, shuffle, jobs, gtest_filter, tbpl_parser):

        # We lazy build gtest because it's slow to link
        self._run_make(directory="testing/gtest", target='gtest', ensure_exit_code=True)

        app_path = self.get_binary_path('app')

        # Use GTest environment variable to control test execution
        # For details see:
        gtest_env = {b'GTEST_FILTER': gtest_filter}


and bug 844852 changed the gtest make target to not only build but also run the tests. I don't know why that didn't result in "mach gtest" running the tests twice over here; probably because I currently have one failing test in my tree, which might have caused self._run_make to throw an exception.
Blocks: 844852
Attachment #8434097 - Flags: review?(bgirard) → review+
Comment on attachment 8434097 [details] [diff] [review]
make the gtest target only build and not run gtests

Since this is a Makefile, I suppose I also need a review from a build peer?
Attachment #8434097 - Flags: review?(ted)
Comment on attachment 8434097 [details] [diff] [review]
make the gtest target only build and not run gtests

Review of attachment 8434097 [details] [diff] [review]:

Seems unfortunate to duplicate that, but they're right next to each other so ehh. When we get these into the test package we can make it better.
Attachment #8434097 - Flags: review?(ted) → review+
Assignee: nobody → mstange
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.