Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LARA
inox
Commits
04ef4c6e
Commit
04ef4c6e
authored
10 years ago
by
Etienne Kneuss
Browse files
Options
Downloads
Patches
Plain Diff
Fix tests not to rely on hardcoded paths
parent
afdc41af
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/test/scala/leon/test/LeonTestSuite.scala
+0
-3
0 additions, 3 deletions
src/test/scala/leon/test/LeonTestSuite.scala
src/test/scala/leon/test/frontends/FrontEndsTest.scala
+6
-7
6 additions, 7 deletions
src/test/scala/leon/test/frontends/FrontEndsTest.scala
with
6 additions
and
10 deletions
src/test/scala/leon/test/LeonTestSuite.scala
+
0
−
3
View file @
04ef4c6e
...
@@ -15,9 +15,6 @@ import org.scalatest.exceptions.TestFailedException
...
@@ -15,9 +15,6 @@ import org.scalatest.exceptions.TestFailedException
import
java.io.File
import
java.io.File
trait
LeonTestSuite
extends
FunSuite
with
Timeouts
with
BeforeAndAfterEach
{
trait
LeonTestSuite
extends
FunSuite
with
Timeouts
with
BeforeAndAfterEach
{
// Hard-code output directory, for Eclipse purposes
def
outputDirHard
(
path
:
String
)
=
new
File
(
"target/scala-2.10/test-classes/regression/"
+
path
)
// Hard-code resource directory, for Eclipse purposes
// Hard-code resource directory, for Eclipse purposes
val
resourceDirHard
=
"src/test/resources/regression/"
val
resourceDirHard
=
"src/test/resources/regression/"
...
...
This diff is collapsed.
Click to expand it.
src/test/scala/leon/test/frontends/FrontEndsTest.scala
+
6
−
7
View file @
04ef4c6e
...
@@ -4,10 +4,9 @@ import leon._
...
@@ -4,10 +4,9 @@ import leon._
import
java.io.File
import
java.io.File
class
FrontEndsTest
extends
leon
.
test
.
LeonTestSuite
{
class
FrontEndsTest
extends
leon
.
test
.
LeonTestSuite
{
// Hard-code output directory, for Eclipse purposes
val
inputFilePath
=
"frontends"
lazy
val
tmpPath
=
java
.
nio
.
file
.
Files
.
createTempDirectory
(
"leon-frontends"
);
val
outputFilePath
=
"frontends"
private
def
forEachFileIn
(
path
:
String
)(
block
:
File
=>
Unit
)
{
private
def
forEachFileIn
(
path
:
String
)(
block
:
File
=>
Unit
)
{
val
fs
=
filesInResourceDir
(
path
,
_
.
endsWith
(
".scala"
))
val
fs
=
filesInResourceDir
(
path
,
_
.
endsWith
(
".scala"
))
...
@@ -33,13 +32,13 @@ class FrontEndsTest extends leon.test.LeonTestSuite {
...
@@ -33,13 +32,13 @@ class FrontEndsTest extends leon.test.LeonTestSuite {
purescala
.
RestoreMethods
andThen
purescala
.
RestoreMethods
andThen
utils
.
FileOutputPhase
utils
.
FileOutputPhase
forEachFileIn
(
inputFilePath
)
{
f
=>
forEachFileIn
(
"frontends"
)
{
f
=>
testExtr
(
f
)
testExtr
(
f
)
}
}
def
testExtr
(
f
:
File
)
{
def
testExtr
(
f
:
File
)
{
val
outFileName1
=
outputDirHard
(
outputFilePath
).
getAbsolutePath
()
++
"/"
++
f
.
getName
val
outFileName1
=
tmpPath
.
toString
++
"/"
++
f
.
getName
val
outFileName2
=
outputDirHard
(
outputFilePath
).
getAbsolutePath
()
++
"/restored"
++
f
.
getName
val
outFileName2
=
tmpPath
.
toString
++
"/restored"
++
f
.
getName
test
(
"Testing "
+
f
.
getName
)
{
test
(
"Testing "
+
f
.
getName
)
{
// Compile original file
// Compile original file
val
timeOut
=
2
val
timeOut
=
2
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment