Skip to content

Commit 5a7c0ba

Browse files
committed
Added functional test for the linker output cleanup function
1 parent ab69a71 commit 5a7c0ba

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Symfony/src/Codebender/CompilerBundle/Tests/Controller/DefaultControllerFunctionalTest.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,30 @@ public function testArchiveIsCreated()
225225
$this->assertTrue(file_exists($response['archive']));
226226
}
227227

228+
public function testCleanedUpLinkerError()
229+
{
230+
$files = array(array('filename' => 'Linker.ino', 'content' => 'void loop() { }'));
231+
$format = 'binary';
232+
$version = '105';
233+
$libraries = array();
234+
$build = array('mcu' => 'atmega328p', 'f_cpu' => '16000000', 'core' => 'arduino', 'variant' => 'standard');
235+
$data = json_encode(array('files' => $files, 'archive' => true, 'format' => $format, 'version' => $version, 'libraries' => $libraries, 'build' => $build));
236+
237+
$client = static::createClient();
238+
239+
$authorizationKey = $client->getContainer()->getParameter('authorizationKey');
240+
241+
$client->request('POST', '/' . $authorizationKey . '/v1', array(), array(), array(), $data);
242+
243+
$response = json_decode($client->getResponse()->getContent(), true);
244+
245+
$expectedLinkerError = "core.a(main.o): In function `main':
246+
main.cpp:(.text.main+0x8): undefined reference to `setup'";
247+
248+
$this->assertFalse($response['success']);
249+
$this->assertEquals($expectedLinkerError, $response['message']);
250+
}
251+
228252
public function testAutocomplete()
229253
{
230254
$this->markTestIncomplete('No tests for the code completion feature yet.');

0 commit comments

Comments
 (0)