Skip to content

Commit 06a7197

Browse files
authored
Enable lit by default. (#5133)
* Enable lit by default. * Update README for git user bin. * Add DXC_DISABLE_LIT to replace DXC_ENABLE_LIT * Set -DDXC_DISABLE_LIT=Off for appveyor. * Keep original name for ClangSPIRVTests * Set correct path for unit tests binary. * Remove doc about DXC_DISABLE_LIT * Remove extra space. * Remove DxcOnUnix.rst.
1 parent 58d3053 commit 06a7197

File tree

12 files changed

+21
-175
lines changed

12 files changed

+21
-175
lines changed

.github/workflows/coverage-gh-pages.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Install dependencies
3535
run: sudo apt install -y ninja-build
3636
- name: Configure
37-
run: cmake -B build -G Ninja -DLLVM_PARALLEL_LINK_JOBS=1 -DLLVM_USE_LINKER=lld -DCMAKE_BUILD_TYPE=Release -DDXC_USE_LIT=On -DDXC_COVERAGE=On -C ${{github.workspace}}/cmake/caches/PredefinedParams.cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ${{github.workspace}}
37+
run: cmake -B build -G Ninja -DLLVM_PARALLEL_LINK_JOBS=1 -DLLVM_USE_LINKER=lld -DCMAKE_BUILD_TYPE=Release -DDXC_COVERAGE=On -C ${{github.workspace}}/cmake/caches/PredefinedParams.cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ${{github.workspace}}
3838
- name: Build
3939
run: ninja -C build test-depends
4040
- name: Test

CMakeSettings.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"configurationType": "RelWithDebInfo",
77
"buildRoot": "${projectDir}\\out\\build\\${name}",
88
"installRoot": "${projectDir}\\out\\install\\${name}",
9-
"cmakeCommandArgs": "-DDXC_USE_LIT=On -C ${projectDir}\\cmake\\caches\\PredefinedParams.cmake -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_LIT_ARGS=\"-v\"",
9+
"cmakeCommandArgs": "-C ${projectDir}\\cmake\\caches\\PredefinedParams.cmake -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_LIT_ARGS=\"-v\"",
1010
"buildCommandArgs": "-v",
1111
"ctestCommandArgs": "",
1212
"inheritEnvironments": [ "msvc_x64_x64" ]
@@ -17,7 +17,7 @@
1717
"configurationType": "Debug",
1818
"buildRoot": "${projectDir}\\out\\build\\${name}",
1919
"installRoot": "${projectDir}\\out\\install\\${name}",
20-
"cmakeCommandArgs": "-DDXC_USE_LIT=On -C ${projectDir}\\cmake\\caches\\PredefinedParams.cmake -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_LIT_ARGS=\"-v\"",
20+
"cmakeCommandArgs": "-C ${projectDir}\\cmake\\caches\\PredefinedParams.cmake -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_LIT_ARGS=\"-v\"",
2121
"buildCommandArgs": "-v",
2222
"ctestCommandArgs": "",
2323
"inheritEnvironments": [ "msvc_x64_x64" ]
@@ -28,7 +28,7 @@
2828
"configurationType": "RelWithDebInfo",
2929
"buildRoot": "${projectDir}\\out\\build\\${name}",
3030
"installRoot": "${projectDir}\\out\\install\\${name}",
31-
"cmakeCommandArgs": "-DDXC_USE_LIT=On -C ${projectDir}\\cmake\\caches\\PredefinedParams.cmake -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_LIT_ARGS=\"-v\"",
31+
"cmakeCommandArgs": "-C ${projectDir}\\cmake\\caches\\PredefinedParams.cmake -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_LIT_ARGS=\"-v\"",
3232
"buildCommandArgs": "-v",
3333
"ctestCommandArgs": "",
3434
"inheritEnvironments": [ "msvc_x86_x64" ]
@@ -39,10 +39,10 @@
3939
"configurationType": "Debug",
4040
"buildRoot": "${projectDir}\\out\\build\\${name}",
4141
"installRoot": "${projectDir}\\out\\install\\${name}",
42-
"cmakeCommandArgs": "-DDXC_USE_LIT=On -C ${projectDir}\\cmake\\caches\\PredefinedParams.cmake -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_LIT_ARGS=\"-v\"",
42+
"cmakeCommandArgs": "-C ${projectDir}\\cmake\\caches\\PredefinedParams.cmake -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_LIT_ARGS=\"-v\"",
4343
"buildCommandArgs": "-v",
4444
"ctestCommandArgs": "",
4545
"inheritEnvironments": [ "msvc_x86_x64" ]
4646
}
4747
]
48-
}
48+
}

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,10 @@ Building on windows additionally requires:
6262

6363
> A new experimental simplified build and test workflow is documented [here](docs/BuildingAndTestingDXC.rst).
6464
65-
Note: If you intend to build from sources on Linux/macOS, follow [these instructions](docs/DxcOnUnix.rst).
6665

