Beispiel #1
0
 def test_failing_test_after_recursive_bit_installation(self):
     os.chdir(self.PROJECT_DIRECTORY)
     self.add_bit('test', 'cest', '1.0')
     self.add_test('test_case.cpp', fails=True)
     install.execute(['-s', 'http://localhost:8000'])
     result = test.execute([])
     assert result.status_code == 1
Beispiel #2
0
 def test_build_from_docker_image_with_toolchain_prefix(self):
     os.chdir(self.PROJECT_DIRECTORY)
     self.set_target_dockerfile('default', f'../environment/Dockerfile')
     self.set_toolchain_prefix('default', 'arm-linux-gnueabihf-')
     install.execute(['-s', 'http://localhost:8000'])
     result = build.execute([])
     assert result == Result(0, 'Build finished')
Beispiel #3
0
 def test_build_from_docker_image_with_non_default_target(self):
     os.chdir(self.PROJECT_DIRECTORY)
     self.set_target_image('ubuntu', 'cpmbits/ubuntu:20.04')
     self.set_target_main('ubuntu', 'main.cpp')
     install.execute(['-s', 'http://localhost:8000'])
     result = build.execute([])
     assert result == Result(0, 'Build finished')
Beispiel #4
0
 def test_build_after_recursive_bit_installation(self):
     os.chdir(self.PROJECT_DIRECTORY)
     self.add_bit('build', 'test', '1.0')
     self.set_libraries(['pthread', 'dl'])
     install.execute(['-s', 'http://localhost:8000'])
     result = build.execute([])
     assert result == Result(0, 'Build finished')
Beispiel #5
0
 def test_build_from_docker_image_with_ldflags(self):
     os.chdir(self.PROJECT_DIRECTORY)
     self.set_target_image('default', 'cpmbits/ubuntu:20.04')
     self.set_ldflags(['-Wl,--allow-multiple-definition'])
     self.set_target_ldflags('default', ['-Wl,-s'])
     install.execute(['-s', 'http://localhost:8000'])
     result = build.execute([])
     assert result == Result(0, 'Build finished')
Beispiel #6
0
 def test_publishing_template(self, user_input, getpass):
     user_input.return_value = 'user'
     getpass.return_value = 'password'
     os.chdir(self.PROJECT_DIRECTORY)
     self.set_target_dockerfile('default', f'../environment/Dockerfile')
     install.execute(['-s', 'http://localhost:8000'])
     result = publish.execute(['-t', '-s', 'http://localhost:8000'])
     assert result == Result(0, 'Project published')
Beispiel #7
0
 def test_after_recursive_bit_installation(self):
     os.chdir(self.PROJECT_DIRECTORY)
     self.add_bit('test', 'cest', '1.0')
     self.set_test_cflags(['-std=c++11'])
     self.add_test('test_case.cpp')
     install.execute(['-s', 'http://localhost:8000'])
     result = test.execute([])
     assert result.status_code == 0
Beispiel #8
0
 def test_build_after_recursive_bit_installation_for_target_not_described_by_bit(
         self):
     os.chdir(self.PROJECT_DIRECTORY)
     self.add_bit('build', 'test', '1.0')
     self.set_libraries(['pthread', 'dl'])
     self.set_target_main('rpi4', 'main.cpp')
     install.execute(['-s', 'http://localhost:8000'])
     result = build.execute(['rpi4'])
     assert result == Result(0, 'Build finished')
Beispiel #9
0
 def test_failing_test_when_running_inside_docker_image(self):
     os.chdir(self.PROJECT_DIRECTORY)
     self.add_bit('test', 'cest', '1.0')
     self.add_test('test_case.cpp', fails=True)
     self.set_target_image('default', 'cpmbits/ubuntu:20.04')
     self.set_target_test_image('default', 'cpmbits/ubuntu:20.04')
     install.execute(['-s', 'http://localhost:8000'])
     result = test.execute([])
     assert result.status_code == 1
Beispiel #10
0
 def test_specifying_test_directory(self):
     os.chdir(self.PROJECT_DIRECTORY)
     self.add_bit('test', 'cest', '1.0')
     self.set_test_cflags(['-std=c++11'])
     self.add_test('test_case1.cpp')
     self.add_test('test_case2.cpp')
     install.execute(['-s', 'http://localhost:8000'])
     result = test.execute(['tests'])
     assert result.status_code == 0
Beispiel #11
0
 def test_build_from_docker_image_with_post_build(self):
     os.chdir(self.PROJECT_DIRECTORY)
     self.set_target_image('default', 'cpmbits/ubuntu:20.04')
     self.set_post_build('default',
                         [f'ls', f'rm build/{self.PROJECT_NAME}'])
     install.execute(['-s', 'http://localhost:8000'])
     result = build.execute([])
     assert result == Result(0, 'Build finished')
     assert not filesystem.file_exists(f'build/{self.PROJECT_NAME}')
Beispiel #12
0
 def test_run_tests_from_docker_image(self):
     os.chdir(self.PROJECT_DIRECTORY)
     self.add_bit('test', 'cest', '1.0')
     self.set_target_image('default', 'cpmbits/ubuntu:20.04')
     self.set_target_test_image('default', 'cpmbits/ubuntu:20.04')
     self.set_test_ldflags(['-Wl,-s'])
     self.add_test('test_case.cpp')
     install.execute(['-s', 'http://localhost:8000'])
     result = test.execute([])
     assert result.status_code == 0
Beispiel #13
0
 def test_build_after_recursive_bit_installation(self):
     os.chdir(self.PROJECT_DIRECTORY)
     self.add_bit('build', 'test', '1.0')
     install.execute(['-s', 'http://localhost:8000'])
     build.execute([])
Beispiel #14
0
 def test_recursive_bit_installation(self):
     os.chdir(self.PROJECT_DIRECTORY)
     self.add_bit('build', 'test', '1.0')
     result = install.execute(['-s', 'http://localhost:8000'])
     assert result == Result(0, 'installed bits')
Beispiel #15
0
 def test_bit_installation_from_command_line_passed_bit(self):
     os.chdir(self.PROJECT_DIRECTORY)
     result = install.execute(['-s', 'http://localhost:8000', 'test:1.0'])
     assert result == Result(0, 'installed bit test:1.0')
Beispiel #16
0
 def test_build_from_docker_image(self):
     os.chdir(self.PROJECT_DIRECTORY)
     self.set_target_image('default', 'cpmbits/ubuntu:20.04')
     install.execute(['-s', 'http://localhost:8000'])
     build.execute([])
Beispiel #17
0
 def test_build_from_dockerfile(self):
     os.chdir(self.PROJECT_DIRECTORY)
     self.set_target_dockerfile('default', f'../environment/Dockerfile')
     install.execute(['-s', 'http://localhost:8000'])
     result = build.execute([])
     assert result == Result(0, 'Build finished')
Beispiel #18
0
 def test_build_from_dockerfile(self):
     os.chdir(self.PROJECT_DIRECTORY)
     self.set_target_dockerfile('default', f'../environment')
     install.execute(['-s', 'http://localhost:8000'])
     build.execute([])