Very basic stuff working on linux 32-bit with dmd and phobos2.

This commit is contained in:
Steve King 2010-08-10 21:55:30 -07:00
parent f23eee9828
commit 67f0225e42
152 changed files with 113 additions and 0 deletions

3
.hgignore Normal file
View file

@ -0,0 +1,3 @@
.*\.cbp
.*\.layout
.*\.swp

View file

@ -0,0 +1,5 @@
int main( string[] args )
{
int require = 0;
return require;
}

View file

@ -0,0 +1,33 @@
#elif defined(__dmd__)
# define COMPILER_ID "DMD"
#elif defined(__gdc__)
# define COMPILER_ID "gdc"
#else /* unknown compiler */
# define COMPILER_ID ""
#endif
/* Construct the string literal in pieces to prevent the source from
getting matched. Store it in a pointer rather than an array
because some compilers will just produce instructions to fill the
array rather than assigning a pointer to a static array. */
char* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
@CMAKE_C_COMPILER_ID_PLATFORM_CONTENT@
/*--------------------------------------------------------------------------*/
#ifdef ID_VOID_MAIN
void main() {}
#else
int main(int argc, char* argv[])
{
int require = 0;
require += info_compiler[argc];
require += info_platform[argc];
require += info_arch[argc];
(void)argv;
return require;
}
#endif

9
tests/CMakeLists.txt Normal file
View file

@ -0,0 +1,9 @@
# Tell cmake our project only concerns the D language.
cmake_minimum_required(VERSION 2.8)
PROJECT (CMAKED2_TESTS D)
ADD_DEFINITIONS( -w -wi )
enable_testing()
ADD_SUBDIRECTORY (app_1)
ADD_SUBDIRECTORY (app_2)
ADD_SUBDIRECTORY (lib_1)
ADD_SUBDIRECTORY (app_3)

View file

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View file

Before

Width:  |  Height:  |  Size: 706 B

After

Width:  |  Height:  |  Size: 706 B

View file

Before

Width:  |  Height:  |  Size: 92 B

After

Width:  |  Height:  |  Size: 92 B

View file

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View file

Before

Width:  |  Height:  |  Size: 160 B

After

Width:  |  Height:  |  Size: 160 B

View file

Before

Width:  |  Height:  |  Size: 174 B

After

Width:  |  Height:  |  Size: 174 B

View file

Before

Width:  |  Height:  |  Size: 97 B

After

Width:  |  Height:  |  Size: 97 B

View file

Before

Width:  |  Height:  |  Size: 347 B

After

Width:  |  Height:  |  Size: 347 B

View file

Before

Width:  |  Height:  |  Size: 229 B

After

Width:  |  Height:  |  Size: 229 B

View file

Before

Width:  |  Height:  |  Size: 169 B

After

Width:  |  Height:  |  Size: 169 B

View file

Before

Width:  |  Height:  |  Size: 159 B

After

Width:  |  Height:  |  Size: 159 B

View file

Before

Width:  |  Height:  |  Size: 92 B

After

Width:  |  Height:  |  Size: 92 B

View file

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View file

Before

Width:  |  Height:  |  Size: 55 B

After

Width:  |  Height:  |  Size: 55 B

View file

Before

Width:  |  Height:  |  Size: 63 B

After

Width:  |  Height:  |  Size: 63 B

View file

Before

Width:  |  Height:  |  Size: 65 B

After

Width:  |  Height:  |  Size: 65 B

View file

Before

Width:  |  Height:  |  Size: 313 B

After

Width:  |  Height:  |  Size: 313 B

View file

Before

Width:  |  Height:  |  Size: 314 B

After

Width:  |  Height:  |  Size: 314 B

View file

Before

Width:  |  Height:  |  Size: 63 B

After

Width:  |  Height:  |  Size: 63 B

View file

Before

Width:  |  Height:  |  Size: 312 B

After

Width:  |  Height:  |  Size: 312 B

View file

Before

Width:  |  Height:  |  Size: 313 B

After

Width:  |  Height:  |  Size: 313 B

View file

@ -0,0 +1,2 @@
ADD_EXECUTABLE( app_1 app_1.d )
ADD_TEST( app_1 app_1 )

7
tests/app_1/app_1.d Normal file
View file

@ -0,0 +1,7 @@
/*
Barebones app, depends on nothing.
*/
int main()
{
return 0;
}

View file

@ -0,0 +1,2 @@
ADD_EXECUTABLE( app_2 app_2.d )
ADD_TEST( app_2 app_2 )

8
tests/app_2/app_2.d Normal file
View file

@ -0,0 +1,8 @@
// barebones app, depends on the standard library
import std.stdio;
int main()
{
writeln( "Hello World!" );
return 0;
}

View file

@ -0,0 +1,5 @@
ADD_EXECUTABLE ( app_3 app_3.d )
INCLUDE_DIRECTORIES( app3 ${PROJECT_SOURCE_DIR} )
MESSAGE( "Project source dir is ${PROJECT_SOURCE_DIR}" )
TARGET_LINK_LIBRARIES ( app_3 lib_1 )
ADD_TEST( app_3 app_3 )

9
tests/app_3/app_3.d Normal file
View file

@ -0,0 +1,9 @@
import lib_1.lib_1;
int main()
{
int x = 1;
int y = lib_1_func( x );
assert( y == x + 1 );
return 0;
}

View file

@ -0,0 +1 @@
ADD_LIBRARY (lib_1 lib_1.d)

6
tests/lib_1/lib_1.d Normal file
View file

@ -0,0 +1,6 @@
module lib_1.lib_1_func;
int lib_1_func( uint x )
{
return( x + 1 );
}

Some files were not shown because too many files have changed in this diff Show more