6766
Before you build, you will need to have some additional software installed. This is the most straightforward path - see [Building Sources](https://github.com/microsoft/DirectXShaderCompiler/wiki/Building-Sources) on the Wiki for more options, including Visual Studio 2015 and Ninja support.
6867

69-
* [Git](http://git-scm.com/downloads).
68+
* [Git](http://git-scm.com/downloads) - On Windows the Git command line tools must be added to the PATH in order to successfully build and test DXC.
7069
* [Python](https://www.python.org/downloads/) - version 3.x is required
7170
* [Visual Studio 2019](https://www.visualstudio.com/downloads) - select the following workloads:
7271
* Universal Windows Platform Development

appveyor.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,20 @@ before_build:
3838
- cmd: call utils\hct\hctstart %HLSL_SRC_DIR% %HLSL_BLD_DIR%
3939

4040
build_script:
41-
- cmd: call utils\hct\hctbuild -%PLATFORM% -%CONFIGURATION% -show-cmake-log -spirvtest -disable-lit
41+
- cmd: call utils\hct\hctbuild -%PLATFORM% -%CONFIGURATION% -show-cmake-log -spirvtest -enable-lit
4242
- sh: mkdir build && cd build
4343
- sh: cmake .. -GNinja -C ../cmake/caches/PredefinedParams.cmake -DSPIRV_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang-14 -DCMAKE_CXX_COMPILER=clang++-14 -DLLVM_ENABLE_WERROR=On
4444
- sh: ninja
4545

4646
test_script:
4747
- ps: utils\appveyor\appveyor_test.ps1
48-
- cmd: call utils\hct\hcttest -rel spirv_only -disable-lit
48+
- cmd: call utils\hct\hcttest -rel clang -enable-lit
4949
- sh: ./bin/dxc --help
5050
- sh: ./bin/dxc -T ps_6_0 ../tools/clang/test/CodeGenSPIRV/passthru-ps.hlsl2spv
5151
- sh: ./bin/dxc -T ps_6_0 -Fo passthru-ps.dxil ../tools/clang/test/CodeGenSPIRV/passthru-ps.hlsl2spv
5252
- sh: ./bin/dxc -T ps_6_0 -Fo passthru-ps.spv ../tools/clang/test/CodeGenSPIRV/passthru-ps.hlsl2spv -spirv
53-
- sh: ./bin/clang-spirv-tests --spirv-test-root ../tools/clang/test/CodeGenSPIRV/
54-
- sh: ./bin/ClangHLSLTests --HlslDataDir $PWD/../tools/clang/test/HLSL/
53+
- sh: ./tools/clang/unittests/SPIRV/ClangSPIRVTests --spirv-test-root ../tools/clang/test/CodeGenSPIRV/
54+
- sh: ./tools/clang/unittests/HLSL/ClangHLSLTests --HlslDataDir $PWD/../tools/clang/test/HLSL/
5555

5656
after_test:
5757
# Collect artifacts for Windows

azure-pipelines.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ stages:
108108
displayName: 'Installing dependencies'
109109
condition: eq(variables['image'], variables['macOS'])
110110
- bash: |
111-
cmake -B build -G Ninja $BUILD_SOURCESDIRECTORY -DLLVM_LIT_ARGS=--xunit-xml-output=testresults.xunit.xml -DDXC_USE_LIT=On -C $BUILD_SOURCESDIRECTORY/cmake/caches/PredefinedParams.cmake -DSPIRV_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=$(configuration) -DCMAKE_C_COMPILER=$(CC) -DCMAKE_CXX_COMPILER=$(CXX) $(CMAKE_OPTS)
111+
cmake -B build -G Ninja $BUILD_SOURCESDIRECTORY -DLLVM_LIT_ARGS=--xunit-xml-output=testresults.xunit.xml -C $BUILD_SOURCESDIRECTORY/cmake/caches/PredefinedParams.cmake -DSPIRV_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=$(configuration) -DCMAKE_C_COMPILER=$(CC) -DCMAKE_CXX_COMPILER=$(CXX) $(CMAKE_OPTS)
112112
displayName: 'Running Cmake'
113113
- bash: |
114114
ninja -C build test-depends

cmake/caches/PredefinedParams.cmake

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ if (DXC_COVERAGE)
1212
set(LLVM_CODE_COVERAGE_TEST_TARGETS "check-all" CACHE STRING "")
1313
endif()
1414

15-
if (DXC_USE_LIT)
16-
set(LLVM_TEST_VALUE ON)
17-
else()
15+
# TODO: remove this option after switch to support lit only.
16+
if (DXC_DISABLE_LIT)
1817
set(LLVM_TEST_VALUE OFF)
18+
else()
19+
set(LLVM_TEST_VALUE ON)
1920
endif()
2021

2122
set(LLVM_INCLUDE_TESTS ${LLVM_TEST_VALUE} CACHE BOOL "")

docs/BuildingAndTestingDXC.rst

-11
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ Building and Testing DirectXShaderCompiler
1212
is complete on Linux and Unix platforms, but is incomplete but usable on
1313
Windows. Instructions for building on Windows are available in the repository
1414
`readme <https://github.com/microsoft/DirectXShaderCompiler/blob/main/README.md>`_.
15-
Instructions for the preexisting Linux and Unix workflow can be found here:
16-
:doc:`DxcOnUnix`
1715

1816
Introduction
1917
============
@@ -57,7 +55,6 @@ Open a Visual Stuido command prompt and run:
5755
.. code:: sh
5856
cmake <Repository Root> \
5957
-B <Path to Output> \
60-
-DDXC_USE_LIT=On \
6158
-C <Repository Root>/cmake/caches/PredefinedParams.cmake \
6259
-DCMAKE_BUILD_TYPE=<Build Type> \
6360
-G "Visual Studio 17 2022"
@@ -85,7 +82,6 @@ In your preferred terminal run:
8582
.. code:: sh
8683
cmake <Repository Root> \
8784
-B <Path to Output> \
88-
-DDXC_USE_LIT=On \
8985
-C <Repository Root>/cmake/caches/PredefinedParams.cmake \
9086
-DCMAKE_BUILD_TYPE=<Build Type> \
9187
-G Ninja
@@ -150,10 +146,3 @@ four commonly used option prefixes:
150146
code coverage reports. With this setting enabled the
151147
``generate-coverage-report`` target is added to the build which produces a
152148
static HTML page with code coverage analysis results.
153-
154-
**DXC_USE_LIT**:BOOL
155-
This option must be passed before the ``-C`` flag to set the PredefinedParams
156-
cache script because it is handled by the cache script. This option enables
157-
building DXC with the LLVM-LIT testing infrastructure enabled. This generates
158-
check targets for each sub-project (i.e. ``check-llvm``, ``check-clang``...),
159-
and a ``check-all`` target to build and run DXC's tests.

docs/DxcOnUnix.rst

-141
This file was deleted.

gcp-pipelines/x86_64-linux-clang.yml

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ steps:
1616
- '-DCMAKE_CXX_COMPILER=clang++'
1717
- '-DCMAKE_C_COMPILER=clang'
1818
- '-DCMAKE_INSTALL_PREFIX=artifacts'
19-
- '-DDXC_USE_LIT=ON'
2019
- '-DENABLE_SPIRV_CODEGEN=ON'
2120
- '-DSPIRV_BUILD_TESTS=ON'
2221
- '-DLLVM_ENABLE_WERROR=On'

tools/clang/unittests/SPIRV/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ target_include_directories(ClangSPIRVTests
4242
PRIVATE ${SPIRV_TOOLS_INCLUDE_DIR} ${DXC_EFFCEE_DIR})
4343

4444
if (NOT CLANG_INCLUDE_TESTS)
45-
set_target_properties(ClangSPIRVTests PROPERTIES OUTPUT_NAME clang-spirv-tests)
4645
set_output_directory(ClangSPIRVTests
4746
${LLVM_RUNTIME_OUTPUT_INTDIR} ${LLVM_LIBRARY_OUTPUT_INTDIR})
4847
endif()

utils/hct/hctbuild.cmd

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ set SPV_TEST=OFF
4242
set DXILCONV=ON
4343
set DXC_CMAKE_SYSTEM_VERSION=
4444
set SHOW_CMAKE_LOG=0
45-
set ENABLE_LIT=OFF
45+
set ENABLE_LIT=ON
4646
set WINSDK_MIN_VERSION=10.0.17763.0
4747
set INSTALL_DIR=
4848

utils/hct/hcttest.cmd

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ set TEST_DXILCONV_FILTER=
2727
set TEST_EXEC_FUTURE=0
2828
set TEST_EXTRAS=0
2929
set TEST_EXEC_REQUIRED=0
30-
set TEST_USE_LIT=0
30+
set TEST_USE_LIT=1
3131
set TEST_CLANG_FILTER=
3232
set TEST_EXEC_FILTER=ExecutionTest::*
3333
set LOG_FILTER=/logOutput:LowWithConsoleBuffering
@@ -332,12 +332,12 @@ if not "%DXIL_DLL_LOC%"=="" (
332332

333333
rem Begin SPIRV change
334334
if "%TEST_SPIRV%"=="1" (
335-
if not exist %BIN_DIR%\clang-spirv-tests.exe (
336-
echo clang-spirv-tests.exe has not been built. Make sure you run "hctbuild -spirvtest" first.
335+
if not exist %BIN_DIR%\ClangSPIRVTests.exe (
336+
echo ClangSPIRVTests.exe has not been built. Make sure you run "hctbuild -spirvtest" first.
337337
exit /b 1
338338
)
339339
echo Running SPIRV tests ...
340-
%BIN_DIR%\clang-spirv-tests.exe --spirv-test-root %HLSL_SRC_DIR%\tools\clang\test\CodeGenSPIRV
340+
%BIN_DIR%\ClangSPIRVTests.exe --spirv-test-root %HLSL_SRC_DIR%\tools\clang\test\CodeGenSPIRV
341341
if errorlevel 1 (
342342
echo Failure occured in SPIRV unit tests
343343
exit /b 1

0 commit comments

Comments
 (0)