prosyslab-classroom / cs348-information-security

61 stars 10 forks source link

[Question][Hw0-2] How to run tests #201

Closed nybunny closed 1 year ago

nybunny commented 1 year ago

Name: 이나연

How can I run a test for a single problem? (And where should I run it?)

When I type dune exec test/[Problem name]Test.exe on the Docker terminal this happens: $ dir Makefile README.md _build doc dune dune-project pagerank quine quineEx src test zip $ dune build test/calculatorTest.exe File "test/dune", line 4, characters 39-49: 4 | (test (name calculatorTest) (libraries calculator oUnit) (modules calculatorTest)) ^^^^^^^^^^ Error: Library "calculator" not found. -> required by _build/default/test/calculatorTest.exe

I searched the web but couldn't find any library called calculator... what did I miss?

m-spitfire commented 1 year ago

you should have

(library (name calculator) (modules calculator))

in src/dune, check if the file exists and it contains the value.

nybunny commented 1 year ago

I checked the directories; for some reason the test started to work after I deleted some files in src (that I made accidentally by compiling/testing inside the src folder). Problem solved.