Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions dub.sdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name "dmd"
description "The DMD compiler"
authors "Walter Bright"
copyright "Copyright © 1999-2017, Digital Mars"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should have been D Language Foundation ;-)

Copy link
Contributor Author

@jacob-carlborg jacob-carlborg Jul 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not what the rest of the source files say 😉.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hehe, probably it was simply forgotten to update them

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CC @WalterBright @andralex - can we replace/update the copyright notice from Digital Mars to D Language Foundation?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm okay with it. @WalterBright ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-> #7004

license "BSL-1.0"

targetType "none"
dependency ":parser" version="*"

subPackage {
name "root"
targetType "library"
sourcePaths "src/ddmd/root"
}

subPackage {
name "lexer"
targetType "library"
sourcePaths

sourceFiles \
"src/ddmd/console.d" \
"src/ddmd/entity.d" \
"src/ddmd/errors.d" \
"src/ddmd/globals.d" \
"src/ddmd/id.d" \
"src/ddmd/identifier.d" \
"src/ddmd/lexer.d" \
"src/ddmd/tokens.d" \
"src/ddmd/utf.d"

// stringImportPaths cannot be used because it will make Dub extremely slow
// https://github.com/dlang/dub/issues/1199
dflags "-J$PACKAGE_DIR"

dependency "dmd:root" version="*"
}

subPackage {
name "parser"
targetType "library"
sourcePaths

sourceFiles \
"src/ddmd/astbase.d" \
"src/ddmd/astbasevisitor.d" \
"src/ddmd/parse.d"

dependency "dmd:lexer" version="*"
}
5 changes: 5 additions & 0 deletions test/dub_package/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.dub
docs.json
__dummy.html
*.o
*.obj
5 changes: 5 additions & 0 deletions test/dub_package/dub.sdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
name "dmd-dub-test"
description "Test of the DMD Dub package"
license "BSL 1.0"

dependency "dmd" path="../../"
45 changes: 45 additions & 0 deletions test/dub_package/source/app.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// The tests in this module are highlevel and mostly indented to make sure all
// necessary modules are included in the Dub package.

void main()
{
}

// lexer
unittest
{
import ddmd.lexer;
import ddmd.tokens;

immutable expected = [
TOKvoid,
TOKidentifier,
TOKlparen,
TOKrparen,
TOKlcurly,
TOKrcurly
];

immutable sourceCode = "void test() {} // foobar";
scope lexer = new Lexer("test", sourceCode.ptr, 0, sourceCode.length, 0, 0);
lexer.nextToken;

TOK[] result;

do
{
result ~= lexer.token.value;
} while (lexer.nextToken != TOKeof);

assert(result == expected);
}

// parser
unittest
{
import ddmd.astbase;
import ddmd.parse;

scope parser = new Parser!ASTBase(null, null, false);
assert(parser !is null);
}
8 changes: 8 additions & 0 deletions travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ rebuild() {

# test druntime, phobos, dmd
test() {
test_dub_package
make -j$N -C ../druntime -f posix.mak MODEL=$MODEL unittest
make -j$N -C ../phobos -f posix.mak MODEL=$MODEL unittest
test_dmd
Expand All @@ -69,6 +70,13 @@ test_dmd() {
fi
}

# test dub package
test_dub_package() {
pushd test/dub_package
dub test
popd
}

for proj in druntime phobos; do
if [ $TRAVIS_BRANCH != master ] && [ $TRAVIS_BRANCH != stable ] &&
! git ls-remote --exit-code --heads https://github.com/dlang/$proj.git $TRAVIS_BRANCH > /dev/null; then
Expand Down