Giter VIP home page Giter VIP logo

win32-samples-rc-tests's Introduction

win32-samples-rc-tests

A test suite for alternate .rc compilers (resinator, windres, llvm-rc) using the Windows-classic-samples repository as the test corpus.

An overview of what this does:

  • setup.ps1 will modify things as necessary in the Windows-classic-samples submodule to get as many .rc files to compile as possible. This includes things like:
    • Adding files missing from the samples or the Windows SDK
    • Running other miscellaneous resource-adjacent compilers (mc.exe, midl.exe, uicc.exe, etc) to generate intermediate inputs used by .rc files
    • Converting some UTF-16 with BOM-encoded files to UTF-8/ASCII (since most preprocessors can't handle UTF-16)
  • test.ps1 will then run each .rc file through rc.exe to get the expected output, and then for each alternate RC compiler found, it will compile the .rc file and then compare the results to the rc.exe output. Any differences (.res output not byte-for-byte identical, missing compile error, unexpected compile error) are considered discrepancies and a report of all the discrepancies found is printed at the end of execution.

Results when testing with resinator, llvm-rc 16.0.3, and windres 2.38:

> .\test.ps1 -IncludeWin32WillCompileErrorFiles
Found RC compiler: resinator
Found RC compiler: windres
Found RC compiler: llvm-rc

Processed 485 .rc files

---------------------------
  resinator
---------------------------

485 .rc files processed without discrepancies
identical .res outputs:     460
expected compile errors:    25

---------------------------
  windres
---------------------------

395 .rc files processed with discrepancies
different .res outputs:     299
unexpected compile errors:  96
missing compile errors:     0

90 .rc files processed without discrepancies
identical .res outputs:     65
expected compile errors:    25

---------------------------
  llvm-rc
---------------------------

243 .rc files processed with discrepancies
different .res outputs:     89
unexpected compile errors:  154
missing compile errors:     0

242 .rc files processed without discrepancies
identical .res outputs:     217
expected compile errors:    25

---------------------------

See results.log for details about each file

Usage

setup.ps1

setup.ps1 must be run from one of the following in order to have access to all the necessary compilers:

  • 'Developer PowerShell for VS'
  • 'x86 Native Tools Command Prompt for VS'
  • An environment in which 'vcvars32.bat' has been executed

(note: it must be the 32-bit environment because uicc.exe and gc.exe are not present in the 64-bit environment)

test.ps1

Requires rc.exe to be somewhere in the PATH (see list above in setup.ps1 for easy ways to do this), as well as any of the alternate RC compilers you want to test.

Options:

  • -IncludePreprocessorQuirkFiles: Includes .rc files that are known to rely on a Win32 RC preprocessor quirk (like how splices are collapsed within string literals)
  • -IncludeWin32WillCompileErrorFiles: Includes .rc files that are known to cause compile errors when run through the Win32 rc.exe compiler. Most of these are files that have missing #includes that can't be salvaged via setup.ps1.
  • -ExcludeWindres: Don't test with windres even if it's found in the PATH
  • -ExcludeLLVMRC: Don't test with llvm-rc even if it's found in the PATH
  • -ExcludeResinator: Don't test with resinator even if it's found in the PATH
  • -ExcludeZigRC: Don't test with zig rc even if it's found in the PATH
  • -ExitOnRCFailure: Will cause the script to exit if rc.exe returns a non-zero exit code. Useful only when debugging setup.ps1 to add support for more .rc files
  • -ErrorOnAnyDiscrepancies: Will cause the script to exit with exit code 1 if any discrepancies are found. Useful when running in a CI environment
  • -ErrorOnAnyLikelyPanics: Will cause the script to exit with exit code 1 if any likely crashes/panics are found. Useful when running in a CI environment

clean.ps1

clean.ps1 can be run to 'reset' the state of the Windows-classic-samples submodule (remove all changes, untracked files, etc). Requires git to be on the PATH

win32-samples-rc-tests's People

Contributors

squeek502 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.