mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-06 14:19:59 -05:00
CMakeLibTests: Generate testConfig.h with source/build paths defined
And use it in all tests that had their particular files before.
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
# Render the header file with source path macro
|
||||
configure_file(testConfig.h.in testConfig.h @ONLY)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMake_BINARY_DIR}/Source
|
||||
@@ -65,10 +68,8 @@ if(WIN32)
|
||||
list(APPEND CMakeLib_TESTS
|
||||
testVisualStudioSlnParser.cxx
|
||||
)
|
||||
configure_file(testVisualStudioSlnParser.h.in testVisualStudioSlnParser.h @ONLY)
|
||||
endif()
|
||||
|
||||
configure_file(testXMLParser.h.in testXMLParser.h @ONLY)
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/testUVProcessChainInput.txt" "HELLO WORLD!")
|
||||
|
||||
create_test_sourcelist(CMakeLib_TEST_SRCS CMakeLibTests.cxx ${CMakeLib_TESTS})
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
file Copyright.txt or https://cmake.org/licensing for details. */
|
||||
|
||||
#pragma once
|
||||
|
||||
#define SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@"
|
||||
#define BUILD_DIR "@CMAKE_CURRENT_BINARY_DIR@"
|
||||
@@ -1,10 +1,12 @@
|
||||
#include "testVisualStudioSlnParser.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "cmVisualStudioSlnData.h"
|
||||
#include "cmVisualStudioSlnParser.h"
|
||||
|
||||
#include "testConfig.h"
|
||||
|
||||
#define SLN_EXTENSION "sln-file"
|
||||
|
||||
static bool parsedRight(cmVisualStudioSlnParser& parser,
|
||||
const std::string& file, cmSlnData& data,
|
||||
cmVisualStudioSlnParser::ParseResult expected =
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#ifndef testVisualStudioSlnParser_h
|
||||
#define testVisualStudioSlnParser_h
|
||||
|
||||
#define SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@"
|
||||
#define SLN_EXTENSION "sln-file"
|
||||
|
||||
#endif
|
||||
@@ -1,9 +1,9 @@
|
||||
#include "testXMLParser.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "cmXMLParser.h"
|
||||
|
||||
#include "testConfig.h"
|
||||
|
||||
int testXMLParser(int /*unused*/, char* /*unused*/[])
|
||||
{
|
||||
// TODO: Derive from parser and check attributes.
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#ifndef testXMLParser_h
|
||||
#define testXMLParser_h
|
||||
|
||||
#define SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@"
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user