Commit Graph

65 Commits

Author SHA1 Message Date
Ryan Prichard
51e84a50d4 Reword a comment. 2015-10-24 02:34:00 -05:00
Ryan Prichard
f635afacaf Windows 8.1 fixed the INVALID_HANDLE_VALUE --> process handle bug.
* To version detect 8.1, we need GetVersionEx to return something greater
   than Windows 8, which requires creating an app manifest.  For now at
   least, put the manifest XML next to the EXE.  It can be built into the
   EXE, but this is good enough (at least for now).
2015-10-24 02:31:46 -05:00
Ryan Prichard
18f23f38c0 Checkpoint work on traditional and common tests.
* Add Test_CreateProcess_SpecialInherit

 * Add traditional Test_HandleDuplication

 * Make handle.dup() use a GetCurrentProcess() target while
   handle.dup(handle.worker()) uses a non-pseudo handle.
2015-10-24 01:58:16 -05:00
Ryan Prichard
7de7c6f76b Clarify document a bit. 2015-10-23 23:41:24 -05:00
Ryan Prichard
43db1ac585 Fix a couple of typos, reword a test comment, add a TODO comment. 2015-10-23 23:27:02 -05:00
Ryan Prichard
7e7b992cd6 Checkpoint a lot of work on the console-handles.md document. 2015-10-23 23:27:00 -05:00
Ryan Prichard
f22f856205 For brevity, add a special SpawnParams ctor for STARTF_USEHANDLES. 2015-10-23 23:27:00 -05:00
Ryan Prichard
2bb1ca205d Improve RemoteWorker and Event ctors.
* Allow creating a RemoteWorker object without spawning a new worker.
   It can be used like so:

   {
       Worker w(Worker::DoNotSpawn);
       if (...) {
           w = ...;
       } else {
           w = ...;
       }
   }

 * Remove the weird RemoteWorker(std::string) ctor.  The computation of the
   worker name should be inside the ctor.

 * It now becomes possible to initialize a RemoteWorker using syntax like:
      Worker w({ true, 0 });
   However, these are still ambiguous:
      Worker w({})  // could be move-init from a default-init Worker
      Worker w({1}) // could be move-init from a Worker(SpawnParams{1})

 * Make the Event ctor explicit.  The SpawnParams ctor needs to be
   non-explicit so it can be used with the braced initializer list.
2015-10-23 23:26:59 -05:00
Ryan Prichard
bbbea127e9 Remove a check from Test_InheritNothing so it works with CREATE_NO_WINDOW
* With this change, RemoteWorker can default to CREATE_NO_WINDOW instead
   of CREATE_NEW_CONSOLE, and the tests all still pass.
2015-10-23 23:26:58 -05:00
Ryan Prichard
2b146e9173 Expand common tests and refactor some code.
* Add Test_Active_ScreenBuffer_Order

 * Add Test_GetStdHandle_SetStdHandle

 * Also test a STARTF_USESTDHANDLES process in
   Test_Detach_Does_Not_Change_Standard_Handles.
2015-10-23 23:24:48 -05:00
Ryan Prichard
8e4b78c40b Test bInheritHandles=FALSE and PROC_THREAD_ATTRIBUTE_HANDLE_LIST combo.
* The API call fails.

 * Also refactor the PROC_THREAD_ATTRIBUTE_HANDLE_LIST tests a little.
2015-10-23 04:32:10 -05:00
Ryan Prichard
aec5e552b6 Expand common tests:
* Test combos of CREATE_NEW_CONSOLE, DETACHED_PROCESS, CREATE_NO_WINDOW.

 * Test use of PROC_THREAD_ATTRIBUTE_HANDLE_LIST.  It cannot be used with
   GetCurrentProcess(), but it also can't be used with traditional
   console handles.

 * Prefer nullptr over INVALID_HANDLE_VALUE.  Change ntHandlePointer.
2015-10-23 03:44:27 -05:00
Ryan Prichard
b3e95cd7de Start reorganizing the TestHandleInheritance test 2015-10-23 02:00:16 -05:00
Ryan Prichard
83c5e6de18 Propagate spawn GetLastError() so it can checked; print nice error messages 2015-10-23 00:00:37 -05:00
Ryan Prichard
1b71ef07cc Support PROC_THREAD_ATTRIBUTE_HANDLE_LIST and testing for spawn failure
* Also add a public Worker::exit() for killing workers more conveniently.

 * Previously, a Worker was either:
     (1) fully initialized and running (m_valid==true), or
     (2) moved out of (m_valid==false)
   Now RemoteWorker::trySpawn() can return an invalid RemoteWorker object.
2015-10-23 00:00:36 -05:00
Ryan Prichard
5ef3aa3a0b Remove an unnecessary line from the Vista BSOD test case. 2015-10-23 00:00:35 -05:00
Ryan Prichard
af9e06a71d Log the pipe handles in newPipe, and close the pipes in the host process 2015-10-23 00:00:34 -05:00
Ryan Prichard
abf54bc454 Add a function for querying an NT handle's underlying object pointer. 2015-10-22 19:03:49 -05:00
Ryan Prichard
38cc0bf3fe Reorganize buffer-tests/Makefile and permit tests that aren't checked in 2015-10-22 19:00:00 -05:00
Ryan Prichard
e3a148ccf5 Add notes on CREATE_NO_WINDOW to console-handles.md. 2015-10-22 18:48:48 -05:00
Ryan Prichard
0264277bcd Move more things from tests into the test harness. 2015-10-22 18:39:33 -05:00
Ryan Prichard
fb7a19c4f1 Split TestCommon -> Remote{Worker,Handle} and add TestCommon.h uber-header
* TestCommon.h is a convenience header for the test cases.  It aliases
   Remote{Worker,Handle} back to {Worker,Handle}, and it includes many
   basic C/C++ headers, as well as the parts of the harness suitable for
   test cases.
