Remove src/linux

It was a deprecated experiment
This commit is contained in:
Andrew Schwartzmeyer 2015-09-18 12:46:03 -07:00
parent 8145ea26a4
commit c6ca50c618
9 changed files with 0 additions and 383 deletions

View file

@ -1,37 +0,0 @@
cmake_minimum_required(VERSION 2.8.4)
project(linux)
set(CMAKE_CXX_COMPILER /usr/bin/clang++)
# generic settings
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++")
# include folders from PS for Linux
include_directories(${PROJECT_SOURCE_DIR}/stubs)
# add coreclr
# - PLATFORM_UNIX is for pal headers
# - PAL_IMPLEMENTATION is for pal headers to define required function implementations (required for coreclr)
# - __LINUX__ defines the pal headers correctly define stuff for linux
# - COM_NO_WINDOWS_H defines that coreclr headers are not used on windows
# - CORECRL required for PowerShell code to enable CoreCRL support
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DPLATFORM_UNIX -DPAL_IMPLEMENTATION -D__LINUX__ -DCOM_NO_WINDOWS_H -DCORECLR")
include_directories(${PROJECT_SOURCE_DIR}/../coreclr/src/pal/inc)
#include_directories(${PROJECT_SOURCE_DIR}/../coreclr/src/pal/prebuilt/inc)
# include folders from PS
include_directories(${PROJECT_SOURCE_DIR}/../monad/monad/nttargets/assemblies/nativemsh/pwrshcommon)
set(SOURCE_FILES main.cpp
test/test_pal.cpp
#../monad/monad/nttargets/assemblies/nativemsh/pwrshexe/CssMainEntry.cpp
)
add_executable(linux ${SOURCE_FILES})
# add cppunit
include_directories(${PROJECT_SOURCE_DIR}/../../externals/cppunit/include)
find_library(LIB_CPPUNIT cppunit ${PROJECT_SOURCE_DIR}/../../externals/cppunit/lib)
target_link_libraries(linux ${LIB_CPPUNIT})
message(STATUS "cppunit lib: ${LIB_CPPUNIT}")

View file

@ -1,38 +0,0 @@
#include <iostream>
#include <cppunit/BriefTestProgressListener.h>
#include <cppunit/CompilerOutputter.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/TestResult.h>
#include <cppunit/TestResultCollector.h>
#include <cppunit/TestRunner.h>
int runTests()
{
// Create the event manager and test controller
CPPUNIT_NS::TestResult controller;
// Add a listener that collects test result
CPPUNIT_NS::TestResultCollector result;
controller.addListener(&result);
// Add a listener that prints status update dots while the tests run
CPPUNIT_NS::BriefTestProgressListener progress;
controller.addListener(&progress);
// Add the top suite to the test runner
CPPUNIT_NS::TestRunner runner;
runner.addTest(CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest());
runner.run(controller);
// Print test in a compiler compatible format.
CPPUNIT_NS::CompilerOutputter outputter(&result,CPPUNIT_NS::stdCOut());
outputter.write();
return result.wasSuccessful() ? 0 : 1;
}
int main(int, char**) {
std::cout << "Hello, World!" << std::endl;
return runTests();
}

View file

@ -1,17 +0,0 @@
// pal.h will provide everything windows.h otherwise would
#include "pal.h"
#include "rt/palrt.h"
// SAL annotations
#define _In_
#define _Reserved_
#define _Out_
#define _In_opt_
#define __deref_out_opt
#define __deref_out_ecount(COUNT)
#define __inout_ecount(COUNT)
#define __out_ecount(COUNT)
#define _Success_(VALUE)
#define _In_z_

View file

