Skip to content

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Jun 14, 2016

What's in this pull request?

Add %target-run-simple-swiftgyb substitution which will be expended to:

rm -rf %t && \
mkdir -p %t && \
%gyb %s -o %t/main.swift && \
%line-directive %t/main.swift -- %target-build-swift %t/main.swift -o %t/a.out -module-name main && \
%line-directive %t/main.swift -- %target-run %t/a.out

As ground works:

  • GYB: Added __file__ binding to templates.
  • Adjusted validation-test/stdlib/{Collection,Slice}
    • Modified Input/Template.swift.gyb utils/split_file.py compatible
    • Since result scripts are not gyb file, use %target-run-simple-swift substitution
    • Renamed validation-test/stdlib/Slice/*.swift.gyb to validation-test/stdlib/Slice/*.swift

Before merging this pull request to apple/swift repository:

  • Test pull request on Swift continuous integration.

config.target_run_simple_swiftgyb = (
'rm -rf %%t && mkdir -p %%t && '
'%%gyb %%s -o %%t/main.swift && '
'%%line-directive %%t/main.swift -- %s %%t/main.swift'
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the build step somehow missing here?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is for interpret mode: I think swift command would build and run the script.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see -- you're absolutely right.

@gribozavr
Copy link
Contributor

@swift-ci Please test

@gribozavr
Copy link
Contributor

@swift-ci Please smoke test

@gribozavr
Copy link
Contributor

@rintaro This is a massive simplification, thank you!

@@ -116,3 +112,4 @@ SliceTests.addMutableRandomAccessCollectionTests(
)

runAllTests()

Copy link
Member Author

@rintaro rintaro Jun 14, 2016

Choose a reason for hiding this comment

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

This new line is undesirable change. will fix.

@rintaro rintaro force-pushed the tests-target-simple-run-swiftgyb branch from 3e3c08d to ac1f00b Compare June 14, 2016 10:48
@rintaro rintaro force-pushed the tests-target-simple-run-swiftgyb branch 2 times, most recently from dd2d68e to 36cf373 Compare June 14, 2016 11:17
@gribozavr
Copy link
Contributor

@swift-ci Please test

@gribozavr
Copy link
Contributor

@swift-ci Please smoke test

@gribozavr
Copy link
Contributor

@rintaro I'm sorry -- swiftpm build seems to be broken, which blocks running Swift tests. I'm afraid of merging a large change during this time, I'd prefer to wait until the master branch is more healthy.

@rintaro rintaro force-pushed the tests-target-simple-run-swiftgyb branch 2 times, most recently from f544d95 to 36cf373 Compare June 15, 2016 02:48
rintaro added 4 commits June 15, 2016 11:49
* utils/split_file.py compatible Inputs/Template.swift.gyb
* Result scripts can be ran by %target-run-simple-swift, not GYB
* Renamed stdlib/Slice/*.swift.gyb to stdlib/Slice/*.swift
* Utilize %target-run-simple-swiftgyb where possible
@rintaro rintaro force-pushed the tests-target-simple-run-swiftgyb branch from 36cf373 to ea2c7a6 Compare June 15, 2016 02:49
@rintaro
Copy link
Member Author

rintaro commented Jun 15, 2016

Confirmed recent change doesn't need this substitution.
To make sure it will cleanly merge, I rebased on the master.

@swift-ci Please test

@rintaro
Copy link
Member Author

rintaro commented Jun 15, 2016

@swift-ci Please smoke test

@gribozavr gribozavr merged commit efc351f into swiftlang:master Jun 15, 2016
@rintaro rintaro deleted the tests-target-simple-run-swiftgyb branch June 15, 2016 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants