Commit 803ebc00 authored by ankit kariryaa's avatar ankit kariryaa
Browse files

Initialize Orca with scala class and scala tests

parent e9e857cf
# use glob syntax.
syntax: glob
*.ser
*.class
*~
*.bak
#*.off
*.old
*.pyc
*.bk
*.swp
.DS_Store
# logging files
detailed.log
# eclipse conf file
.settings
.classpath
.project
.manager
.scala_dependencies
# idea
.idea
*.iml
# building
target
build
null
tmp*
temp*
dist
test-output
build.log
# other scm
.svn
.CVS
.hg*
# switch to regexp syntax.
# syntax: regexp
# ^\.pc/
#SHITTY output not in target directory
build.log
#emacs TAGS
TAGS
lib/
env/
stages:
- test
testing:
stage: test
script:
- cd .. && rm -rf nomad-lab-base
- git clone --recursive git@gitlab.mpcdf.mpg.de:nomad-lab/nomad-lab-base.git
- cd nomad-lab-base
- git submodule foreach git checkout master
- git submodule foreach git pull
- sbt ocra/test
only:
- master
tags:
- test
- spec2
allow_failure: true
\ No newline at end of file
package eu.nomad_lab.parsers
import eu.{ nomad_lab => lab }
import eu.nomad_lab.DefaultPythonInterpreter
import org.{ json4s => jn }
import scala.collection.breakOut
object OrcaParser extends SimpleExternalParserGenerator(
name = "OrcaParser",
parserInfo = jn.JObject(
("name" -> jn.JString("OrcaParser")) ::
("parserId" -> jn.JString("OrcaParser" + lab.OrcaVersionInfo.version)) ::
("versionInfo" -> jn.JObject(
("nomadCoreVersion" -> jn.JObject(lab.NomadCoreVersionInfo.toMap.map {
case (k, v) => k -> jn.JString(v.toString)
}(breakOut): List[(String, jn.JString)])) ::
(lab.OrcaVersionInfo.toMap.map {
case (key, value) =>
(key -> jn.JString(value.toString))
}(breakOut): List[(String, jn.JString)])
)) :: Nil
),
mainFileTypes = Seq("text/.*"),
//TODO: Update the replacement string (mainFileRe)
mainFileRe = """ """.r,
cmd = Seq(DefaultPythonInterpreter.python2Exe(), "${envDir}/parsers/orca/parser/parser-orca/OrcaParser.py",
"--uri", "${mainFileUri}", "${mainFilePath}"),
resList = Seq(
"parser-orca/OrcaParser.py",
"parser-orca/setup_paths.py",
"nomad_meta_info/public.nomadmetainfo.json",
"nomad_meta_info/common.nomadmetainfo.json",
"nomad_meta_info/meta_types.nomadmetainfo.json",
"nomad_meta_info/orca.nomadmetainfo.json"
) ++ DefaultPythonInterpreter.commonFiles(),
dirMap = Map(
"parser-orca" -> "parsers/orca/parser/parser-orca",
"nomad_meta_info" -> "nomad-meta-info/meta_info/nomad_meta_info"
) ++ DefaultPythonInterpreter.commonDirMapping()
)
package eu.nomad_lab.parsers
import org.specs2.mutable.Specification
object OrcaParserSpec extends Specification {
"OrcaParserTest" >> {
"test with json-events" >> {
ParserRun.parse(OrcaParser, "parsers/orca/test/examples/", "json-events") must_== ParseResult.ParseSuccess
}
"test with json" >> {
ParserRun.parse(OrcaParser, "parsers/orca/test/examples/", "json") must_== ParseResult.ParseSuccess
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment