// RegressionTestLupine.cm
-- Copyright (C) 1985 by Xerox Corporation.  All rights reserved.
-- edited by ADB on November 12, 1982 10:54 am.
-- edited by Bob Hagmann, February 8, 1985 5:19:12 pm PST


// Load latest Lupine if necessary.
//   Run Lupine


// The following translations should cause these respective errors:
   // Abort[NoSuchFile];
   // Abort[BadBcdFileVersion];
   // Abort[BadBcdFileFormat];
   // Abort[NotInterfaceModule].
   Lupine TranslateInterface[UnlikelyFileName.unlikelyFileName] TranslateInterface[RegressionTestLupine.cm] TranslateInterface[Lupine.bcd] TranslateInterface[LupineManagerImpl]
   
// Try various switch settings (which aren't checked further):
   Lupine TargetLanguage[BogusValue] TargetLanguage[Cedar] TargetLanguage[Mesa] 
        
   Lupine DefaultParameterPassing[BogusValue] DefaultParameterPassing[Var] DefaultParameterPassing[VALUE] DefaultParameterPassing[Result] DefaultParameterPassing[handle]
        
   Lupine InterMdsCalls[BogusValue] InterMdsCalls[TRUE] InterMdsCalls[FALSE]
         
   Lupine FreeServerArguments[BogusValue] FreeServerArguments[TRUE]      FreeServerArguments[FALSE]
        
   Lupine InlineDispatcherStubs[BogusValue] InlineDispatcherStubs[TRUE] InlineDispatcherStubs[FALSE]
        
   Lupine DynamicHeapNEWs[BogusValue, BogusValue] DynamicHeapNEWs[-100, -100]      DynamicHeapNEWs[0, 0] DynamicHeapNEWs[10000, 10000] DynamicHeapNEWs[40, 40]
        
   Lupine LineLength[BogusValue] LineLength[-100] LineLength[0] LineLength[10000] LineLength[40]
   

// Prepare to test some real interfaces:
   Compile LupineErrorTest LupineMarshalTest LupinePrintTest LupineTimeTest LupineTypeTest
   Delete Lupine*Test*RpcControl.mesa Lupine*Test*RpcClientImpl.mesa Lupine*Test*RpcBinderImpl.mesa Lupine*Test*RpcServerImpl.mesa


// Translate a translation error-testing interface.
// The translation results must checked manually:
   // LupineErrorTest causes all known translation-time errors.  Compare
   //   Lupine's typescript with the comments in LupineErrorTest.mesa.
   
   Lupine InterMdsCalls[FALSE] DefaultParameterPassing[Value] TranslateInterface[LupineErrorTest] DefaultParameterPassing[Var] TranslateInterface[LupineErrorTest] DefaultParameterPassing[Result]       TranslateInterface[LupineErrorTest] DefaultParameterPassing[Handle] TranslateInterface[LupineErrorTest] InterMdsCalls[TRUE] DefaultParameterPassing[Value] TranslateInterface[LupineErrorTest]
   

// Translate various test interfaces with Mesa as target language.
// The translation results must checked manually:
   // LupineErrorTest causes all known translation-time errors.  Compare
   //   Lupine's typescript with the comments in LupineErrorTest.mesa.
   //   The stubs should compile but raise ERRORs if executed.
   // LupinePrintTest exercises Lupine's type printing routines.  The
   //   resulting stub modules should compile with "incorrect type" errors
   //   because of record mismatches, but have no (or few) other problems.
   // LupineTimeTest is included here as an extra test.  It is
   //   actually tested by TimeTestLupine.cm.
   // LupineMarshalTest is included here as an extra test.  It is
   //   actually tested by MarshalTestLupine.cm.
   // LupineTypeTest exercises Lupine's ability to marshal all the types
   //   it claims to handle.  The stubs should compile correctly.
   
   Lupine TargetLanguage[Mesa] TranslateInterface[LupineErrorTest]      TranslateInterface[LupineTimeTest] InterMdsCalls[TRUE] TranslateInterface[LupinePrintTest] InterMdsCalls[FALSE] InlineDispatcherStubs[FALSE] TranslateInterface[LupineMarshalTest] TranslateInterface[LupineTypeTest]
   

// Check the results.  ErrorTest and PrintTest should clearly miscompile,
   // and TypeTest and MarshalTest will have errors because they use
   // Cedar features not recognized with Mesa as target.
   
   Compile LupineErrorTestRpcControl LupineMarshalTestRpcControl LupinePrintTestRpcControl LupineTimeTestRpcControl LupineTypeTestRpcControl
   Compile LupineErrorTestRpcClientImpl LupineMarshalTestRpcClientImpl LupinePrintTestRpcClientImpl LupineTimeTestRpcClientImpl LupineTypeTestRpcClientImpl
   Compile LupineErrorTestRpcBinderImpl LupineMarshalTestRpcBinderImpl LupinePrintTestRpcBinderImpl LupineTimeTestRpcBinderImpl LupineTypeTestRpcBinderImpl
   Compile LupineErrorTestRpcServerImpl LupineMarshalTestRpcServerImpl LupinePrintTestRpcServerImpl LupineTimeTestRpcServerImpl LupineTypeTestRpcServerImpl
   
   
   -- Compile Lupine*Test*RpcControl.mesa Lupine*Test*RpcClientImpl.mesa      Lupine*Test*RpcBinderImpl.mesa Lupine*Test*RpcServerImpl.mesa
     
   Delete Lupine*Test*RpcControl.mesa Lupine*Test*RpcClientImpl.mesa Lupine*Test*RpcBinderImpl.mesa Lupine*Test*RpcServerImpl.mesa


// Translate a couple of the test interfaces with Cedar as target language.
// This test proceeds similar to the one above, but all should compile.

   Lupine TargetLanguage[Cedar] TranslateInterface[LupineTimeTest] InlineDispatcherStubs[FALSE] TranslateInterface[LupineMarshalTest]      TranslateInterface[LupineTypeTest]
   

// Check the results (all should compile):
   Compile LupineErrorTestRpcControl LupineMarshalTestRpcControl LupinePrintTestRpcControl LupineTimeTestRpcControl LupineTypeTestRpcControl
   Compile LupineErrorTestRpcClientImpl LupineMarshalTestRpcClientImpl LupinePrintTestRpcClientImpl LupineTimeTestRpcClientImpl LupineTypeTestRpcClientImpl
   Compile LupineErrorTestRpcBinderImpl LupineMarshalTestRpcBinderImpl LupinePrintTestRpcBinderImpl LupineTimeTestRpcBinderImpl LupineTypeTestRpcBinderImpl
   Compile LupineErrorTestRpcServerImpl LupineMarshalTestRpcServerImpl LupinePrintTestRpcServerImpl LupineTimeTestRpcServerImpl LupineTypeTestRpcServerImpl
   
   -- Compile Lupine*Test*RpcControl.mesa Lupine*Test*RpcClientImpl.mesa Lupine*Test*RpcBinderImpl.mesa Lupine*Test*RpcServerImpl.mesa
   
   Delete Lupine*Test*RpcControl.mesa Lupine*Test*RpcClientImpl.mesa Lupine*Test*RpcBinderImpl.mesa Lupine*Test*RpcServerImpl.mesa


// Translate various test interfaces for interMDS calls.
// This test proceeds similar to the one above.  All should compile.
   
   Lupine InterMdsCalls[TRUE] TranslateInterface[LupineTimeTest] TranslateInterface[LupineMarshalTest] TranslateInterface[LupineTypeTest]
   

// Check the results:
   
   Compile LupineErrorTestRpcControl LupineMarshalTestRpcControl LupinePrintTestRpcControl LupineTimeTestRpcControl LupineTypeTestRpcControl
   Compile LupineErrorTestRpcClientImpl LupineMarshalTestRpcClientImpl LupinePrintTestRpcClientImpl LupineTimeTestRpcClientImpl LupineTypeTestRpcClientImpl
   Compile LupineErrorTestRpcBinderImpl LupineMarshalTestRpcBinderImpl LupinePrintTestRpcBinderImpl LupineTimeTestRpcBinderImpl LupineTypeTestRpcBinderImpl
   Compile LupineErrorTestRpcServerImpl LupineMarshalTestRpcServerImpl LupinePrintTestRpcServerImpl LupineTimeTestRpcServerImpl LupineTypeTestRpcServerImpl
   
   -- Compile Lupine*Test*RpcControl.mesa Lupine*Test*RpcClientImpl.mesa Lupine*Test*RpcBinderImpl.mesa Lupine*Test*RpcServerImpl.mesa

   Delete Lupine*Test*RpcControl.mesa Lupine*Test*RpcClientImpl.mesa      Lupine*Test*RpcBinderImpl.mesa Lupine*Test*RpcServerImpl.mesa