@ -1,175 +0,0 @@
#pragma once
#include "pal.h"
#include "rt/palrt.h"
//!
//! This header pulls in actual items from the original mscoree.h and also
//! defines stub classes and functions.
//!
typedef /* [public][public] */
enum __MIDL___MIDL_itf_mscoree_0000_0000_0002
{
STARTUP_CONCURRENT_GC = 0x1,
STARTUP_LOADER_OPTIMIZATION_MASK = ( 0x3 << 1 ) ,
STARTUP_LOADER_OPTIMIZATION_SINGLE_DOMAIN = ( 0x1 << 1 ) ,
STARTUP_LOADER_OPTIMIZATION_MULTI_DOMAIN = ( 0x2 << 1 ) ,
STARTUP_LOADER_OPTIMIZATION_MULTI_DOMAIN_HOST = ( 0x3 << 1 ) ,
STARTUP_LOADER_SAFEMODE = 0x10,
STARTUP_LOADER_SETPREFERENCE = 0x100,
STARTUP_SERVER_GC = 0x1000,
STARTUP_HOARD_GC_VM = 0x2000,
STARTUP_SINGLE_VERSION_HOSTING_INTERFACE = 0x4000,
STARTUP_LEGACY_IMPERSONATION = 0x10000,
STARTUP_DISABLE_COMMITTHREADSTACK = 0x20000,
STARTUP_ALWAYSFLOW_IMPERSONATION = 0x40000,
STARTUP_TRIM_GC_COMMIT = 0x80000,
STARTUP_ETW = 0x100000,
STARTUP_ARM = 0x400000,
STARTUP_SINGLE_APPDOMAIN = 0x800000,
STARTUP_APPX_APP_MODEL = 0x1000000,
STARTUP_DISABLE_RANDOMIZED_STRING_HASHING = 0x2000000
} STARTUP_FLAGS;
// other datatypes
typedef HRESULT ( __stdcall *FExecuteInAppDomainCallback )(
void *cookie);
// interfaces
class IUnknown
{
public:
ULONG AddRef()
{
return 0;
}
ULONG Release()
{
return 0;
}
HRESULT QueryInterface(
REFIID riid,
void **ppvObject
)
{
return S_OK;
}
};
struct IActivationFactory
{};
class IHostControl : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE GetHostManager(
/* [in] */ REFIID riid,
/* [out] */ void **ppObject) = 0;
virtual HRESULT STDMETHODCALLTYPE SetAppDomainManager(
/* [in] */ DWORD dwAppDomainID,
/* [in] */ IUnknown *pUnkAppDomainManager) = 0;
};
class ICLRControl : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE GetCLRManager(
/* [in] */ REFIID riid,
/* [out] */ void **ppObject) = 0;
virtual HRESULT STDMETHODCALLTYPE SetAppDomainManagerType(
/* [in] */ LPCWSTR pwzAppDomainManagerAssembly,
/* [in] */ LPCWSTR pwzAppDomainManagerType) = 0;
};
class ICLRRuntimeHost : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Start( void) = 0;
virtual HRESULT STDMETHODCALLTYPE Stop( void) = 0;
virtual HRESULT STDMETHODCALLTYPE SetHostControl(
/* [in] */ IHostControl *pHostControl) = 0;
virtual HRESULT STDMETHODCALLTYPE GetCLRControl(
/* [out] */ ICLRControl **pCLRControl) = 0;
virtual HRESULT STDMETHODCALLTYPE UnloadAppDomain(
/* [in] */ DWORD dwAppDomainId,
/* [in] */ BOOL fWaitUntilDone) = 0;
virtual HRESULT STDMETHODCALLTYPE ExecuteInAppDomain(
/* [in] */ DWORD dwAppDomainId,
/* [in] */ FExecuteInAppDomainCallback pCallback,
/* [in] */ void *cookie) = 0;
virtual HRESULT STDMETHODCALLTYPE GetCurrentAppDomainId(
/* [out] */ DWORD *pdwAppDomainId) = 0;
virtual HRESULT STDMETHODCALLTYPE ExecuteApplication(
/* [in] */ LPCWSTR pwzAppFullName,
/* [in] */ DWORD dwManifestPaths,
/* [in] */ LPCWSTR *ppwzManifestPaths,
/* [in] */ DWORD dwActivationData,
/* [in] */ LPCWSTR *ppwzActivationData,
/* [out] */ int *pReturnValue) = 0;
virtual HRESULT STDMETHODCALLTYPE ExecuteInDefaultAppDomain(
/* [in] */ LPCWSTR pwzAssemblyPath,
/* [in] */ LPCWSTR pwzTypeName,
/* [in] */ LPCWSTR pwzMethodName,
/* [in] */ LPCWSTR pwzArgument,
/* [out] */ DWORD *pReturnValue) = 0;
};
class ICLRRuntimeHost2 : public ICLRRuntimeHost
{
public:
virtual HRESULT STDMETHODCALLTYPE CreateAppDomainWithManager(
/* [in] */ LPCWSTR wszFriendlyName,
/* [in] */ DWORD dwFlags,
/* [in] */ LPCWSTR wszAppDomainManagerAssemblyName,
/* [in] */ LPCWSTR wszAppDomainManagerTypeName,
/* [in] */ int nProperties,
/* [in] */ LPCWSTR *pPropertyNames,
/* [in] */ LPCWSTR *pPropertyValues,
/* [out] */ DWORD *pAppDomainID) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateDelegate(
/* [in] */ DWORD appDomainID,
/* [in] */ LPCWSTR wszAssemblyName,
/* [in] */ LPCWSTR wszClassName,
/* [in] */ LPCWSTR wszMethodName,
/* [out] */ INT_PTR *fnPtr) = 0;
virtual HRESULT STDMETHODCALLTYPE Authenticate(
/* [in] */ ULONGLONG authKey) = 0;
virtual HRESULT STDMETHODCALLTYPE RegisterMacEHPort( void) = 0;
virtual HRESULT STDMETHODCALLTYPE SetStartupFlags(
/* [in] */ STARTUP_FLAGS dwFlags) = 0;
virtual HRESULT STDMETHODCALLTYPE DllGetActivationFactory(
/* [in] */ DWORD appDomainID,
/* [in] */ LPCWSTR wszTypeName,
/* [out] */ IActivationFactory **factory) = 0;
virtual HRESULT STDMETHODCALLTYPE ExecuteAssembly(
/* [in] */ DWORD dwAppDomainId,
/* [in] */ LPCWSTR pwzAssemblyPath,
/* [in] */ int argc,
/* [in] */ LPCWSTR *argv,
/* [out] */ DWORD *pReturnValue) = 0;
};

