Commit Graph

6 Commits

Author SHA1 Message Date
Marco Bubke
ada5ea1952 UnitTests: Fix names and disable slow tests by default
Slow and very slow tests have now their own test category. We add SlowTest
for tests which are slower than ~5ms and VerySlowTest if they are slower
than ~100ms. They are disabled them by "-*SlowTest.*". If you have a faster
machine than most developers simply try lower values. The aim is that most
developers can execute the tests in under ~2s.

In the long run we should use dependency breaking and data sharing to
reduce the count of the slow tests.

Change-Id: I8578071258d7f89b2052709f3dd526ced811483f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2017-01-04 12:35:52 +00:00
Nikolai Kosjar
4fbdbdb1ee Clang: Fix delayed reparse of dirty and visible but not current documents
1. Open document foo.h
2. Create a split and open foo.cpp (#including "foo.h")
3. Edit foo.h (e.g. by introducing a syntax error, so that foo.cpp will
   indicate header errors in the toolbar or as info bar)
=> Actual: foo.cpp will be reparsed immediately.
 Expected: foo.cpp should be reparsed after a delay.

This saves resources (cpu time) and minimizes poping up of the header
info bar while editing header files in splits.

Regression introduced by

    commit 380d756a03
    Clang: Hook up supportive translation unit on first edit

Change-Id: Ib5fd90e49415dfc3aefacab7cd627b0e1937f5fc
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-10-18 11:39:01 +00:00
Nikolai Kosjar
bf5c1cc4fb Clang: Avoid duplicate jobs without changes in-between
This could happen, e.g. with this message order:

  >>> updateTranslationUnitsForEditor()
  add job<1>
  run job<1>
  >>> updateVisibleTranslationUnits(Utf8String(), {})
  >>> updateVisibleTranslationUnits(path, {path})
  add job<2>
  finish job<1>
  run job<2> -- Ops, nothing is changed but job<2> is started

This led to an outdated translation unit (e.g. wrong highlighting).

Now JobQueue checks for duplicates in the queue and checks all the
currently running jobs.

Change-Id: I05843fddcbd21ce0489681c283227c0027ded428
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-10-10 12:37:20 +00:00
Nikolai Kosjar
380d756a03 Clang: Hook up supportive translation unit on first edit
Parsing happens rotationally on the translation units.

The recently parsed translation unit is used for completion jobs while
the older version is used for parse jobs.

Advantages:
  A1. A completion job cannot be blocked anymore by currently running
      parse job.
  A2. Faster triggering of parse jobs. A reparse was triggered about
      1650ms after the last keystroke. This is down to 500ms now since we
      do not have a blocking translation unit for the completion anymore.

Disadvantages:
  D1. Memory consumption is doubled for an edited document.
      This could be addressed by suspending the second translation unit
      after some time of inactivity.
  D2. Setup of the supportive translation unit takes some time.

Change-Id: I958c883c01f274530f5482c788c15cd38d6f4c3e
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-10-10 12:36:59 +00:00
Nikolai Kosjar
c12d01fb41 Clang: Add job queue for each document
...in preparation for follow-up changes. This will enable e.g. a timer
per document.

This does not change any behavior yet.

Change-Id: Ic1dc06de602373c666d47ce7a95ab99e56d389d5
Reviewed-by: David Schulz <david.schulz@qt.io>
2016-10-10 12:35:35 +00:00
Marco Bubke
47c01daeb2 UnitTest: Cleanup
Improve naming and introduce googletest.h.

Change-Id: I445c13db4c23d6dd5682ce0db3b83055cc6b8a89
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-09-19 15:17:54 +00:00