comparison tests/js-directory/main.cpp @ 532:c59b87f66b67

CMake: share same resources, closes #725
author David Demelier <markand@malikania.fr>
date Thu, 16 Nov 2017 23:59:37 +0100
parents b3a0f61a35fe
children 194162717ec9
comparison
equal deleted inserted replaced
531:d71c59eb04c3 532:c59b87f66b67
28 BOOST_FIXTURE_TEST_SUITE(directory_jsapi_suite, js_test<directory_jsapi>) 28 BOOST_FIXTURE_TEST_SUITE(directory_jsapi_suite, js_test<directory_jsapi>)
29 29
30 BOOST_AUTO_TEST_CASE(constructor) 30 BOOST_AUTO_TEST_CASE(constructor)
31 { 31 {
32 const std::string script( 32 const std::string script(
33 "d = new Irccd.Directory(TESTS_BINARY_DIR + \"/root\");" 33 "d = new Irccd.Directory(CMAKE_SOURCE_DIR + \"/tests/root\");"
34 "p = d.path;" 34 "p = d.path;"
35 "l = d.entries.length;" 35 "l = d.entries.length;"
36 ); 36 );
37 37
38 if (duk_peval_string(plugin_->context(), script.c_str()) != 0) 38 if (duk_peval_string(plugin_->context(), script.c_str()) != 0)
39 throw dukx_exception(plugin_->context(), -1); 39 throw dukx_exception(plugin_->context(), -1);
40 40
41 duk_get_global_string(plugin_->context(), "l"); 41 duk_get_global_string(plugin_->context(), "l");
42 BOOST_TEST(duk_get_int(plugin_->context(), -1) == 2); 42 BOOST_TEST(duk_get_int(plugin_->context(), -1) == 3);
43 } 43 }
44 44
45 BOOST_AUTO_TEST_SUITE_END() 45 BOOST_AUTO_TEST_SUITE_END()
46 46
47 } // !irccd 47 } // !irccd