View file

View file

@ -1,10 +0,0 @@
#pragma once
#include "pal.h"
DWORD WINAPI ExpandEnvironmentStringsW(
PCWSTR lpSrc,
PWSTR lpDst,
DWORD nSize
);

View file

@ -1,89 +0,0 @@
#include "pal.h"
#include "test_pal.h"
// pull in some more headers
#include "NativeMshConstants.h"
#include "ClrHostWrapper.h"
#include "IPwrshCommonOutput.h"
#include "ConfigFileReader.h"
#include "NativeMsh.h"
#include "SystemCallFacade.h"
#include "WinSystemCallFacade.h"
namespace Microsoft {
CPPUNIT_TEST_SUITE_REGISTRATION(PalTestSuite);
// this unit test is used to test if stuff from different headers was pulled in correctly
// this is for porting compatbility tests, not really functional tests
void PalTestSuite::testHeaders() {
// check NativeMshConstants.h
CPPUNIT_ASSERT_EQUAL(NativeMsh::g_MISSING_COMMAND_LINE_ARGUMENT,1);
// check ClrHostWrapper.h
NativeMsh::ICLRRuntimeHost2Wrapper clrHostWrapper;
}
void PalTestSuite::testDatatypes() {
// check basic pointer lengths
CPPUNIT_ASSERT_EQUAL(sizeof(void*), sizeof(PVOID));
// windows datatypes
CPPUNIT_ASSERT_EQUAL(sizeof(WORD),(std::size_t)2);
CPPUNIT_ASSERT_EQUAL(sizeof(DWORD),(std::size_t)4);
CPPUNIT_ASSERT_EQUAL(sizeof(HANDLE),sizeof(void*));
CPPUNIT_ASSERT_EQUAL(sizeof(HWND),sizeof(void*));
CPPUNIT_ASSERT_EQUAL(sizeof(HMODULE),sizeof(void*));
CPPUNIT_ASSERT_EQUAL(sizeof(HINSTANCE),sizeof(void*));
CPPUNIT_ASSERT_EQUAL(sizeof(HGLOBAL),sizeof(void*));
CPPUNIT_ASSERT_EQUAL(sizeof(HLOCAL),sizeof(void*));
CPPUNIT_ASSERT_EQUAL(sizeof(HRSRC),sizeof(void*));
CPPUNIT_ASSERT_EQUAL(sizeof(HRESULT),sizeof(LONG));
CPPUNIT_ASSERT_EQUAL(sizeof(NTSTATUS),sizeof(LONG));
// windows integer datatypes
CPPUNIT_ASSERT_EQUAL(sizeof(INT),(std::size_t)4);
CPPUNIT_ASSERT_EQUAL(sizeof(INT8),(std::size_t)1);
CPPUNIT_ASSERT_EQUAL(sizeof(INT16),(std::size_t)2);
CPPUNIT_ASSERT_EQUAL(sizeof(INT32),(std::size_t)4);
CPPUNIT_ASSERT_EQUAL(sizeof(INT64),(std::size_t)8);
CPPUNIT_ASSERT_EQUAL(sizeof(UINT),(std::size_t)4);
CPPUNIT_ASSERT_EQUAL(sizeof(UINT8),(std::size_t)1);
CPPUNIT_ASSERT_EQUAL(sizeof(UINT16),(std::size_t)2);
CPPUNIT_ASSERT_EQUAL(sizeof(UINT32),(std::size_t)4);
CPPUNIT_ASSERT_EQUAL(sizeof(UINT64),(std::size_t)8);
// windows integer max and min size constants
CPPUNIT_ASSERT_EQUAL(CHAR_BIT,8);
CPPUNIT_ASSERT_EQUAL(SCHAR_MIN,-127-1);
CPPUNIT_ASSERT_EQUAL(SCHAR_MAX,127);
CPPUNIT_ASSERT_EQUAL(UCHAR_MAX,0xff);
CPPUNIT_ASSERT_EQUAL(SHRT_MIN,-32767-1);
CPPUNIT_ASSERT_EQUAL(SHRT_MAX,32767);
CPPUNIT_ASSERT_EQUAL(USHRT_MAX,0xffff);
CPPUNIT_ASSERT_EQUAL(INT_MIN,-2147483647-1);
CPPUNIT_ASSERT_EQUAL(INT_MAX,2147483647);
CPPUNIT_ASSERT_EQUAL(UINT_MAX,0xffffffff);
// TODO: these are part of limits.h and will never fit windows values
// CPPUNIT_ASSERT_EQUAL(LONG_MIN,-2147483647L-1);
// CPPUNIT_ASSERT_EQUAL(LONG_MAX,2147483647L);
// CPPUNIT_ASSERT_EQUAL(ULONG_MAX,0xffffffffUL);
CPPUNIT_ASSERT_EQUAL(MAXSHORT,0x7fff);
CPPUNIT_ASSERT_EQUAL(MAXLONG,0x7fffffff);
CPPUNIT_ASSERT_EQUAL(MAXCHAR,0x7f);
CPPUNIT_ASSERT_EQUAL(MAXDWORD,0xffffffff);
// character data types
CPPUNIT_ASSERT_EQUAL(sizeof(CHAR),(std::size_t)1);
CPPUNIT_ASSERT_EQUAL(sizeof(TCHAR),(std::size_t)1);
}
}

View file

@ -1,17 +0,0 @@
#include <cppunit/extensions/HelperMacros.h>
namespace Microsoft {
class PalTestSuite : public CPPUNIT_NS::TestFixture {
CPPUNIT_TEST_SUITE(PalTestSuite);
CPPUNIT_TEST(testHeaders);
CPPUNIT_TEST(testDatatypes);
CPPUNIT_TEST_SUITE_END();
public:
void testHeaders();
void testDatatypes();
};
}