Closed Bug 1281918 Opened 4 years ago Closed 4 years ago

make runcpptunittests filter out non-executable files when given a directory

Categories

(Testing :: General, defect)

defect
Not set

Tracking

(firefox50 fixed)

RESOLVED FIXED
mozilla50
Tracking Status
firefox50 --- fixed

People

(Reporter: froydnj, Assigned: froydnj)

Details

Attachments

(1 file)

When runcppunittest (resp. |mach cppunittest|) is passed a directory, it
attempts to indiscriminately run all the files found in that directory.
This is unhelpful, as directories containing compiled cppunittests also
tend to have other things: Makefiles, object files, etc.  Let's filter
out non-executable files from the directory listing and make the user
experience more pleasant.
Giving this to Chris as it looks like he's reviewed some code in this area
before and it vaguely intersects with the build system.  I don't think this
should affect automation runs, as those should run directly from the manifest
file.
Attachment #8764721 - Flags: review?(cmanchester)
Comment on attachment 8764721 [details] [diff] [review]
make runcppunittests filter out non-executable files when given a directory

Review of attachment 8764721 [details] [diff] [review]:
-----------------------------------------------------------------

::: testing/runcppunittests.py
@@ +205,5 @@
>                      mp.read(os.path.join(p, 'cppunittest.ini'))
>                  except IOError:
> +                    files = [os.path.abspath(os.path.join(p, x)) for x in os.listdir(p)]
> +                    tests.extend([(f, 1) for f in files
> +                                  if os.access(f, os.R_OK | os.X_OK)])

I don't think the "[]" are necessary here.
Attachment #8764721 - Flags: review?(cmanchester) → review+
Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/a83f7715e54a
make runcppunittests filter out non-executable files when given a directory; r=chmanchester
https://hg.mozilla.org/mozilla-central/rev/a83f7715e54a
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
You need to log in before you can comment on or make changes to this bug.