2015-10-22 18:16:47 -05:00
Ryan Prichard
6c5a5aa670 Rename Worker.cc->WorkerProgram.cc and WorkerApi.h->Command.h
* Fix some of the rules in the Makefile to use build/% instead of %
2015-10-22 17:47:35 -05:00
Ryan Prichard
fdeb2e5cb5 Add a comment to TestHandleInheritance 2015-10-22 17:34:06 -05:00
Ryan Prichard
c3484b5355 First draft of console-handles.md. 2015-10-22 17:34:05 -05:00
Ryan Prichard
55bea51430 Implement precompiled headers in misc/buffer-tests
* I'm still going to try to include what is used in each module.

 * At some point, I should implement these in the main project.  It will
   need more testing on the various compilers.  It really needs to be
   on-by-default everywhere.  If it's off, then at least pch.h should be
   included everywhere, to minimize configuration differences between my
   checkout and other people's checkouts.

 * There should be some way to configure it off to check whether includes
   are correct.

 * The change reduces build times from 27.6s to 15.2s on a single-core VM.
2015-10-22 03:18:47 -05:00
Ryan Prichard
2b7df627eb Expand the Test_AttachConsole_And_CreateProcess_Inheritance test a little 2015-10-22 03:18:46 -05:00
Ryan Prichard
a697017eb7 Allow Worker user to override CREATE_NEW_CONSOLE; reduce verbosity 2015-10-22 03:18:46 -05:00
Ryan Prichard
17f5f9e960 Rename getTitle to title, add consoleProcessList. 2015-10-21 23:11:37 -05:00
Ryan Prichard
3e4086cb39 Turn off -Wformat checking within buffer-tests so %I64x warnings stop 2015-10-21 23:10:56 -05:00
Ryan Prichard
cb1341b0ef Add a test for GetConsoleTitleW 2015-10-21 19:56:12 -05:00
Ryan Prichard
3575c55c8c Expand console handle testing for XP through Windows 7.
* The tests are mostly wrong for Windows 8 and up.
2015-10-21 19:56:06 -05:00
Ryan Prichard
3bf4703f6a Add tests of screen buffer handles. 2015-10-19 23:32:08 -05:00
Ryan Prichard
4d52166b8c Add OSVersion utility 2015-10-19 23:27:00 -05:00
Ryan Prichard
793957e17e Add more line-overwriting tests to color-test.sh. 2015-10-15 17:51:00 -05:00
Ryan Prichard
4338e7b687 Add a Bash script that tests terminal color handling 2015-10-13 04:09:44 -05:00
Ryan Prichard
208d084c81 Convert UnicodeWideTest1.cc from CRLF to LF for consistency.
The repository probably should be configured somehow to ensure line ending
consistency, particularly across Cygwin and MSYS git.
2015-10-12 04:33:40 -05:00
Ryan Prichard
a66de7dc28 Add more tests of full-width characters and rename one of the tests.
* Fix the -std=c++11 narrowing warnings in TestUtil.cc.
2015-10-11 22:44:22 -05:00
Ryan Prichard
31ee484b29 Add notes on fonts, code pages, and East Asian character widths 2015-10-10 19:25:20 -05:00
Ryan Prichard
085aa0a9f0 s/UnicodeTest1/Utf16Echo/ and output arbitrary UTF-16 codepoints. 2015-10-10 15:04:48 -05:00
Ryan Prichard
1ef25fb6c6 Fix UnicodeTest1 to work with TrueType fonts 2015-10-10 04:31:58 -05:00
Ryan Prichard
2751488f18 Fix a build failure 2015-10-10 03:30:58 -05:00
Ryan Prichard
c3701e60d9 Automatically test all three common fonts 2015-10-10 02:29:47 -05:00
Ryan Prichard
f5b15bf274 Fix UnicodeDoubleWidthTest font name output. 2015-10-10 02:22:53 -05:00
Ryan Prichard
fe26bfda5f Create a test program to explore the U+30FC width problem w/Lucida Console 2015-10-10 02:14:31 -05:00
Ryan Prichard
b0b79e1b1e Improve Unicode handling of SetFont arguments. 2015-10-09 18:52:20 -05:00
Ryan Prichard
5beb4c1cbb Add a new test program, QueryFont, and expand SetFont. 2015-10-09 17:42:18 -05:00
Ryan Prichard
44ee1cc7ea Updates to the UnicodeVariableWidthChars test program 2015-10-09 01:32:17 -05:00
Ryan Prichard
ac00ac8315 Updates to the UnicodeVariableWidthChars test program 2015-10-07 02:00:11 -05:00
Ryan Prichard
22164a090a Also print U+30FC and print it many times.
* With Lucida Console 10px, U+30FC is handled as a halfwidth character.
   With Lucida Console 12px, it is instead handled as a fullwidth
   character.
2015-10-06 23:51:12 -05:00