view tests/test-hghave.t @ 28639:64ed9f904532

tests: fix for failure of test-convert-p4-filetypes.t Before this patch, test-convert-p4-filetypes.t fails (at least with 2015.2/1366233 version of p4/p4d), because some files below are omitted in expected output for revision 1. - file_tempobj - file_xtempobj These files are: - add-ed at revision 0, and - edit-ed at revision 1 According to perforce command reference below, file type 'tempobj' and 'xtempobj' imply '+S' modifier, which indicates that "Only the head revision is stored". This means that these files should appear only in the most recent revision (= revision 1). https://www.perforce.com/perforce/doc.current/manuals/cmdref/file.types.html BTW, test-convert-p4-filetypes.t with 2015.2/1366233 version of p4/p4d fails similarly also at recent revisions for hgext/convert/p4.py in 2015. Therefore, this patch should be reviewed by perforce guru, to examine whether this failure depends on version (and/or configuration) of p4/p4d or not.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Sat, 26 Mar 2016 12:55:52 +0900
parents 342ab95a1f4b
children 5af78c524f34
line wrap: on
line source

Testing that hghave does not crash when checking features

  $ hghave --test-features 2>/dev/null

Testing hghave extensibility for third party tools

  $ cat > hghaveaddon.py <<EOF
  > import hghave
  > @hghave.check("custom", "custom hghave feature")
  > def has_custom():
  >     return True
  > EOF

(invocation via run-tests.py)

  $ cat > test-hghaveaddon.t <<EOF
  > #require custom
  >   $ echo foo
  >   foo
  > EOF
  $ run-tests.py $HGTEST_RUN_TESTS_PURE test-hghaveaddon.t
  .
  # Ran 1 tests, 0 skipped, 0 warned, 0 failed.

(invocation via command line)

  $ unset TESTDIR
  $ hghave custom

(terminate with exit code 2 at failure of importing hghaveaddon.py)

  $ rm hghaveaddon.*
  $ cat > hghaveaddon.py <<EOF
  > importing this file should cause syntax error
  > EOF

  $ hghave custom
  failed to import hghaveaddon.py from '.': invalid syntax (hghaveaddon.py, line 1)
  [2]